| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright 2013 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 #include "SkPdfType0FontDictionary_autogen.h" | |
| 9 #include "SkPdfNativeDoc.h" | |
| 10 | |
| 11 SkString SkPdfType0FontDictionary::Type(SkPdfNativeDoc* doc) { | |
| 12 SkPdfNativeObject* ret = get("Type", ""); | |
| 13 if (doc) {ret = doc->resolveReference(ret);} | |
| 14 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
| 15 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
| 16 return SkString(); | |
| 17 } | |
| 18 | |
| 19 bool SkPdfType0FontDictionary::has_Type() const { | |
| 20 return get("Type", "") != NULL; | |
| 21 } | |
| 22 | |
| 23 SkString SkPdfType0FontDictionary::Subtype(SkPdfNativeDoc* doc) { | |
| 24 SkPdfNativeObject* ret = get("Subtype", ""); | |
| 25 if (doc) {ret = doc->resolveReference(ret);} | |
| 26 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
| 27 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
| 28 return SkString(); | |
| 29 } | |
| 30 | |
| 31 bool SkPdfType0FontDictionary::has_Subtype() const { | |
| 32 return get("Subtype", "") != NULL; | |
| 33 } | |
| 34 | |
| 35 SkString SkPdfType0FontDictionary::BaseFont(SkPdfNativeDoc* doc) { | |
| 36 SkPdfNativeObject* ret = get("BaseFont", ""); | |
| 37 if (doc) {ret = doc->resolveReference(ret);} | |
| 38 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
| 39 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
| 40 return SkString(); | |
| 41 } | |
| 42 | |
| 43 bool SkPdfType0FontDictionary::has_BaseFont() const { | |
| 44 return get("BaseFont", "") != NULL; | |
| 45 } | |
| 46 | |
| 47 bool SkPdfType0FontDictionary::isEncodingAName(SkPdfNativeDoc* doc) { | |
| 48 SkPdfNativeObject* ret = get("Encoding", ""); | |
| 49 if (doc) {ret = doc->resolveReference(ret);} | |
| 50 return ret != NULL && ret->isName(); | |
| 51 } | |
| 52 | |
| 53 SkString SkPdfType0FontDictionary::getEncodingAsName(SkPdfNativeDoc* doc) { | |
| 54 SkPdfNativeObject* ret = get("Encoding", ""); | |
| 55 if (doc) {ret = doc->resolveReference(ret);} | |
| 56 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
| 57 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
| 58 return SkString(); | |
| 59 } | |
| 60 | |
| 61 bool SkPdfType0FontDictionary::isEncodingAStream(SkPdfNativeDoc* doc) { | |
| 62 SkPdfNativeObject* ret = get("Encoding", ""); | |
| 63 if (doc) {ret = doc->resolveReference(ret);} | |
| 64 return ret != NULL && ret->hasStream(); | |
| 65 } | |
| 66 | |
| 67 SkPdfStream* SkPdfType0FontDictionary::getEncodingAsStream(SkPdfNativeDoc* doc)
{ | |
| 68 SkPdfNativeObject* ret = get("Encoding", ""); | |
| 69 if (doc) {ret = doc->resolveReference(ret);} | |
| 70 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->getStream(); | |
| 71 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
| 72 return NULL; | |
| 73 } | |
| 74 | |
| 75 bool SkPdfType0FontDictionary::has_Encoding() const { | |
| 76 return get("Encoding", "") != NULL; | |
| 77 } | |
| 78 | |
| 79 SkPdfArray* SkPdfType0FontDictionary::DescendantFonts(SkPdfNativeDoc* doc) { | |
| 80 SkPdfNativeObject* ret = get("DescendantFonts", ""); | |
| 81 if (doc) {ret = doc->resolveReference(ret);} | |
| 82 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; | |
| 83 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
| 84 return NULL; | |
| 85 } | |
| 86 | |
| 87 bool SkPdfType0FontDictionary::has_DescendantFonts() const { | |
| 88 return get("DescendantFonts", "") != NULL; | |
| 89 } | |
| 90 | |
| 91 SkPdfStream* SkPdfType0FontDictionary::ToUnicode(SkPdfNativeDoc* doc) { | |
| 92 SkPdfNativeObject* ret = get("ToUnicode", ""); | |
| 93 if (doc) {ret = doc->resolveReference(ret);} | |
| 94 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->getStream(); | |
| 95 // TODO(edisonn): warn about missing default value for optional fields | |
| 96 return NULL; | |
| 97 } | |
| 98 | |
| 99 bool SkPdfType0FontDictionary::has_ToUnicode() const { | |
| 100 return get("ToUnicode", "") != NULL; | |
| 101 } | |
| OLD | NEW |