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

Unified Diff: src/pdf/SkPDFFont.cpp

Issue 113093004: [PDF] Fix font width generation when glyph 0 is used. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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/core/SkAdvancedTypefaceMetrics.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFFont.cpp
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index 1641a8916c32c9757741658b379cfa105499ae73..97d79111643d901d246f0d9c84167587282c26b6 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -1143,8 +1143,11 @@ bool SkPDFCIDFont::populate(const SkPDFGlyphSet* subset) {
if (fontInfo()->fType == SkAdvancedTypefaceMetrics::kTrueType_Font) {
// Generate glyph id array.
SkTDArray<uint32_t> glyphIDs;
- glyphIDs.push(0); // Always include glyph 0.
if (subset) {
+ // Always include glyph 0.
+ if (!subset->has(0)) {
+ glyphIDs.push(0);
+ }
subset->exportTo(&glyphIDs);
}
@@ -1152,7 +1155,7 @@ bool SkPDFCIDFont::populate(const SkPDFGlyphSet* subset) {
info = SkAdvancedTypefaceMetrics::kGlyphNames_PerGlyphInfo;
info = SkTBitOr<SkAdvancedTypefaceMetrics::PerGlyphInfo>(
info, SkAdvancedTypefaceMetrics::kHAdvance_PerGlyphInfo);
- uint32_t* glyphs = (glyphIDs.count() == 1) ? NULL : glyphIDs.begin();
+ uint32_t* glyphs = (glyphIDs.count() == 0) ? NULL : glyphIDs.begin();
uint32_t glyphsCount = glyphs ? glyphIDs.count() : 0;
SkAutoTUnref<SkAdvancedTypefaceMetrics> fontMetrics(
typeface()->getAdvancedTypefaceMetrics(info, glyphs, glyphsCount));
« no previous file with comments | « src/core/SkAdvancedTypefaceMetrics.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698