Windows: Work-around misreporting of Script and Roman
Two legacy bitmap fonts are misreported as TMPF_VECTOR on Windows: Roman and Script. This causes them to be marked as scalable, and the automatic fallback to NativeRendering in Qt Quick does not kick in - causing the text elements to look empty instead. To work around this, we exploit the peculiarity that the type of these two fonts is reported as "0" in the enumeration, which is not a valid value. No other fonts on the system is reported as type 0, so we simply detect this error case and mark the fonts as non-scalable, which is the safer choice. [ChangeLog][Windows] Fixed text in "Roman" and "Script" bitmap fonts not showing in Qt Quick applications. Pick-to: 6.1 5.15 Fixes: QTBUG-85826 Change-Id: Id889f0dedb1d529e6dd64c6da9e17e303f4a9d04 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>bb10
parent
8886462872
commit
a1e405ce11
|
|
@ -522,7 +522,9 @@ static bool addFontToDatabase(QString familyName,
|
|||
const QString foundryName; // No such concept.
|
||||
const bool fixed = !(textmetric->tmPitchAndFamily & TMPF_FIXED_PITCH);
|
||||
const bool ttf = (textmetric->tmPitchAndFamily & TMPF_TRUETYPE);
|
||||
const bool scalable = textmetric->tmPitchAndFamily & (TMPF_VECTOR|TMPF_TRUETYPE);
|
||||
const bool unreliableTextMetrics = type == 0;
|
||||
const bool scalable = (textmetric->tmPitchAndFamily & (TMPF_VECTOR|TMPF_TRUETYPE))
|
||||
&& !unreliableTextMetrics;
|
||||
const int size = scalable ? SMOOTH_SCALABLE : textmetric->tmHeight;
|
||||
const QFont::Style style = textmetric->tmItalic ? QFont::StyleItalic : QFont::StyleNormal;
|
||||
const bool antialias = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue