[Development] Qt preference font

Eike Hein hein at kde.org
Wed May 13 20:22:58 CEST 2015

On 05/13/2015 07:57 PM, Alex Vazquez wrote:
> Is there any way to make a list of preferences font in Qt.

Yes, QFont:insertSubstitution & co allow you to assemble a QFont
with a particular substitution chain for glyphs. This is basically
what e.g. a browser engine built on Qt maps a CSS font families
listing to.

On the fontconfig level, it can be done similarly via alias+prefer
blocks in fonts.conf. Unfortunately, current Linux desktops don't
expose this capability in UI (because it's quite tough to build a
user-digestible and goals-focused interface around it without
leaking the corner cases); that's an area of active research in
KDE Plasma. Distros however make heavy use of this in their system
level default config to mix in the highest-quality non-Latin fonts
into whatever they map the generic family names like serif and
sans-serif to.

> Thanks!
> Regards!

Eike Hein, KDE.org

More information about the Development mailing list