Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.1.1, 5.2.1, 5.3.0, 5.3.1
-
None
-
Windows 7 x64, Qt 4.8.6, Qt 5.1.1, Qt 5.2.1, Qt 5.3, qt-everywhere-opensource-src-5.3.1
-
8456adf0eeb9df8dd5f0547d4ad5a81888295f03 (qtbase/5.4, 20.8.2014, 5.4.0), Revert 5b1da97b6b4a011f9ce5582869a7a957f6f1369c (qtbase/5.4, 22.1.2015, 5.4.2) , Std font db c88e354993f8db3da741b1492f7578e9e0fdb07f (qtbase/5.4, 3.2.2015, 5.4.2)
Description
On Windows list of available font styles in QFontDatabase don't shows all available styles.
Code:
QFontDatabase fonts;
QString family = "Glametrix";
QStringList styles = fonts.styles(family);
qDebug() << family;
qDebug() << styles;
Qt 4.8.6 output:
"Glametrix" ("Normal", "Bold", "Italic", "Bold Italic", "Light", "Light Italic")
Later, this behavior looks like a broken.
It was intended or is it a bug?
Qt 5.3:
"Glametrix" ("Normal", "Bold", "Italic", "Bold Italic")
Source code in qwindowsfontdatabase.cpp enumerates only first font of many with same names.
EnumFontFamiliesEx at MSDN:
lfCharSet = DEFAULT_CHARSET
lfFaceName = '\0'Enumerates all uniquely-named fonts within all character sets. If there are two fonts with the same name, only one is enumerated.
This patch enumerates fonts with same name.
Patched Qt 5.3.1:
"Glametrix" ("Normal", "Bold", "Italic", "Bold Italic", "Light", "Light Italic")
Attachments
Issue Links
- replaces
-
QTBUG-37630 QFontDialog/QFontDatabase font style doesn't show real available font styles
- Closed
- resulted in
-
QTBUG-43774 REG[5.3->5.4]: Significant increase in application startup/stop/module loading time
- Closed