[Qt] Multiple font entries...

cpdrummond at freeuk.com cpdrummond at freeuk.com
Tue Jul 16 01:12:21 BST 2002


Hi,

I think I've found a bug in Qt's font database mechanism. The problem seems to 
occur if a font is installed for plain X and for Xft. The effect can be seen 
in KDE's font selector dialog, or drop down font lists - and appears as 
entries such as:

    Arial [Monotype]
    Arial [Xft]

When Qt lists all font families, if a family appears from more than one 
foundry, then the foundry is placed in square brackets after the family name. 
(It looks as if Qt assumes all Xft fonts are from the foundry Xft.)

This problem becomes very evident (at lest for me), because the font installer 
installs all TrueType and Type1 fonts for both standard X (so that non Xft 
apps can use them), and for Xft.

>From looking at the createDatabase() function within 
src/kernel/qfontdatabase_x11.cpp - it appears as if Qt queries Xft for a list 
of fonts, assigns these to the Xft foundry, and then queries standard X for a 
list of fonts.

I've modified the code so that it firsts queries X for a list of fonts, and 
then Xft. When querying Xft, only font families *not* listed from X are 
stored - this then removes the duplication.

I've attached a gzipped diff and source file (just in case I've messed up the 
diff...) - These are taken from KDE's qt-copy taken from Saturday lunch time 
ish...

Can you please try the attached version and let me know if it works. If it 
does, then I'll forward this onto TrollTech.

Thanks.

Craig.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qfontdatabase_x11.cpp.diff.gz
Type: application/x-gzip
Size: 1994 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20020716/b91fd20a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qfontdatabase_x11.cpp.gz
Type: application/x-gzip
Size: 3291 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20020716/b91fd20a/attachment-0001.bin>


More information about the kde-core-devel mailing list