| 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));
|
|
|