aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2016-08-16 11:54:57 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-16 11:54:58 -0700
commit6c80a9d4b06e10a2865731c487a537d34963268a (patch)
tree694ea8778d8896e2cb6b92692b035fbf89279104 /src/pdf
parent28c6d83c98473a24b8d0b0d279c43fd37ff24055 (diff)
SkPDF: Font names need escaping
Diffstat (limited to 'src/pdf')
-rw-r--r--src/pdf/SkPDFFont.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index 6d8f09c247..5cc80b04ec 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -756,7 +756,7 @@ bool SkPDFType0Font::populate(const SkPDFGlyphSet* subset) {
SkAdvancedTypefaceMetrics::FontType type = this->getType();
SkTypeface* face = this->typeface();
SkASSERT(face);
- const char* name = metrics.fFontName.c_str();
+ const SkString& name = metrics.fFontName;
auto descriptor = sk_make_sp<SkPDFDict>("FontDescriptor");
add_common_font_descriptor_entries(descriptor.get(), metrics, 0);
@@ -785,7 +785,7 @@ bool SkPDFType0Font::populate(const SkPDFGlyphSet* subset) {
subset->exportTo(&glyphIDs);
}
sk_sp<SkPDFObject> subsetStream = get_subset_font_stream(
- std::move(fontAsset), glyphIDs, name);
+ std::move(fontAsset), glyphIDs, name.c_str());
if (subsetStream) {
descriptor->insertObjRef("FontFile2", std::move(subsetStream));
break;