fonts

QFontDatabase doesn't contain all the fonts families or it has different names

。_饼干妹妹 提交于 2020-01-02 07:46:29
问题 I'm getting a QWidget's default font's family using font().family(). I compare this against the QStringList I get from QFontDatabase().families(). The default font's family is "Sans" but I cannot find that in the list I get from QFontDatabase, I can only find Sans Serif, Droid Sans, FreeSans etc. How come QWidget's default font is something that is not even present on the system's fonts? 回答1: This is a classic trip-up. Logically, QFont is a request for a font. It may be satisfied by something

Embedding YouTube video changes font look on elements outside the iframe

ぃ、小莉子 提交于 2020-01-02 07:15:14
问题 I'm adding a YouTube video to a web page, and it's oddly affecting the existing text on my page. I've narrowed it down to a small example which shows up the problem quite well, at least in Chrome and Safari on Mac: http://jsfiddle.net/gothick/wjNzf/5/ This is basically a paragraph of text with a video embedded using the current, standard YouTube iframe-based embed below it. Watch carefully as that page loads, and you'll see the apparent weight of the paragraph of text above the embedded video

QML not using Thin font weight

戏子无情 提交于 2020-01-02 07:04:42
问题 I have a QML app using the freely-available Encode Sans font, which comes in 9 weights that match Qt 5.6's font weights. I have added all .ttf to my project, and am using a FontLoader to load them. Everything works perfectly, except for the Thin weight of the font. In addition to the code below I have tried providing a unique id on the FontLoader for Thin, to ensure that the family name is the same (it is). How can I debug this problem and get Thin working? ### main.qml FontLoader { source:

downloadable fonts - can't download some google fonts

独自空忆成欢 提交于 2020-01-02 06:35:08
问题 I am playing with Downloadable fonts api. I downloaded the Google sample application and also incorporated the code into my project. Both run successfully but some fonts consistently fail to download both from my app and from the sample app. I use FontsContractCompat.requestFont and gets a callback to onTypefaceRequestFailed(int reason) with reason 1. The documentation says it means "FAIL_REASON_FONT_NOT_FOUND". I assume those fonts should exist because: 1) They appear in an xml file that

Changing font size in Java

旧街凉风 提交于 2020-01-02 05:37:15
问题 I got my own custom font working in Java, but I have one problem, the font size seems to be staying at 1. I tried font.deriveFont(20.0f); at my initialize method, but, it didn't resize. try { font = Font.createFont(Font.TRUETYPE_FONT, new File("D:/StanJump/mailrays.ttf")); font.deriveFont(20.0f); } catch (Exception ex) {} This is my code to create the font and try to change the size, but this didn't work. Any help on making it work, please? 回答1: deriveFont returns a reference to a new font

Get kerning offset value for given character pair and font in .NET

限于喜欢 提交于 2020-01-02 05:29:53
问题 How can I get kerning adjustment of space between 2 given char s in .NET? In WPF application? For example, lets say I have font Times New Roman of size 22 that is bold . What kerning will be used for characters A and v ? How can I get this value in my WPF application ? If you wander why do I need it: I want to make H.B.'s answer to my question Create guitar chords editor in WPF to work with kerning. 来源: https://stackoverflow.com/questions/5809498/get-kerning-offset-value-for-given-character

Is it true, visual studio can't handle fonts installed after it was?

依然范特西╮ 提交于 2020-01-02 04:05:32
问题 I was trying to solve my XNA Font problem, when I found this here: Visual Studio doesn’t recognize any fonts you add after it is up and running. Is there a way to use fonts installed after Visual Studio? After finding out that is was the Font file why would the tutorial mention something like that ? 回答1: I have successfully installed a PROGGY font. It was usable after I restarted VC6. I suspect they are talking about restarting your visual studio, instead of reinstalling your visual studio.

What happens if I use a font that isn't installed on the client machine?

╄→гoц情女王★ 提交于 2020-01-02 03:13:08
问题 Can someone tell me what happens if I use a font in my WinForms app that isn't available on the target machine? Does it use a font in the same family, just Sans Serif, or something else? 回答1: Your application will fallback to Segoe UI, Tahoma, then MS Sans Serif depending on the OS Version. 来源: https://stackoverflow.com/questions/5675709/what-happens-if-i-use-a-font-that-isnt-installed-on-the-client-machine

Custom Font in svg

风流意气都作罢 提交于 2020-01-02 00:54:08
问题 I would like to use custom fonts in a svg embedded in a web page. With setattribute I can use Arial... fonts. I think those fonts are embedded in the browser and I can use it. But how can I do to use custom fonts? In Firefox, when I use in css for exemple @font-face .... @font-face { font-family: "ITCGothicBold"; src: url('fonts/ITCGothicBold.ttf') format("truetype"); } that font-family works in a Html web page. On the other hand, for exemple, in the svg text: <text xml:space="preserve" text

Add icons to JButton using custom font from AwesomeFont and unicode characters in Java Swing?

与世无争的帅哥 提交于 2020-01-02 00:53:19
问题 I have a JButton and I want to add an icon to it. I would like to use the font based icons from FontAwesome which provides a TrueType font file. The icon I am trying to add is the play button icon. The play button icon in the css file for FontAwesome is \f04b which I beleive translates to \uf04b in Java. This is how I am loading the font in the constructor of by IconButton base class. public class IconButton extends JButton { public IconButton() { try { InputStream in = this.getClass()