aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkFontHost_win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ports/SkFontHost_win.cpp')
-rwxr-xr-xsrc/ports/SkFontHost_win.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index ec7e1b00aa..72c311be67 100755
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -1100,7 +1100,8 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
populate_glyph_to_unicode(hdc, glyphCount, &(info->fGlyphToUnicode));
}
- if (otm.otmTextMetrics.tmPitchAndFamily & TMPF_TRUETYPE) {
+ if (glyphCount > 0 &&
+ (otm.otmTextMetrics.tmPitchAndFamily & TMPF_TRUETYPE)) {
info->fType = SkAdvancedTypefaceMetrics::kTrueType_Font;
} else {
info->fType = SkAdvancedTypefaceMetrics::kOther_Font;