Chromium Code Reviews| Index: src/pdf/SkPDFFont.h |
| diff --git a/src/pdf/SkPDFFont.h b/src/pdf/SkPDFFont.h |
| index acf9bf87ee453606c0e246bdfd7569a35a5aac61..0dca7aae8cf595eeae9afdafdfc08e02b607b68f 100644 |
| --- a/src/pdf/SkPDFFont.h |
| +++ b/src/pdf/SkPDFFont.h |
| @@ -75,16 +75,16 @@ public: |
| /** Returns the typeface represented by this class. Returns nullptr for the |
| * default typeface. |
| */ |
| - SkTypeface* typeface(); |
| + SkTypeface* typeface() { return fTypeface.get(); } |
| /** Returns the font type represented in this font. For Type0 fonts, |
| * returns the type of the decendant font. |
| */ |
| - virtual SkAdvancedTypefaceMetrics::FontType getType(); |
| + SkAdvancedTypefaceMetrics::FontType getType() { return fFontType; } |
| /** Returns true if this font encoding supports glyph IDs above 255. |
| */ |
| - virtual bool multiByteGlyphs() const = 0; |
| + bool multiByteGlyphs() const { return fMultiByteGlyphs; } |
| /** Returns true if the machine readable licensing bits allow embedding. |
| */ |
| @@ -155,18 +155,20 @@ protected: |
| // Common constructor to handle common members. |
| SkPDFFont(const SkAdvancedTypefaceMetrics* fontInfo, |
| SkTypeface* typeface, |
| - SkPDFDict* relatedFontDescriptor); |
| + SkPDFDict* relatedFontDescriptor, |
| + SkAdvancedTypefaceMetrics::FontType fontType, |
| + bool multiByteGlyphs); |
| // Accessors for subclass. |
| - const SkAdvancedTypefaceMetrics* fontInfo(); |
| - void setFontInfo(const SkAdvancedTypefaceMetrics* info); |
| - uint16_t firstGlyphID() const; |
| - uint16_t lastGlyphID() const; |
| + sk_sp<const SkAdvancedTypefaceMetrics>& fontInfo() { return fFontInfo; } |
|
bungeman-skia
2016/08/15 16:49:58
This is a convoluted and very restraining signatur
hal.canary
2016/08/15 18:05:23
Done.
|
| + void setFontInfo(sk_sp<const SkAdvancedTypefaceMetrics> info); |
| + SkGlyphID firstGlyphID() const { return fFirstGlyphID; } |
| + SkGlyphID lastGlyphID() const { return fLastGlyphID; } |
| void setLastGlyphID(uint16_t glyphID); |
| // Accessors for FontDescriptor associated with this object. |
| - SkPDFDict* getFontDescriptor(); |
| - void setFontDescriptor(SkPDFDict* descriptor); |
| + const sk_sp<SkPDFDict>& getFontDescriptor() { return fDescriptor; } |
| + void setFontDescriptor(sk_sp<SkPDFDict> descriptor); |
| // Add common entries to FontDescriptor. |
| bool addCommonFontDescriptorEntries(int16_t defaultWidth); |
| @@ -193,15 +195,15 @@ protected: |
| private: |
| sk_sp<SkTypeface> fTypeface; |
| - |
| - // The glyph IDs accessible with this font. For Type1 (non CID) fonts, |
| - // this will be a subset if the font has more than 255 glyphs. |
| - uint16_t fFirstGlyphID; |
| - uint16_t fLastGlyphID; |
| sk_sp<const SkAdvancedTypefaceMetrics> fFontInfo; |
| sk_sp<SkPDFDict> fDescriptor; |
| + // The glyph IDs accessible with this font. For Type1 (non CID) fonts, |
| + // this will be a subset if the font has more than 255 glyphs. |
| + SkGlyphID fFirstGlyphID; |
| + SkGlyphID fLastGlyphID; |
| SkAdvancedTypefaceMetrics::FontType fFontType; |
| + bool fMultiByteGlyphs; |
| typedef SkPDFDict INHERITED; |
| }; |