| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright 2011 Google Inc. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license that can be | |
| 5 * found in the LICENSE file. | |
| 6 */ | |
| 7 | |
| 8 | |
| 9 #ifndef SkPDFFontImpl_DEFINED | |
| 10 #define SkPDFFontImpl_DEFINED | |
| 11 | |
| 12 #include "SkPDFFont.h" | |
| 13 | |
| 14 class SkPDFType0Font final : public SkPDFFont { | |
| 15 public: | |
| 16 virtual ~SkPDFType0Font(); | |
| 17 bool multiByteGlyphs() const override { return true; } | |
| 18 SkPDFFont* getFontSubset(const SkPDFGlyphSet* usage) override; | |
| 19 #ifdef SK_DEBUG | |
| 20 void emitObject(SkWStream*, | |
| 21 const SkPDFObjNumMap&, | |
| 22 const SkPDFSubstituteMap&) const override; | |
| 23 #endif | |
| 24 | |
| 25 private: | |
| 26 friend class SkPDFFont; // to access the constructor | |
| 27 #ifdef SK_DEBUG | |
| 28 bool fPopulated; | |
| 29 typedef SkPDFDict INHERITED; | |
| 30 #endif | |
| 31 | |
| 32 SkPDFType0Font(const SkAdvancedTypefaceMetrics* info, | |
| 33 SkTypeface* typeface); | |
| 34 | |
| 35 bool populate(const SkPDFGlyphSet* subset); | |
| 36 }; | |
| 37 | |
| 38 class SkPDFCIDFont final : public SkPDFFont { | |
| 39 public: | |
| 40 virtual ~SkPDFCIDFont(); | |
| 41 virtual bool multiByteGlyphs() const { return true; } | |
| 42 | |
| 43 private: | |
| 44 friend class SkPDFType0Font; // to access the constructor | |
| 45 | |
| 46 SkPDFCIDFont(const SkAdvancedTypefaceMetrics* info, | |
| 47 SkTypeface* typeface, | |
| 48 const SkPDFGlyphSet* subset); | |
| 49 | |
| 50 bool populate(const SkPDFGlyphSet* subset); | |
| 51 bool addFontDescriptor(int16_t defaultWidth, | |
| 52 const SkTDArray<uint32_t>* subset); | |
| 53 }; | |
| 54 | |
| 55 struct AdvanceMetric; | |
| 56 | |
| 57 class SkPDFType1Font final : public SkPDFFont { | |
| 58 public: | |
| 59 virtual ~SkPDFType1Font(); | |
| 60 virtual bool multiByteGlyphs() const { return false; } | |
| 61 | |
| 62 private: | |
| 63 friend class SkPDFFont; // to access the constructor | |
| 64 | |
| 65 SkPDFType1Font(const SkAdvancedTypefaceMetrics* info, | |
| 66 SkTypeface* typeface, | |
| 67 uint16_t glyphID, | |
| 68 SkPDFDict* relatedFontDescriptor); | |
| 69 | |
| 70 bool populate(int16_t glyphID); | |
| 71 bool addFontDescriptor(int16_t defaultWidth); | |
| 72 void addWidthInfoFromRange(int16_t defaultWidth, | |
| 73 const AdvanceMetric* widthRangeEntry); | |
| 74 }; | |
| 75 | |
| 76 class SkPDFType3Font final : public SkPDFFont { | |
| 77 public: | |
| 78 virtual ~SkPDFType3Font(); | |
| 79 virtual bool multiByteGlyphs() const { return false; } | |
| 80 | |
| 81 private: | |
| 82 friend class SkPDFFont; // to access the constructor | |
| 83 | |
| 84 SkPDFType3Font(const SkAdvancedTypefaceMetrics* info, | |
| 85 SkTypeface* typeface, | |
| 86 uint16_t glyphID); | |
| 87 | |
| 88 bool populate(uint16_t glyphID); | |
| 89 }; | |
| 90 | |
| 91 #endif | |
| OLD | NEW |