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

Unified Diff: src/fonts/SkTestScalerContext.cpp

Issue 2292303004: SkPDF: Fix Type3 ToUnicode table. (Closed)
Patch Set: 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 | « no previous file | src/pdf/SkPDFFont.cpp » ('j') | src/pdf/SkPDFFont.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/fonts/SkTestScalerContext.cpp
diff --git a/src/fonts/SkTestScalerContext.cpp b/src/fonts/SkTestScalerContext.cpp
index fcb65a83c129761940de99b448bc39a818f9046d..09b20ba71b01b7b96e9518d283eb7080e01a71c4 100644
--- a/src/fonts/SkTestScalerContext.cpp
+++ b/src/fonts/SkTestScalerContext.cpp
@@ -150,7 +150,15 @@ SkAdvancedTypefaceMetrics* SkTestTypeface::onGetAdvancedTypefaceMetrics(
// pdf only
SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics;
info->fFontName.set(fTestFont->fName);
- info->fLastGlyphID = SkToU16(onCountGlyphs() - 1);
+ int glyphCount = this->onCountGlyphs();
+ info->fLastGlyphID = SkToU16(glyphCount - 1);
+
+ SkTDArray<SkUnichar>& toUnicode = info->fGlyphToUnicode;
+ toUnicode.setCount(glyphCount);
+ SkASSERT(glyphCount == SkToInt(fTestFont->fCharCodesCount));
+ for (int gid = 0; gid < glyphCount; ++gid) {
+ toUnicode[gid] = SkToS32(fTestFont->fCharCodes[gid]);
+ }
return info;
}
« no previous file with comments | « no previous file | src/pdf/SkPDFFont.cpp » ('j') | src/pdf/SkPDFFont.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698