font

Determine width of string in HTML5 canvas

匿名 (未验证) 提交于 2019-12-03 09:13:36
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm drawing text in an HTML5 canvas on top of an image (a meme generator). I want to calculate a font size so that the string will span the entire width of the canvas. So basically, is there a way in JavaScript to determine what font size I should use for some string of a certain font for a given width? 回答1: The fillText() method has an optional fourth argument, which is the max width to render the string. MDN's documentation says... maxWidth Optional; the maximum width to draw. If specified, and the string is computed to be wider than this

Changing the height of a jquery datepicker

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to change the height of a datepicker I am using. I have been working through firebug and was able to change the width by editing the ui-datepicker class like so: .ui-datepicker { width: 12em; height: 12em; } The width works fine, but the height only changes the back of the calender, and not the cells so I end up with something like this: Where the height of the datepicker background has changed, but the cells are the same. In the class .ui-datepicker table I tired to add a line of code height: 80% , but the height will not go

Increase font size of whole web page on button click event using jquery

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to increase font size in whole page when user click on increase button. It will be increase on bases of current font size. Following is sample code : <div class='parent' style='font-size:15px'> <div class='c1'>div 1</div> <div class='c2'>div 2</div> <div class='c3'>div 3</div> <div class='c4'>div 4</div> <table style="font-size:17px"> <tr> <th>test 1</th> <th style='font-size:11px'><div>test 1.1</div><div style='font-size:22px'>test 1.2</div></th> <th>test 2</th> </tr> </table> </div> Here is my jquery code but it will not work

Getting weird font size after setting it programmatically

匿名 (未验证) 提交于 2019-12-03 09:05:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to set TextView font size programmatically. txtView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16); But when I check this size via Toast.makeText(this, "txt: " + txtView.getTextSize(), Toast.LENGTH_SHORT).show(); The Toast shows that the size is "24" which is 50% larger then the one I set before. I tested multiple values and always get the same result: 8 becomes 12 10 becomes 15 15 becomes 22.5 etc. The font I am trying to set always becomes 50% larger. Why is this happening? Where am I making a mistake? 回答1: I believe this is

iReport external font

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to use external font in PDF document. I have no problem with using it in iReport after installing it via Settings -> Fonts -> Install new font. The problem that when I export the new font as extension and adding that jar to java project's classpath - the PDF couldn't be generated and fails with JRFontNotFoundException: Font 'Arial Custom' is not available to the JVM exception What I am doing wrong? Thank you UPD#1: jasperreports_extensions.properties net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports

How to get the visual length of a text string in python

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Similar to this question , I'm not asking how to find the number of characters in a string. I would like to determine the visual length of a string as rendered or compare it to another string. For example, both 'iiii' and 'WWWW' have four characters. However, 'iiii' is shorter visually. I'm aware that this is determined by font, and I'm not working with monospaced fonts. So, for the purposes of this problem, I'll be using Arial 10pt. Are there any built-in modules which will provide the visual dimensions of a string given a font? 回答1: If you

Custom Fonts and Custom Textview on Android

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: From an application I need to develop, I've received a specific font that has many files like FontName-Regular, FontName-Bold , FontName-it . I need to use it in all the textviews in the application. First I thought it was an easy task. Look over SO and found a very nice thread: here So first I did like: public static void overrideFonts(final Context context, final View v) { try { if (v instanceof ViewGroup) { ViewGroup vg = (ViewGroup) v; for (int i = 0; i And called this method during onCreate in my activity. Every textView in my app was

How to change font encoding when converting docx -&gt; pdf with docx4j?

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I'm a converting docx document to pdf my national characters transform into "#" marks. Is there any way to set a font encoding for pdf documents? I used xdocreport in the past and it can handle that, but I had problems with images, headers and footers. Docx4j manages to do this, but not fonts. After conversion, fonts have ANSI encoding while I'd like to have windows-1250. Is there an option to set this? 回答1: My problem was - missing proper True Type Fonts on linux server. The default fonts where inserted instead (without my code pages).

CSS Font Unicode Range

匿名 (未验证) 提交于 2019-12-03 08:59:04
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use the above code and intend to ONLY use this font for characters in the designated unicode-range, and excluding any other characters including the default English one. However, in my site, it stills display the other characters in this font. As you can see, the upper one still displays English in the font defined, and yet the second one uses sans-serif. How can I solve this problem? Much help is appreciated. 回答1: One of your character ranges contains an en dash (U+2013) instead of an ASCII hyphen-minus. 文章来源: CSS Font Unicode Range

cross-compiled THTTPD server with PHP runs fine, but no PHP

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We need some PHP on an ARM board. I've successfully cross-compiled both PHP 5 and THTTPD and they both seem to run fine on the ARM board, only the .php pages are shown unprocessed (if you do "View Source" in the web browser, you can see the PHP code). It has to be a silly configuration detail, I really feel that I am snatching defeat from the jaws of victory. Any help or smart ideas would be greatly appreciated! Here are my steps to build, deploy and test: My thttpd.conf file is: dir=/srv/www phppat=** phpspat=**.php logfile=/srv/www/logs