Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.0
-
None
-
At least a couple of Linux versions, see Description.
$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC)
I did most of my testing with Qt from the 4.7 branch.At least a couple of Linux versions, see Description. $ gcc -v Using built-in specs. Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl= http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC) I did most of my testing with Qt from the 4.7 branch.
-
18447df1d021cfed69472b867cb7593401be27a6
Description
During investigation of a KDE bug (https://bugs.kde.org/show_bug.cgi?id=250728), we've found an apparent locale sensitivity in QFontDatabase, at least on Linux (original reporter identified the problem on Ubuntu 10.04.1 LTS, I've reproduced it on Fedora 13).
The result of the styles() method appears to vary according to the LC_CTYPE environment variable, for one specific font (NSimSun). It works correctly, except for Chinese language locales (e.g. LC_CTYPE=zh_CN.UTF-8). In those cases, styles() returns an empty QStringList.
The attached patch (for the qfontdatabase auto tests) shows the problem. It passes for the C locale, and most other locales that I tried.
When run as
[bradh@fedora13 qfontdatabase]$ LC_CTYPE=zh_CN.UTF-8 ./tst_qfontdatabase
-
-
-
-
-
-
-
-
- Start testing of tst_QFontDatabase *********
Config: Using QTest library 4.7.1, Qt 4.7.1
PASS : tst_QFontDatabase::initTestCase()
PASS : tst_QFontDatabase::styles()
SKIP : tst_QFontDatabase::fixedPitch(Script) Font not installed
Loc: [tst_qfontdatabase.cpp(153)]
SKIP : tst_QFontDatabase::fixedPitch(Courier) Font not installed
Loc: [tst_qfontdatabase.cpp(153)]
SKIP : tst_QFontDatabase::fixedPitch(Lucida Console) Font not installed
Loc: [tst_qfontdatabase.cpp(153)]
PASS : tst_QFontDatabase::fixedPitch()
PASS : tst_QFontDatabase::widthTwoTimes()
PASS : tst_QFontDatabase::addAppFont()
FAIL! : tst_QFontDatabase::addAppFontLocale(NSimSun) 'newFamilies.contains(addedFamilies.at)' returned FALSE. ()
Loc: [tst_qfontdatabase.cpp(358)]
PASS : tst_QFontDatabase::cleanupTestCase()
Totals: 6 passed, 1 failed, 3 skipped - Finished testing of tst_QFontDatabase *********
- Start testing of tst_QFontDatabase *********
-
-
-
-
-
-
-