From e1fec19deaa648fdea74adc30378156ce72d8002 Mon Sep 17 00:00:00 2001 From: Hal Canary Date: Thu, 29 Mar 2018 10:59:02 -0700 Subject: SkAdvancedTypefaceMetrics: distinguish between font names Change-Id: I7d094c7327fae7a6da42b118858c59ab524ee6ae Reviewed-on: https://skia-review.googlesource.com/117157 Reviewed-by: Ben Wagner Commit-Queue: Hal Canary --- src/pdf/SkPDFFont.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/pdf') diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp index 4fe24b06b7..ff3b84cf75 100644 --- a/src/pdf/SkPDFFont.cpp +++ b/src/pdf/SkPDFFont.cpp @@ -269,7 +269,7 @@ static void add_common_font_descriptor_entries(SkPDFDict* descriptor, const SkAdvancedTypefaceMetrics& metrics, uint16_t emSize, int16_t defaultWidth) { - descriptor->insertName("FontName", metrics.fFontName); + descriptor->insertName("FontName", metrics.fPostScriptName); descriptor->insertInt("Flags", (size_t)(metrics.fStyle | kPdfSymbolic)); descriptor->insertScalar("Ascent", scaleFromFontUnits(metrics.fAscent, emSize)); @@ -435,7 +435,7 @@ void SkPDFType0Font::getFontSubset(SkPDFCanon* canon) { auto newCIDFont = sk_make_sp("Font"); newCIDFont->insertObjRef("FontDescriptor", std::move(descriptor)); - newCIDFont->insertName("BaseFont", metrics.fFontName); + newCIDFont->insertName("BaseFont", metrics.fPostScriptName); switch (type) { case SkAdvancedTypefaceMetrics::kType1CID_Font: @@ -470,7 +470,7 @@ void SkPDFType0Font::getFontSubset(SkPDFCanon* canon) { //////////////////////////////////////////////////////////////////////////// this->insertName("Subtype", "Type0"); - this->insertName("BaseFont", metrics.fFontName); + this->insertName("BaseFont", metrics.fPostScriptName); this->insertName("Encoding", "Identity-H"); auto descendantFonts = sk_make_sp(); descendantFonts->appendObjRef(std::move(newCIDFont)); @@ -524,7 +524,7 @@ static void populate_type_1_font(SkPDFDict* font, SkGlyphID firstGlyphID, SkGlyphID lastGlyphID) { font->insertName("Subtype", "Type1"); - font->insertName("BaseFont", info.fFontName); + font->insertName("BaseFont", info.fPostScriptName); // glyphCount not including glyph 0 unsigned glyphCount = 1 + lastGlyphID - firstGlyphID; @@ -721,7 +721,7 @@ static void add_type3_font_info(SkPDFCanon* canon, int32_t fontDescriptorFlags = kPdfSymbolic; if (metrics) { // Type3 FontDescriptor does not require all the same fields. - descriptor->insertName("FontName", metrics->fFontName); + descriptor->insertName("FontName", metrics->fPostScriptName); descriptor->insertInt("ItalicAngle", metrics->fItalicAngle); fontDescriptorFlags |= (int32_t)metrics->fStyle; // Adobe requests CapHeight, XHeight, and StemV be added -- cgit v1.2.3