[Interest] Font issues.

Joshua Kolden joshua at crackcreative.com
Sun Dec 29 00:25:26 CET 2013


I'm having difficulty with QtQuick font support. I can't quite be sure where the issue is, but it appears that Qt does not support ttf fonts with styles / SubFamilies, or it may be an issue with font weights.

In particular if you go to any old font on Google fonts and download it.  Say "Raleway" you'll get many 'subfamilies' of the font "ExtraBold" "ExtraLight" "Thin" etc.  However, QML will only render Bold and Normal.  Even if I only give it access to a single file like "Raleway-Thin.ttf”

This post suggests that this might be by design if it's a font family naming issue: http://stackoverflow.com/questions/17521578/qml-font-style-naming-issue-mac-linux-platform-differences

However these font files draw properly in every other application I’ve tried.

Ttf fonts from google fonts and other sources, and in general css font specifications define font weights in the hundreds with 400 being 'normal' however QML uses internal constants Font.Light, Font.Bold etc, that are in a range of 0-99 and doesn't seem to allow any numbers other than the small set of defined constants.  So it may not be name, but  that I can't define the weight properly "Railway Thin" is defined at weight 100.

Ttf fonts from google fonts and other sources, and in general css font specifications define font weights in the hundreds with 400 being 'normal' however QML uses internal constants Font.Light, Font.Bold etc, that are in a range of 0-99 and doesn't seem to allow any numbers other than the small set of defined constants.  So it may not be name, but that I can't define the weight properly "Railway Thin" is defined at weight 100.

I've done extensive tests with the Text object, and font properties, including using a file dialogue, and setting the font from the system fonts procedurally. QtQuick consistently renders the font at the incorrect weight.

Any insights would be appreciated.  If it is an intentional design choice then I’ll bring it up in the developer list, but I wanted to make sure it isn’t user error first.

Thanks,
j
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131228/bbc1abd4/attachment.html>


More information about the Interest mailing list