[Development] Question about QFontconfigDatabase

Rafael Roquetto rafael.roquetto at kdab.com
Wed Dec 12 18:45:02 CET 2012


While analyzing the source code in qfontconfigdatabase.cpp (qt4), I stumbled
upon the following piece of code (beginning on line 433):

    struct FcDefaultFont {
        const char *qtname;
        const char *rawname;
        bool fixed;
    const FcDefaultFont defaults[] = { 
        { "Serif", "serif", false },
        { "Sans Serif", "sans-serif", false },
        { "Monospace", "monospace", true },
        { 0, 0, false }
    const FcDefaultFont *f = defaults;
    // aliases only make sense for 'common', not for any of the specials
    QSupportedWritingSystems ws; 

    while (f->qtname) {

When registerFont is called, f->qtname is passed as the family name (so
"Serif", for instance), but an empty string is passed as the foundry. My
question then follows: how does Qt know where to load these families from,
since no font path is being specifying?

Rafael Roquetto | rafael.roquetto at kdab.com | Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3721 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20121212/8a17922c/attachment.bin>

More information about the Development mailing list