| OLD | NEW |
| 1 #ifndef __DEFINED__SkPdfCIDFontDescriptorDictionary | 1 #ifndef __DEFINED__SkPdfCIDFontDescriptorDictionary |
| 2 #define __DEFINED__SkPdfCIDFontDescriptorDictionary | 2 #define __DEFINED__SkPdfCIDFontDescriptorDictionary |
| 3 | 3 |
| 4 #include "SkPdfEnums_autogen.h" | 4 #include "SkPdfEnums_autogen.h" |
| 5 #include "SkPdfArray_autogen.h" | 5 #include "SkPdfArray_autogen.h" |
| 6 #include "SkPdfDictionary_autogen.h" | 6 #include "SkPdfDictionary_autogen.h" |
| 7 | 7 |
| 8 // Additional font descriptor entries for CIDFonts |
| 8 class SkPdfCIDFontDescriptorDictionary : public SkPdfDictionary { | 9 class SkPdfCIDFontDescriptorDictionary : public SkPdfDictionary { |
| 9 public: | 10 public: |
| 10 virtual SkPdfObjectType getType() const { return kCIDFontDescriptorDictionary_
SkPdfObjectType;} | 11 virtual SkPdfObjectType getType() const { return kCIDFontDescriptorDictionary_
SkPdfObjectType;} |
| 11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kCIDFont
DescriptorDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kCIDFont
DescriptorDictionary_SkPdfObjectType + 1);} |
| 12 public: | 13 public: |
| 13 virtual SkPdfCIDFontDescriptorDictionary* asCIDFontDescriptorDictionary() {ret
urn this;} | 14 virtual SkPdfCIDFontDescriptorDictionary* asCIDFontDescriptorDictionary() {ret
urn this;} |
| 14 virtual const SkPdfCIDFontDescriptorDictionary* asCIDFontDescriptorDictionary(
) const {return this;} | 15 virtual const SkPdfCIDFontDescriptorDictionary* asCIDFontDescriptorDictionary(
) const {return this;} |
| 15 | 16 |
| 16 private: | 17 private: |
| 17 virtual SkPdfALinkAnnotationDictionary* asALinkAnnotationDictionary() {return
NULL;} | 18 virtual SkPdfALinkAnnotationDictionary* asALinkAnnotationDictionary() {return
NULL;} |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 | 515 |
| 515 public: | 516 public: |
| 516 private: | 517 private: |
| 517 public: | 518 public: |
| 518 SkPdfCIDFontDescriptorDictionary(const PdfMemDocument* podofoDoc = NULL, const
PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfCIDFontDescriptorDictionary(const PdfMemDocument* podofoDoc = NULL, const
PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
| 519 | 520 |
| 520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
| 521 | 522 |
| 522 SkPdfCIDFontDescriptorDictionary& operator=(const SkPdfCIDFontDescriptorDictio
nary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofo
Obj; return *this;} | 523 SkPdfCIDFontDescriptorDictionary& operator=(const SkPdfCIDFontDescriptorDictio
nary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofo
Obj; return *this;} |
| 523 | 524 |
| 525 /** (Optional) A dictionary containing entries that describe the style of the gl
yphs in |
| 526 * the font (see "Style," above). |
| 527 **/ |
| 528 bool has_Style() const { |
| 529 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Style
", "", NULL)); |
| 530 } |
| 531 |
| 524 SkPdfDictionary* Style() const { | 532 SkPdfDictionary* Style() const { |
| 525 SkPdfDictionary* ret; | 533 SkPdfDictionary* ret; |
| 526 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Style
", "", &ret)) return ret; | 534 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Style
", "", &ret)) return ret; |
| 527 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 535 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 528 return NULL; | 536 return NULL; |
| 529 } | 537 } |
| 530 | 538 |
| 539 /** (Optional) A name specifying the language of the font, used for encodings wh
ere |
| 540 * the language is not implied by the encoding itself. The possible values are
the |
| 541 * 2-character language codes defined by ISO 639-for example, en for English an
d ja |
| 542 * for Japanese. The complete list of these codes be obtained from the Internat
ional |
| 543 * Organization for Standardization (see the Bibliography). |
| 544 **/ |
| 545 bool has_Lang() const { |
| 546 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Lang"
, "", NULL)); |
| 547 } |
| 548 |
| 531 std::string Lang() const { | 549 std::string Lang() const { |
| 532 std::string ret; | 550 std::string ret; |
| 533 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Lang", "",
&ret)) return ret; | 551 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Lang", "",
&ret)) return ret; |
| 534 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 552 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 535 return ""; | 553 return ""; |
| 536 } | 554 } |
| 537 | 555 |
| 556 /** (Optional) A dictionary whose keys identify a class of characters in a CIDFo
nt. |
| 557 * Each value is a dictionary containing entries that override the correspondin
g |
| 558 * values in the main font descriptor dictionary for that class of characters (
see "FD," |
| 559 * below). |
| 560 **/ |
| 561 bool has_FD() const { |
| 562 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FD",
"", NULL)); |
| 563 } |
| 564 |
| 538 SkPdfDictionary* FD() const { | 565 SkPdfDictionary* FD() const { |
| 539 SkPdfDictionary* ret; | 566 SkPdfDictionary* ret; |
| 540 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FD",
"", &ret)) return ret; | 567 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FD",
"", &ret)) return ret; |
| 541 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 568 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 542 return NULL; | 569 return NULL; |
| 543 } | 570 } |
| 544 | 571 |
| 572 /** (Optional) A stream identifying which CIDs are present in the CIDFont file.
If this |
| 573 * entry is present, the CIDFont contains only a subset of the glyphs in the ch
aracter |
| 574 * collection defined by the CIDSystemInfo dictionary. If it is absent, the onl
y indica- |
| 575 * tion of a CIDFont subset is the subset tag in the FontName entry (see Sectio
n 5.5.3, |
| 576 * "Font Subsets"). |
| 577 * The stream's data is organized as a table of bits indexed by CID. The bits s
hould be |
| 578 * stored in bytes with the high-order bit first. Each bit corresponds to a CID
. The first |
| 579 * bit of the first byte corresponds to CID 0, the next bit to CID 1, and so on
. |
| 580 **/ |
| 581 bool has_CIDSet() const { |
| 582 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CIDSe
t", "", NULL)); |
| 583 } |
| 584 |
| 545 SkPdfStream CIDSet() const { | 585 SkPdfStream CIDSet() const { |
| 546 SkPdfStream ret; | 586 SkPdfStream ret; |
| 547 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CIDSet",
"", &ret)) return ret; | 587 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CIDSet",
"", &ret)) return ret; |
| 548 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 588 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 549 return SkPdfStream(); | 589 return SkPdfStream(); |
| 550 } | 590 } |
| 551 | 591 |
| 552 }; | 592 }; |
| 553 | 593 |
| 554 #endif // __DEFINED__SkPdfCIDFontDescriptorDictionary | 594 #endif // __DEFINED__SkPdfCIDFontDescriptorDictionary |
| OLD | NEW |