| Index: src/pdf/SkPDFFont.cpp
|
| diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
|
| index f386b7152393e8773629ae865c95eb07f1ba6257..d36a1d75c904f349e3e6e73c0a9a8270c7657fe5 100644
|
| --- a/src/pdf/SkPDFFont.cpp
|
| +++ b/src/pdf/SkPDFFont.cpp
|
| @@ -747,7 +747,7 @@ SkPDFGlyphSet* SkPDFGlyphSetMap::getGlyphSetForFont(SkPDFFont* font) {
|
| * from each page and combine it and ask for a resource with that subset.
|
| */
|
|
|
| -SkPDFFont::~SkPDFFont() { fCanon->removeFont(this); }
|
| +SkPDFFont::~SkPDFFont() {}
|
|
|
| SkTypeface* SkPDFFont::typeface() {
|
| return fTypeface.get();
|
| @@ -862,12 +862,10 @@ SkPDFFont* SkPDFFont::getFontSubset(const SkPDFGlyphSet*) {
|
| return NULL; // Default: no support.
|
| }
|
|
|
| -SkPDFFont::SkPDFFont(SkPDFCanon* canon,
|
| - const SkAdvancedTypefaceMetrics* info,
|
| +SkPDFFont::SkPDFFont(const SkAdvancedTypefaceMetrics* info,
|
| SkTypeface* typeface,
|
| SkPDFDict* relatedFontDescriptor)
|
| : SkPDFDict("Font")
|
| - , fCanon(canon)
|
| , fTypeface(ref_or_default(typeface))
|
| , fFirstGlyphID(1)
|
| , fLastGlyphID(info ? info->fLastGlyphID : 0)
|
| @@ -893,22 +891,22 @@ SkPDFFont* SkPDFFont::Create(SkPDFCanon* canon,
|
| if (info &&
|
| (info->fFlags & SkAdvancedTypefaceMetrics::kMultiMaster_FontFlag)) {
|
| NOT_IMPLEMENTED(true, true);
|
| - return new SkPDFType3Font(canon, info, typeface, glyphID);
|
| + return new SkPDFType3Font(info, typeface, glyphID);
|
| }
|
| if (type == SkAdvancedTypefaceMetrics::kType1CID_Font ||
|
| type == SkAdvancedTypefaceMetrics::kTrueType_Font) {
|
| SkASSERT(relatedFontDescriptor == NULL);
|
| - return new SkPDFType0Font(canon, info, typeface);
|
| + return new SkPDFType0Font(info, typeface);
|
| }
|
| if (type == SkAdvancedTypefaceMetrics::kType1_Font) {
|
| - return new SkPDFType1Font(canon, info, typeface, glyphID,
|
| + return new SkPDFType1Font(info, typeface, glyphID,
|
| relatedFontDescriptor);
|
| }
|
|
|
| SkASSERT(type == SkAdvancedTypefaceMetrics::kCFF_Font ||
|
| type == SkAdvancedTypefaceMetrics::kOther_Font);
|
|
|
| - return new SkPDFType3Font(canon, info, typeface, glyphID);
|
| + return new SkPDFType3Font(info, typeface, glyphID);
|
| }
|
|
|
| const SkAdvancedTypefaceMetrics* SkPDFFont::fontInfo() {
|
| @@ -996,10 +994,9 @@ void SkPDFFont::populateToUnicodeTable(const SkPDFGlyphSet* subset) {
|
| // class SkPDFType0Font
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|
| -SkPDFType0Font::SkPDFType0Font(SkPDFCanon* canon,
|
| - const SkAdvancedTypefaceMetrics* info,
|
| +SkPDFType0Font::SkPDFType0Font(const SkAdvancedTypefaceMetrics* info,
|
| SkTypeface* typeface)
|
| - : SkPDFFont(canon, info, typeface, NULL) {
|
| + : SkPDFFont(info, typeface, NULL) {
|
| SkDEBUGCODE(fPopulated = false);
|
| if (!canSubset()) {
|
| populate(NULL);
|
| @@ -1013,7 +1010,7 @@ SkPDFFont* SkPDFType0Font::getFontSubset(const SkPDFGlyphSet* subset) {
|
| return NULL;
|
| }
|
| SkPDFType0Font* newSubset =
|
| - new SkPDFType0Font(fCanon, fontInfo(), typeface());
|
| + new SkPDFType0Font(fontInfo(), typeface());
|
| newSubset->populate(subset);
|
| return newSubset;
|
| }
|
| @@ -1031,7 +1028,7 @@ bool SkPDFType0Font::populate(const SkPDFGlyphSet* subset) {
|
| insertName("Encoding", "Identity-H");
|
|
|
| SkAutoTUnref<SkPDFCIDFont> newCIDFont(
|
| - new SkPDFCIDFont(fCanon, fontInfo(), typeface(), subset));
|
| + new SkPDFCIDFont(fontInfo(), typeface(), subset));
|
| SkAutoTUnref<SkPDFArray> descendantFonts(new SkPDFArray());
|
| descendantFonts->append(new SkPDFObjRef(newCIDFont.get()))->unref();
|
| insert("DescendantFonts", descendantFonts.get());
|
| @@ -1046,11 +1043,10 @@ bool SkPDFType0Font::populate(const SkPDFGlyphSet* subset) {
|
| // class SkPDFCIDFont
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|
| -SkPDFCIDFont::SkPDFCIDFont(SkPDFCanon* canon,
|
| - const SkAdvancedTypefaceMetrics* info,
|
| +SkPDFCIDFont::SkPDFCIDFont(const SkAdvancedTypefaceMetrics* info,
|
| SkTypeface* typeface,
|
| const SkPDFGlyphSet* subset)
|
| - : SkPDFFont(canon, info, typeface, NULL) {
|
| + : SkPDFFont(info, typeface, NULL) {
|
| populate(subset);
|
| }
|
|
|
| @@ -1201,12 +1197,11 @@ bool SkPDFCIDFont::populate(const SkPDFGlyphSet* subset) {
|
| // class SkPDFType1Font
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|
| -SkPDFType1Font::SkPDFType1Font(SkPDFCanon* canon,
|
| - const SkAdvancedTypefaceMetrics* info,
|
| +SkPDFType1Font::SkPDFType1Font(const SkAdvancedTypefaceMetrics* info,
|
| SkTypeface* typeface,
|
| uint16_t glyphID,
|
| SkPDFDict* relatedFontDescriptor)
|
| - : SkPDFFont(canon, info, typeface, relatedFontDescriptor) {
|
| + : SkPDFFont(info, typeface, relatedFontDescriptor) {
|
| populate(glyphID);
|
| }
|
|
|
| @@ -1329,11 +1324,10 @@ void SkPDFType1Font::addWidthInfoFromRange(
|
| // class SkPDFType3Font
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|
| -SkPDFType3Font::SkPDFType3Font(SkPDFCanon* canon,
|
| - const SkAdvancedTypefaceMetrics* info,
|
| +SkPDFType3Font::SkPDFType3Font(const SkAdvancedTypefaceMetrics* info,
|
| SkTypeface* typeface,
|
| uint16_t glyphID)
|
| - : SkPDFFont(canon, info, typeface, NULL) {
|
| + : SkPDFFont(info, typeface, NULL) {
|
| populate(glyphID);
|
| }
|
|
|
|
|