aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2018-03-29 10:59:02 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-29 18:33:05 +0000
commite1fec19deaa648fdea74adc30378156ce72d8002 (patch)
tree58bf34d506a3939ab6ffd1b77cc80f30e6d04844 /src/pdf
parentcc7df552f641c3c093f266f8393daf5ec04f737e (diff)
SkAdvancedTypefaceMetrics: distinguish between font names
Change-Id: I7d094c7327fae7a6da42b118858c59ab524ee6ae Reviewed-on: https://skia-review.googlesource.com/117157 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'src/pdf')
-rw-r--r--src/pdf/SkPDFFont.cpp10
1 files changed, 5 insertions, 5 deletions
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<SkPDFDict>("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<SkPDFArray>();
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