font

Android “font asset not found” error

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am developing for Android version 22. I am getting the runtime exception "Font asset not found" Here is the code: Typeface customFont = Typeface.createFromAsset(getAssets(), "fonts/norwester.otf"); And here is my file structure: I am guessing that my file structure is wrong because the "assets" folder does not show up in "Android" mode and only shows up in "Project Mode". What is the problem? 回答1: Assets folder should be under root directory of main folder which inner folder of src. For Reference Please find attached images of folder

How to set the font of NSMenu/NSMenuItems?

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I can’t figure out how to set the font/styling of my NSMenuItems in my NSMenu. I tried the setFont method on the NSMenu but it doesn’t seem to have any effect on the menu items. NSMenuItem doesn’t seem to have a setFont method. I would like for them all to have the same font/style so I would hope there’s just one property I can set somewhere. 回答1: They can have an attributed title, so you can set an attributed string as title with all it's attributed, font included: NSMutableAttributedString* str =[[NSMutableAttributedString alloc

Using font awesome with formtastic submit button

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a submit button on my form: = semantic_form_for record do | form | = form . actions do = form . submit 'Save' I want to add an icon from FontAwesome, with link_to I can use a block: = link_to record do = fa_icon 'save' Save But this doesn't work with Formtastic's form.submit . I also tried: = form . submit fa_icon ( 'save' ) = form . submit fa_icon ( 'save' ). html_safe But both renders escaped HTML. How do I add a font-awesome icon to the <button> tag? 回答1: Try using capture to set a label, as in: - label = capture do = fa

iOS UILabel autoshrink so word doesn&#039;t truncate to two lines

匿名 (未验证) 提交于 2019-12-03 08:51:18
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to have the UILabel shrink so that words don't truncate to the next line. Not just text truncating at the end of the text area. If I have a box that is 50x100, and I want to put in something like "American" in the box at 25.0pt, I end up getting: 50px ------- |Ameri- | |can | |Beauty | 100px | | ------- The text shrinking doesn't seem to do anything during this situation, since it still fits in the UILabel frame. It works pretty well when the text is really long like "Willie Wonka's Chocolate Factory", but I don't want word

How can I change console font?

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a problem with output Unicode in Windows XP console. (Microsoft Windows XP [Version 5.1.2600]) First code is that(from http://www.siao2.com/2008/03/18/8306597.aspx ) I changed HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe\FontName, but when I check Prompt's properties -> Font, it set as 'Lucida Console'. Is there any way to change console font with API? The next code is what I tried. But it doesn't work. Help. PS : BTW, when I put "include < fcntl.h >" in "code tag", the part with in <> (fcntl.h) disappeared. How can I put

Google Web Fonts and PDF generation from HTML with wkhtmltopdf

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using wkhtmltopdf to convert HTML files in PDF format; it gives surprisingly good results, rendering the PDF exactly as WebKit would do. I am using Google Web Fonts to give users the possibility to customize the appearence of the document they edited, offering them the possibility to choose between a few fonts. It also works perfectly in a browser . Problem is, I don't get the Google Fonts working when converting such HTML files to PDF with wkhtmltopdf. I read other people had the same issue . Could anyone please help me fixing this?

How to increase the font size of the legend in my Seaborn plot?

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have the following codes to create a Seaborn strip plot. I am having a hard time figuring out how to increase the font size of the legend appearing in the plot. g=sns.stripplot(x="Market", y="Rate", hue="Group",data=myBenchmarkData, jitter=True, size=12, alpha=0.5) g.axes.set_title("4* Rate Market and by Hotel Groups for Year 2016",fontsize=25) g.set_xlabel("Market",fontsize=20) g.set_ylabel("Rate (in EUR)",fontsize=20) g.tick_params(labelsize=15) plt.savefig ('benchmark1.png') I am OK with my x-axis and y-axis labels font size but the

Generate SVG Image using svg raw data in imagick php

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to create svg image using svg raw data which i am getting from fabric js. I have used below code to generate the svg using svg raw data but its not working properly. public function generate_svg($raw_svg='',$prefix='',$folder_name='card_image') { $file_name = ''; if($raw_svg!='') { try{ $file_name = uniqid($prefix).".svg"; $image = new \Imagick(); $image->readImageBlob($raw_svg); $image->setImageFormat("svg"); $image->writeImage($folder_name.$file_name); } catch (ImagickException $ex) { echo $ex->getMessage(); } } return $file

LibGDX FreeType font blurry

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm generating my font dynamically using the screen height percentage and set percentages (Obviously multiplied by density's in the future. Some notes. I'm reading from an OTF file. Using the latest version of LibGDX (Version 1.2.0) I have the following problem: (Large breaks in the font and looks very blurry, but only on medium . Large and small look very sharp) My Preset font sizes: //Font sizes, small, med, large as a percentage of the screen. public static float FONT_SIZE_LARGE = 0.175f, FONT_SIZE_MEDIUM = 0.06f, FONT_SIZE_SMALL = 0.04f;

How to change JLabel font size to fill JPanel free space while resizing?

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: There is a similar question here: How to change the size of the font of a JLabel to take the maximum size but it doesn't work in backwards. So if you make JPanel bigger, font is growing, but if you make it smaller JLabel size and font remain as before Check this Image How to make Jlabel font growing according to JPanel size while resizing? 回答1: by using FontMetrics and TextLayout you can get this output (please read an comment in the code) SwingUtilities can do that correctly too I sugget to add a few pixels moreover on both