Index: src/ports/SkTypeface_win_dw.cpp |
diff --git a/src/ports/SkTypeface_win_dw.cpp b/src/ports/SkTypeface_win_dw.cpp |
index 4937d3f1430a676a574596cff79adef6ab432f1f..9eace8b4a07e29581fb978b8d8a90c7e48266189 100644 |
--- a/src/ports/SkTypeface_win_dw.cpp |
+++ b/src/ports/SkTypeface_win_dw.cpp |
@@ -365,23 +365,18 @@ SkAdvancedTypefaceMetrics* DWriteFontTypeface::onGetAdvancedTypefaceMetrics( |
info->fLastGlyphID = SkToU16(glyphCount - 1); |
info->fStyle = 0; |
- |
+ // SkAdvancedTypefaceMetrics::fFontName is in theory supposed to be |
+ // the PostScript name of the font. However, due to the way it is currently |
+ // used, it must actually be a family name. |
SkTScopedComPtr<IDWriteLocalizedStrings> familyNames; |
- SkTScopedComPtr<IDWriteLocalizedStrings> faceNames; |
hr = fDWriteFontFamily->GetFamilyNames(&familyNames); |
- hr = fDWriteFont->GetFaceNames(&faceNames); |
UINT32 familyNameLength; |
hr = familyNames->GetStringLength(0, &familyNameLength); |
- UINT32 faceNameLength; |
- hr = faceNames->GetStringLength(0, &faceNameLength); |
- |
- UINT32 size = familyNameLength+1+faceNameLength+1; |
+ UINT32 size = familyNameLength+1; |
SkSMallocWCHAR wFamilyName(size); |
hr = familyNames->GetString(0, wFamilyName.get(), size); |
- wFamilyName[familyNameLength] = L' '; |
- hr = faceNames->GetString(0, &wFamilyName[familyNameLength+1], size - faceNameLength + 1); |
hr = sk_wchar_to_skstring(wFamilyName.get(), &info->fFontName); |