@@ -190,9 +190,25 @@ static OUTLINETEXTMETRIC *getOutlineTextMetric(HDC hdc)
190
190
return otm;
191
191
}
192
192
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
+
193
207
void QFontEngineWin::getCMap ()
194
208
{
195
- ttf = (bool )(tm .tmPitchAndFamily & TMPF_TRUETYPE);
209
+ ttf = (bool )(tm .tmPitchAndFamily & TMPF_TRUETYPE) || hasCMapTable ();
210
+ cffTable = hasCFFTable ();
211
+
196
212
HDC hdc = shared_dc ();
197
213
SelectObject (hdc, hfont);
198
214
bool symb = false ;
@@ -373,6 +389,7 @@ HGDIOBJ QFontEngineWin::selectDesignFont() const
373
389
{
374
390
LOGFONT f = logfont;
375
391
f.lfHeight = unitsPerEm;
392
+ f.lfWidth = 0 ;
376
393
HFONT designFont = CreateFontIndirect (&f);
377
394
return SelectObject (shared_dc (), designFont);
378
395
}
@@ -1072,7 +1089,7 @@ void QFontEngineWin::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_m
1072
1089
1073
1090
bool QFontEngineWin::getSfntTableData (uint tag, uchar *buffer, uint *length) const
1074
1091
{
1075
- if (!ttf)
1092
+ if (!ttf && !cffTable )
1076
1093
return false ;
1077
1094
HDC hdc = shared_dc ();
1078
1095
SelectObject (hdc, hfont);
0 commit comments