font

Refused to load the font 'data:font/woff…'it violates the following Content Security Policy directive: “default-src 'self'”. Note that 'font-src'

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My react webApp give this Error in Browser Console Refused to load the font 'data:font/woff;base64,d09........' because it` `violates the following Content Security Policy directive: "default-src` `'self'". Note that 'font-src' was not explicitly set, so 'default-src' is used as a fallback. Also: Refused to connect to 'ws://localhost:3000/sockjs-node/782/oawzy1fx/websocket' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a

Safari and IE can't read TTF and EOT fonts

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have trouble reading a font in Safari. I converted OTF to TTF - two bold and regular fonts. Both are fine in Chrome and Firefox. But in Safari, only the bold font is works, regular does not. IE does not read the EOT font which I have converted from a website. Is there any better way to convert OTF to EOT? Here is my code: <style type = "text/css" > //Bariol_Bold @font - face { font - family : Bariol_Bold ; src : url ( "fonts/bariol_bold.eot" ); /*For ie browser*/ } @font - face { font - family : Bariol_Bold ; src : url ( "fonts

Change just the font size in SWT

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to use a larger font for one of the labels. label.setFont( new Font(display,"Arial", 14, SWT.BOLD ) ); but obviously Arial is not always the default font. I want to change just the size and keep everything else at default values. Can I do something like label.setFontSize( 14 ); to avoid setting the other parameters? Or can I at least find out the name of the font that is actually being used as default? 回答1: I believe you could do something like FontData[] fD = label.getFont().getFontData(); fD[0].setHeight(16); label.setFont( new Font

Cannot load font in JRE 8

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I cannot load a font from an S3 Inputstream in JRE 8. I do not have issue if a system is installed with JRE 7, JDK 7, or even JDK 8. val fontInputStream = s3Client.getObject(bucketName, objectKey).getObjectContent val customFont = Font.createFont(Font.TRUETYPE_FONT, fontInputStream).deriveFont(Font.TRUETYPE_FONT, 20F) The error that I got is Exception in thread "main" java.io.IOException: Problem reading font data. at java.awt.Font.createFont0(Font.java:1000) at java.awt.Font.createFont(Font.java:877) at Main$.delayedEndpoint$Main$1(Main

Font-size &lt;12px doesn&#039;t have effect in Google Chrome

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Elements with css font-size <12px doesn't have effect in Google Chrome - remains font-size 12px. What should I do? My Google Chrome browser uses default settings. My version is 4.0.249.89. I am using Windows XP. You can paste the following code to your Google Chrome to test it: <html> <body> <p style="font-size:6px;">test 6px</p> <p style="font-size:7px;">test 7px</p> <p style="font-size:8px;">test 8px</p> <p style="font-size:9px;">test 9px</p> <p style="font-size:10px;">test 10px</p> <p style="font-size:11px;">test 11px</p> <p style="font

How to change font size of JButton according to its size?

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a java application - a calculator. I want to resize font of buttons dynamically with resizing the window of the app. How to implement it? My idea is using ComponentEvents. I have initial size of the window of application and initial fonts' sizes. I want to change font size according to button's size, affected by window size change. The problem is how to use the ratio [initial window size] / [initial font size] in the overriden method? The ratio is different for each font. import javax.swing.*; import java.awt.*; import java.awt.event

Why is this inline-block element pushed downward?

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Following is my code and I want to understand that why #firstDiv is being pushed downward by all browsers. I really want to understand the inner workings of the fact that why its being pushed downward rather than pulling it upward by one way or another. (and I know how to align their tops :)) And I know that its overflow:hidden which is causing it but not sure that why its pushing that div downward. FIRST SECOND THIRD some more content some more content body{ width: 350px; margin: 0px auto; } #container { border: 15px solid orange; }

Failed to decode downloaded font

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is an error I am getting in Chrome and unfortunately searching for it hasn't given me much results. The font itself is appearing correctly. However I still get this error/warning. More specifically, this is the full warning: "Failed to decode downloaded font: http://localhost:8000/app/fonts/Lato/ " My CSS are these: @font-face { font-family:"Lato"; src: url("../fonts/Lato/"); } html, body { font-family:'Lato'; } I just do not understand. The font is applied correctly, but the warning is always there. Trying to use Sans-Serif makes the

Adding custom Font to Theme in Android

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there any way to add custom fonts in Themes in Android? I have read Quick Tip: Customize Android Fonts , but here we have to programmetrically add custom font to text. TextView txt = (TextView) findViewById(R.id.custom_font); Typeface font = Typeface.createFromAsset(getAssets(), "Chantelli_Antiqua.ttf"); txt.setTypeface(font); But I want to set the custom font by style/theme. 回答1: Unfortunately, Android doesn't provide the quick, easy and clean way you're looking for to change the font for your entire app. But recently I've looked into

How do I load a file from resource folder?

匿名 (未验证) 提交于 2019-12-03 02:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My project has the following structure: /src/main/java/ /src/main/resources/ /src/test/java/ /src/test/resources/ I have a file in /src/test/resources/test.csv and I want to load the file from a unit test in /src/test/java/MyTest.java I have this code which didn't work. It complains "No such file or directory". BufferedReader br = new BufferedReader (new FileReader(test.csv)) I also tried this InputStream is = (InputStream) MyTest.class.getResourcesAsStream(test.csv)) This also doesn't work. It returns null . I am using Maven to build my