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