aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2017-03-06 16:18:49 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-08 16:35:24 +0000
commitaa3af7b4692932c4fab4109b2d9f29ae40e49ad5 (patch)
treec08b4e6655ed5c29befb3ac336190a993e3ecdca /src/ports
parent8de05ffcb26c757a6169e217ef46105286811dd9 (diff)
SkPDF: Always get advances at unitsPerEm.
* Work around BUG=chromium:696356 * SkTestScalerContext needs a return a em-size. * SkPDFFont::MakeVectorCache which always produces a glyph cache at emsize. Replaces vector_cache(). * Stop looking at fLastGlyphID and fEmSize in TypefaceMetrics. Change-Id: I28d93b8f62d461a60fa046e9aaf7fa6d116a7ee5 Reviewed-on: https://skia-review.googlesource.com/9324 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'src/ports')
-rw-r--r--src/ports/SkFontHost_FreeType.cpp6
-rw-r--r--src/ports/SkFontHost_mac.cpp2
-rw-r--r--src/ports/SkFontHost_win.cpp2
-rw-r--r--src/ports/SkTypeface_win_dw.cpp2
4 files changed, 0 insertions, 12 deletions
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index 1c228eaf48..eee76d5730 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -560,8 +560,6 @@ SkAdvancedTypefaceMetrics* SkTypeface_FreeType::onGetAdvancedTypefaceMetrics(
if (!canSubset(face)) {
info->fFlags |= SkAdvancedTypefaceMetrics::kNotSubsettable_FontFlag;
}
- info->fLastGlyphID = face->num_glyphs - 1;
- info->fEmSize = 1000;
const char* fontType = FT_Get_X11_Font_Format(face);
if (strcmp(fontType, "Type 1") == 0) {
@@ -572,10 +570,6 @@ SkAdvancedTypefaceMetrics* SkTypeface_FreeType::onGetAdvancedTypefaceMetrics(
info->fType = SkAdvancedTypefaceMetrics::kCFF_Font;
} else if (strcmp(fontType, "TrueType") == 0) {
info->fType = SkAdvancedTypefaceMetrics::kTrueType_Font;
- TT_Header* ttHeader;
- if ((ttHeader = (TT_Header*)FT_Get_Sfnt_Table(face, ft_sfnt_head)) != nullptr) {
- info->fEmSize = ttHeader->Units_Per_EM;
- }
} else {
info->fType = SkAdvancedTypefaceMetrics::kOther_Font;
}
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 21017e114c..a9b8ccd91c 100644
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -1501,8 +1501,6 @@ SkAdvancedTypefaceMetrics* SkTypeface_Mac::onGetAdvancedTypefaceMetrics(
}
CFIndex glyphCount = CTFontGetGlyphCount(ctFont.get());
- info->fLastGlyphID = SkToU16(glyphCount - 1);
- info->fEmSize = CTFontGetUnitsPerEm(ctFont.get());
if (perGlyphInfo & kToUnicode_PerGlyphInfo) {
populate_glyph_to_unicode(ctFont.get(), glyphCount, &info->fGlyphToUnicode);
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index fbcd01a0ff..296b9d3b98 100644
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -1761,8 +1761,6 @@ SkAdvancedTypefaceMetrics* LogFontTypeface::onGetAdvancedTypefaceMetrics(
glyphCount = calculateGlyphCount(hdc, fLogFont);
info = new SkAdvancedTypefaceMetrics;
- info->fEmSize = otm.otmEMSquare;
- info->fLastGlyphID = SkToU16(glyphCount - 1);
tchar_to_skstring(lf.lfFaceName, &info->fFontName);
// If bit 1 is set, the font may not be embedded in a document.
// If bit 1 is clear, the font can be embedded.
diff --git a/src/ports/SkTypeface_win_dw.cpp b/src/ports/SkTypeface_win_dw.cpp
index e955665828..3acdd213ac 100644
--- a/src/ports/SkTypeface_win_dw.cpp
+++ b/src/ports/SkTypeface_win_dw.cpp
@@ -328,8 +328,6 @@ SkAdvancedTypefaceMetrics* DWriteFontTypeface::onGetAdvancedTypefaceMetrics(
fDWriteFontFace->GetMetrics(&dwfm);
info = new SkAdvancedTypefaceMetrics;
- info->fEmSize = dwfm.designUnitsPerEm;
- info->fLastGlyphID = SkToU16(glyphCount - 1);
info->fAscent = SkToS16(dwfm.ascent);
info->fDescent = SkToS16(dwfm.descent);