diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qfontengine_win.cpp | 13 | ||||
-rw-r--r-- | src/gui/text/qfontengine_win_p.h | 1 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp index befe37f143..9852b89072 100644 --- a/src/gui/text/qfontengine_win.cpp +++ b/src/gui/text/qfontengine_win.cpp @@ -197,12 +197,18 @@ bool QFontEngineWin::hasCFFTable() const return GetFontData(hdc, MAKE_TAG('C', 'F', 'F', ' '), 0, 0, 0) != GDI_ERROR; } +bool QFontEngineWin::hasCMapTable() const +{ + HDC hdc = shared_dc(); + SelectObject(hdc, hfont); + return GetFontData(hdc, MAKE_TAG('c', 'm', 'a', 'p'), 0, 0, 0) != GDI_ERROR; +} + void QFontEngineWin::getCMap() { - ttf = (bool)(tm.tmPitchAndFamily & TMPF_TRUETYPE); + ttf = (bool)(tm.tmPitchAndFamily & TMPF_TRUETYPE) || hasCMapTable(); - // TMPF_TRUETYPE is not set for fonts with CFF tables - cffTable = !ttf && hasCFFTable(); + cffTable = hasCFFTable(); HDC hdc = shared_dc(); SelectObject(hdc, hfont); @@ -384,6 +390,7 @@ HGDIOBJ QFontEngineWin::selectDesignFont() const { LOGFONT f = logfont; f.lfHeight = unitsPerEm; + f.lfWidth = 0; HFONT designFont = CreateFontIndirect(&f); return SelectObject(shared_dc(), designFont); } diff --git a/src/gui/text/qfontengine_win_p.h b/src/gui/text/qfontengine_win_p.h index a56cd2c78c..ba6aa020db 100644 --- a/src/gui/text/qfontengine_win_p.h +++ b/src/gui/text/qfontengine_win_p.h @@ -147,6 +147,7 @@ public: private: bool hasCFFTable() const; + bool hasCMapTable() const; QNativeImage *drawGDIGlyph(HFONT font, glyph_t, int margin, const QTransform &xform, QImage::Format mask_format); |