OLD | NEW |
1 #ifndef __DEFINED__SkPdfType3FontDictionary | 1 #ifndef __DEFINED__SkPdfType3FontDictionary |
2 #define __DEFINED__SkPdfType3FontDictionary | 2 #define __DEFINED__SkPdfType3FontDictionary |
3 | 3 |
4 #include "SkPdfEnums_autogen.h" | 4 #include "SkPdfEnums_autogen.h" |
5 #include "SkPdfArray_autogen.h" | 5 #include "SkPdfArray_autogen.h" |
6 #include "SkPdfFontDictionary_autogen.h" | 6 #include "SkPdfFontDictionary_autogen.h" |
7 | 7 |
| 8 // Entries in a Type 3 font dictionary |
8 class SkPdfType3FontDictionary : public SkPdfFontDictionary { | 9 class SkPdfType3FontDictionary : public SkPdfFontDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kType3FontDictionary_SkPdfObj
ectType;} | 11 virtual SkPdfObjectType getType() const { return kType3FontDictionary_SkPdfObj
ectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType3Fo
ntDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType3Fo
ntDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfType3FontDictionary* asType3FontDictionary() {return this;} | 14 virtual SkPdfType3FontDictionary* asType3FontDictionary() {return this;} |
14 virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return
this;} | 15 virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return
this;} |
15 | 16 |
16 private: | 17 private: |
17 virtual SkPdfCIDFontDictionary* asCIDFontDictionary() {return NULL;} | 18 virtual SkPdfCIDFontDictionary* asCIDFontDictionary() {return NULL;} |
(...skipping 13 matching lines...) Expand all Loading... |
31 | 32 |
32 public: | 33 public: |
33 private: | 34 private: |
34 public: | 35 public: |
35 SkPdfType3FontDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObje
ct* podofoObj = NULL) : SkPdfFontDictionary(podofoDoc, podofoObj) {} | 36 SkPdfType3FontDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObje
ct* podofoObj = NULL) : SkPdfFontDictionary(podofoDoc, podofoObj) {} |
36 | 37 |
37 virtual bool valid() const {return true;} | 38 virtual bool valid() const {return true;} |
38 | 39 |
39 SkPdfType3FontDictionary& operator=(const SkPdfType3FontDictionary& from) {thi
s->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *thi
s;} | 40 SkPdfType3FontDictionary& operator=(const SkPdfType3FontDictionary& from) {thi
s->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *thi
s;} |
40 | 41 |
| 42 /** (Required) The type of PDF object that this dictionary describes; must be |
| 43 * Font for a font dictionary. |
| 44 **/ |
| 45 bool has_Type() const { |
| 46 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type"
, "", NULL)); |
| 47 } |
| 48 |
41 std::string Type() const { | 49 std::string Type() const { |
42 std::string ret; | 50 std::string ret; |
43 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "",
&ret)) return ret; | 51 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "",
&ret)) return ret; |
44 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 52 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
45 return ""; | 53 return ""; |
46 } | 54 } |
47 | 55 |
| 56 /** (Required) The type of font; must be Type3 for a Type 3 font. |
| 57 **/ |
| 58 bool has_Subtype() const { |
| 59 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subty
pe", "", NULL)); |
| 60 } |
| 61 |
48 std::string Subtype() const { | 62 std::string Subtype() const { |
49 std::string ret; | 63 std::string ret; |
50 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", "
", &ret)) return ret; | 64 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", "
", &ret)) return ret; |
51 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 65 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
52 return ""; | 66 return ""; |
53 } | 67 } |
54 | 68 |
| 69 /** (Required in PDF 1.0; optional otherwise) See Table 5.8 on page 317. |
| 70 **/ |
| 71 bool has_Name() const { |
| 72 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name"
, "", NULL)); |
| 73 } |
| 74 |
55 std::string Name() const { | 75 std::string Name() const { |
56 std::string ret; | 76 std::string ret; |
57 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name", "",
&ret)) return ret; | 77 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name", "",
&ret)) return ret; |
58 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 78 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
59 return ""; | 79 return ""; |
60 } | 80 } |
61 | 81 |
| 82 /** (Required) A rectangle (see Section 3.8.3, "Rectangles"), expressed in the |
| 83 * glyph coordinate system, specifying the font bounding box. This is the small
- |
| 84 * est rectangle enclosing the shape that would result if all of the glyphs of
the |
| 85 * font were placed with their origins coincident and then filled. |
| 86 * If all four elements of the rectangle are zero, no assumptions are made base
d |
| 87 * on the font bounding box. If any element is nonzero, it is essential that th
e |
| 88 * font bounding box be accurate; if any glyph's marks fall outside this bound- |
| 89 * ing box, incorrect behavior may result. |
| 90 **/ |
| 91 bool has_FontBBox() const { |
| 92 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontB
Box", "", NULL)); |
| 93 } |
| 94 |
62 SkRect FontBBox() const { | 95 SkRect FontBBox() const { |
63 SkRect ret; | 96 SkRect ret; |
64 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontBBox"
, "", &ret)) return ret; | 97 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontBBox"
, "", &ret)) return ret; |
65 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 98 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
66 return SkRect(); | 99 return SkRect(); |
67 } | 100 } |
68 | 101 |
| 102 /** (Required) An array of six numbers specifying the font matrix, mapping |
| 103 * glyph space to text space (see Section 5.1.3, "Glyph Positioning and |
| 104 * Metrics"). A common practice is to define glyphs in terms of a 1000-unit |
| 105 **/ |
| 106 bool has_FontMatrix() const { |
| 107 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontM
atrix", "", NULL)); |
| 108 } |
| 109 |
69 SkPdfArray FontMatrix() const { | 110 SkPdfArray FontMatrix() const { |
70 SkPdfArray ret; | 111 SkPdfArray ret; |
71 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontMatrix
", "", &ret)) return ret; | 112 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontMatrix
", "", &ret)) return ret; |
72 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 113 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
73 return SkPdfArray(); | 114 return SkPdfArray(); |
74 } | 115 } |
75 | 116 |
76 }; | 117 }; |
77 | 118 |
78 #endif // __DEFINED__SkPdfType3FontDictionary | 119 #endif // __DEFINED__SkPdfType3FontDictionary |
OLD | NEW |