Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.3.4
-
None
-
f854d363afb6878f3e5260314545d93b9fad41a9
Description
Creating a font and setting its strategy to QFont::NoFontMerging seems to have no effect in some cases.
For example, Arial does not contain the character 0x0901, however, even with font merging disabled, this character is available seemingly because Mangal was still loaded.
This also seems to be related to when the style strategy is set. With the following example, if the style strategy is set before QFontInfo::family() is called, QFontMetrics::inFont() returns false. If the style strategy is set after QFontInfo::family() is called, QFontMetrics::inFont() returns true.
#include <QtGui> int main(int argc, char **argv) { QApplication a(argc, argv); QFont font("Arial", 30); QFontInfo fontInfo(font); qDebug() << "Actual font used:" << fontInfo.family(); font.setStyleStrategy(QFont::NoFontMerging); QChar testChar(0x0901); QString str; str += testChar; QFontMetrics fm(font); bool res = fm.inFont(testChar); qDebug() << "inFont result:" << res; QLabel label; label.setFont(font); label.setText(str); label.show(); return a.exec(); }
Attachments
Issue Links
- resulted in
-
QTBUG-9816 Add style strategy to QFont to turn off automatic font resolution completely
- Open