@@ -190,9 +190,25 @@ static OUTLINETEXTMETRIC *getOutlineTextMetric(HDC hdc)
190190 return otm;
191191}
192192
193+ bool QFontEngineWin::hasCFFTable () const
194+ {
195+ HDC hdc = shared_dc ();
196+ SelectObject (hdc, hfont);
197+ return GetFontData (hdc, MAKE_TAG (' C' , ' F' , ' F' , ' ' ), 0 , 0 , 0 ) != GDI_ERROR;
198+ }
199+
200+ bool QFontEngineWin::hasCMapTable () const
201+ {
202+ HDC hdc = shared_dc ();
203+ SelectObject (hdc, hfont);
204+ return GetFontData (hdc, MAKE_TAG (' c' , ' m' , ' a' , ' p' ), 0 , 0 , 0 ) != GDI_ERROR;
205+ }
206+
193207void QFontEngineWin::getCMap ()
194208{
195- ttf = (bool )(tm.tmPitchAndFamily & TMPF_TRUETYPE);
209+ ttf = (bool )(tm.tmPitchAndFamily & TMPF_TRUETYPE) || hasCMapTable ();
210+ cffTable = hasCFFTable ();
211+
196212 HDC hdc = shared_dc ();
197213 SelectObject (hdc, hfont);
198214 bool symb = false ;
@@ -373,6 +389,7 @@ HGDIOBJ QFontEngineWin::selectDesignFont() const
373389{
374390 LOGFONT f = logfont;
375391 f.lfHeight = unitsPerEm;
392+ f.lfWidth = 0 ;
376393 HFONT designFont = CreateFontIndirect (&f);
377394 return SelectObject (shared_dc (), designFont);
378395}
@@ -1072,7 +1089,7 @@ void QFontEngineWin::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_m
10721089
10731090bool QFontEngineWin::getSfntTableData (uint tag, uchar *buffer, uint *length) const
10741091{
1075- if (!ttf)
1092+ if (!ttf && !cffTable )
10761093 return false ;
10771094 HDC hdc = shared_dc ();
10781095 SelectObject (hdc, hfont);
0 commit comments