Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1236)

Unified Diff: src/ports/SkFontHost_FreeType.cpp

Issue 2222523003: SkPDF/SkAdvancedTypefaceMetrics: simplify ATM, PDF takes over (Closed) Base URL: https://skia.googlesource.com/skia.git@SkPDF_no_kHAdvance
Patch Set: rebase and nit Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pdf/SkPDFFontImpl.h ('k') | src/ports/SkFontHost_mac.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_FreeType.cpp
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index e093bf04e701ad8dd028c0078c03b308157e8b56..5c3034162d29b29c5f0fc8e43bf28290bf8940bd 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -577,38 +577,17 @@ SkAdvancedTypefaceMetrics* SkTypeface_FreeType::onGetAdvancedTypefaceMetrics(
perGlyphInfo = kNo_PerGlyphInfo;
}
- if (perGlyphInfo & kHAdvance_PerGlyphInfo) {
- info->setGlyphWidths(
- face->num_glyphs,
- glyphIDs,
- glyphIDsCount,
- SkAdvancedTypefaceMetrics::GetAdvance([face](int gId, int16_t* data) {
- FT_Fixed advance = 0;
- if (FT_Get_Advances(face, gId, 1, FT_LOAD_NO_SCALE, &advance)) {
- return false;
- }
- SkASSERT(data);
- *data = advance;
- return true;
- })
- );
- }
-
- if (perGlyphInfo & kVAdvance_PerGlyphInfo && FT_HAS_VERTICAL(face)) {
- SkASSERT(false); // Not implemented yet.
- }
-
if (perGlyphInfo & kGlyphNames_PerGlyphInfo &&
info->fType == SkAdvancedTypefaceMetrics::kType1_Font)
{
// Postscript fonts may contain more than 255 glyphs, so we end up
// using multiple font descriptions with a glyph ordering. Record
// the name of each glyph.
- info->fGlyphNames.reset(new SkAutoTArray<SkString>(face->num_glyphs));
+ info->fGlyphNames.reset(face->num_glyphs);
for (int gID = 0; gID < face->num_glyphs; gID++) {
char glyphName[128]; // PS limit for names is 127 bytes.
FT_Get_Glyph_Name(face, gID, glyphName, 128);
- info->fGlyphNames->get()[gID].set(glyphName);
+ info->fGlyphNames[gID].set(glyphName);
}
}
« no previous file with comments | « src/pdf/SkPDFFontImpl.h ('k') | src/ports/SkFontHost_mac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698