OLD | NEW |
(Empty) | |
| 1 #include "SkPdfType1FontDictionary_autogen.h" |
| 2 |
| 3 |
| 4 #include "SkPdfNativeDoc.h" |
| 5 SkString SkPdfType1FontDictionary::Type(SkPdfNativeDoc* doc) { |
| 6 SkPdfNativeObject* ret = get("Type", ""); |
| 7 if (doc) {ret = doc->resolveReference(ret);} |
| 8 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 9 // TODO(edisonn): warn about missing required field, assert for known good pdf
s |
| 10 return SkString(); |
| 11 } |
| 12 |
| 13 bool SkPdfType1FontDictionary::has_Type() const { |
| 14 return get("Type", "") != NULL; |
| 15 } |
| 16 |
| 17 SkString SkPdfType1FontDictionary::Subtype(SkPdfNativeDoc* doc) { |
| 18 SkPdfNativeObject* ret = get("Subtype", ""); |
| 19 if (doc) {ret = doc->resolveReference(ret);} |
| 20 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 21 // TODO(edisonn): warn about missing required field, assert for known good pdf
s |
| 22 return SkString(); |
| 23 } |
| 24 |
| 25 bool SkPdfType1FontDictionary::has_Subtype() const { |
| 26 return get("Subtype", "") != NULL; |
| 27 } |
| 28 |
| 29 SkString SkPdfType1FontDictionary::Name(SkPdfNativeDoc* doc) { |
| 30 SkPdfNativeObject* ret = get("Name", ""); |
| 31 if (doc) {ret = doc->resolveReference(ret);} |
| 32 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 33 // TODO(edisonn): warn about missing default value for optional fields |
| 34 return SkString(); |
| 35 } |
| 36 |
| 37 bool SkPdfType1FontDictionary::has_Name() const { |
| 38 return get("Name", "") != NULL; |
| 39 } |
| 40 |
| 41 SkString SkPdfType1FontDictionary::BaseFont(SkPdfNativeDoc* doc) { |
| 42 SkPdfNativeObject* ret = get("BaseFont", ""); |
| 43 if (doc) {ret = doc->resolveReference(ret);} |
| 44 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 45 // TODO(edisonn): warn about missing required field, assert for known good pdf
s |
| 46 return SkString(); |
| 47 } |
| 48 |
| 49 bool SkPdfType1FontDictionary::has_BaseFont() const { |
| 50 return get("BaseFont", "") != NULL; |
| 51 } |
| 52 |
| 53 int64_t SkPdfType1FontDictionary::FirstChar(SkPdfNativeDoc* doc) { |
| 54 SkPdfNativeObject* ret = get("FirstChar", ""); |
| 55 if (doc) {ret = doc->resolveReference(ret);} |
| 56 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); |
| 57 // TODO(edisonn): warn about missing default value for optional fields |
| 58 return 0; |
| 59 } |
| 60 |
| 61 bool SkPdfType1FontDictionary::has_FirstChar() const { |
| 62 return get("FirstChar", "") != NULL; |
| 63 } |
| 64 |
| 65 int64_t SkPdfType1FontDictionary::LastChar(SkPdfNativeDoc* doc) { |
| 66 SkPdfNativeObject* ret = get("LastChar", ""); |
| 67 if (doc) {ret = doc->resolveReference(ret);} |
| 68 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); |
| 69 // TODO(edisonn): warn about missing default value for optional fields |
| 70 return 0; |
| 71 } |
| 72 |
| 73 bool SkPdfType1FontDictionary::has_LastChar() const { |
| 74 return get("LastChar", "") != NULL; |
| 75 } |
| 76 |
| 77 SkPdfArray* SkPdfType1FontDictionary::Widths(SkPdfNativeDoc* doc) { |
| 78 SkPdfNativeObject* ret = get("Widths", ""); |
| 79 if (doc) {ret = doc->resolveReference(ret);} |
| 80 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; |
| 81 // TODO(edisonn): warn about missing default value for optional fields |
| 82 return NULL; |
| 83 } |
| 84 |
| 85 bool SkPdfType1FontDictionary::has_Widths() const { |
| 86 return get("Widths", "") != NULL; |
| 87 } |
| 88 |
| 89 SkPdfFontDescriptorDictionary* SkPdfType1FontDictionary::FontDescriptor(SkPdfNat
iveDoc* doc) { |
| 90 SkPdfNativeObject* ret = get("FontDescriptor", ""); |
| 91 if (doc) {ret = doc->resolveReference(ret);} |
| 92 if ((ret != NULL && ret->isDictionary() && ((SkPdfFontDescriptorDictionary*)re
t)->valid()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPd
fFontDescriptorDictionary*)ret; |
| 93 // TODO(edisonn): warn about missing default value for optional fields |
| 94 return NULL; |
| 95 } |
| 96 |
| 97 bool SkPdfType1FontDictionary::has_FontDescriptor() const { |
| 98 return get("FontDescriptor", "") != NULL; |
| 99 } |
| 100 |
| 101 bool SkPdfType1FontDictionary::isEncodingAName(SkPdfNativeDoc* doc) { |
| 102 SkPdfNativeObject* ret = get("Encoding", ""); |
| 103 if (doc) {ret = doc->resolveReference(ret);} |
| 104 return ret != NULL && ret->isName(); |
| 105 } |
| 106 |
| 107 SkString SkPdfType1FontDictionary::getEncodingAsName(SkPdfNativeDoc* doc) { |
| 108 SkPdfNativeObject* ret = get("Encoding", ""); |
| 109 if (doc) {ret = doc->resolveReference(ret);} |
| 110 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 111 // TODO(edisonn): warn about missing default value for optional fields |
| 112 return SkString(); |
| 113 } |
| 114 |
| 115 bool SkPdfType1FontDictionary::isEncodingADictionary(SkPdfNativeDoc* doc) { |
| 116 SkPdfNativeObject* ret = get("Encoding", ""); |
| 117 if (doc) {ret = doc->resolveReference(ret);} |
| 118 return ret != NULL && ret->isDictionary(); |
| 119 } |
| 120 |
| 121 SkPdfDictionary* SkPdfType1FontDictionary::getEncodingAsDictionary(SkPdfNativeDo
c* doc) { |
| 122 SkPdfNativeObject* ret = get("Encoding", ""); |
| 123 if (doc) {ret = doc->resolveReference(ret);} |
| 124 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret
->isReference())) return (SkPdfDictionary*)ret; |
| 125 // TODO(edisonn): warn about missing default value for optional fields |
| 126 return NULL; |
| 127 } |
| 128 |
| 129 bool SkPdfType1FontDictionary::has_Encoding() const { |
| 130 return get("Encoding", "") != NULL; |
| 131 } |
| 132 |
| 133 SkPdfStream* SkPdfType1FontDictionary::ToUnicode(SkPdfNativeDoc* doc) { |
| 134 SkPdfNativeObject* ret = get("ToUnicode", ""); |
| 135 if (doc) {ret = doc->resolveReference(ret);} |
| 136 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->getStream(); |
| 137 // TODO(edisonn): warn about missing default value for optional fields |
| 138 return NULL; |
| 139 } |
| 140 |
| 141 bool SkPdfType1FontDictionary::has_ToUnicode() const { |
| 142 return get("ToUnicode", "") != NULL; |
| 143 } |
| 144 |
OLD | NEW |