Index: src/ports/SkFontHost_FreeType.cpp |
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp |
index 7ac2083930a0cd020b00da7f90d802e47ab9b9ce..85f8ab94693ba3a7f0eadef6faf0184b9a3ab3b7 100644 |
--- a/src/ports/SkFontHost_FreeType.cpp |
+++ b/src/ports/SkFontHost_FreeType.cpp |
@@ -1301,7 +1301,9 @@ void SkScalerContext_FreeType::generateMetrics(SkGlyph* glyph) { |
} |
} |
- if (fFace->glyph->format == FT_GLYPH_FORMAT_BITMAP && fScaleY && fFace->size->metrics.y_ppem) { |
+ // If the font isn't scalable, scale the metrics from the non-scalable strike. |
+ // This means do not try to scale embedded bitmaps; only scale bitmaps in bitmap only fonts. |
+ if (!FT_IS_SCALABLE(fFace) && fScaleY && fFace->size->metrics.y_ppem) { |
// NOTE: both dimensions are scaled by y_ppem. this is WAI. |
scaleGlyphMetrics(*glyph, SkScalarDiv(SkFixedToScalar(fScaleY), |
SkIntToScalar(fFace->size->metrics.y_ppem))); |