OLD | NEW |
1 #ifndef __DEFINED__SkPdfEmbeddedFontStreamDictionary | 1 #ifndef __DEFINED__SkPdfEmbeddedFontStreamDictionary |
2 #define __DEFINED__SkPdfEmbeddedFontStreamDictionary | 2 #define __DEFINED__SkPdfEmbeddedFontStreamDictionary |
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 entries in an embedded font stream dictionary |
8 class SkPdfEmbeddedFontStreamDictionary : public SkPdfDictionary { | 9 class SkPdfEmbeddedFontStreamDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kEmbeddedFontStreamDictionary
_SkPdfObjectType;} | 11 virtual SkPdfObjectType getType() const { return kEmbeddedFontStreamDictionary
_SkPdfObjectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kEmbedde
dFontStreamDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kEmbedde
dFontStreamDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfEmbeddedFontStreamDictionary* asEmbeddedFontStreamDictionary() {r
eturn this;} | 14 virtual SkPdfEmbeddedFontStreamDictionary* asEmbeddedFontStreamDictionary() {r
eturn this;} |
14 virtual const SkPdfEmbeddedFontStreamDictionary* asEmbeddedFontStreamDictionar
y() const {return this;} | 15 virtual const SkPdfEmbeddedFontStreamDictionary* asEmbeddedFontStreamDictionar
y() 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 SkPdfEmbeddedFontStreamDictionary(const PdfMemDocument* podofoDoc = NULL, cons
t PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfEmbeddedFontStreamDictionary(const PdfMemDocument* podofoDoc = NULL, cons
t 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 SkPdfEmbeddedFontStreamDictionary& operator=(const SkPdfEmbeddedFontStreamDict
ionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodo
foObj; return *this;} | 523 SkPdfEmbeddedFontStreamDictionary& operator=(const SkPdfEmbeddedFontStreamDict
ionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodo
foObj; return *this;} |
523 | 524 |
| 525 /** (Required for Type 1 and TrueType fonts) The length in bytes of the clear-te
xt portion |
| 526 * of the Type 1 font program (see below), or the entire TrueType font program,
after it |
| 527 * has been decoded using the filters specified by the stream's Filter entry, i
f any. |
| 528 **/ |
| 529 bool has_Length1() const { |
| 530 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Lengt
h1", "", NULL)); |
| 531 } |
| 532 |
524 long Length1() const { | 533 long Length1() const { |
525 long ret; | 534 long ret; |
526 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Length1", "
", &ret)) return ret; | 535 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Length1", "
", &ret)) return ret; |
527 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 536 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
528 return 0; | 537 return 0; |
529 } | 538 } |
530 | 539 |
| 540 /** (Required for Type 1 fonts) The length in bytes of the encrypted portion of
the Type 1 |
| 541 * font program (see below) after it has been decoded using the filters specifi
ed by the |
| 542 * stream's Filter entry. |
| 543 **/ |
| 544 bool has_Length2() const { |
| 545 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Lengt
h2", "", NULL)); |
| 546 } |
| 547 |
531 long Length2() const { | 548 long Length2() const { |
532 long ret; | 549 long ret; |
533 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Length2", "
", &ret)) return ret; | 550 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Length2", "
", &ret)) return ret; |
534 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 551 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
535 return 0; | 552 return 0; |
536 } | 553 } |
537 | 554 |
| 555 /** (Required for Type 1 fonts) The length in bytes of the fixed-content portion
of the |
| 556 * Type 1 font program (see below), after it has been decoded using the filters
specified |
| 557 * by the stream's Filter entry. If Length3 is 0, it indicates that the 512 zer
os and clearto- |
| 558 * mark have not been included in the FontFile font program and must be added. |
| 559 **/ |
| 560 bool has_Length3() const { |
| 561 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Lengt
h3", "", NULL)); |
| 562 } |
| 563 |
538 long Length3() const { | 564 long Length3() const { |
539 long ret; | 565 long ret; |
540 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Length3", "
", &ret)) return ret; | 566 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Length3", "
", &ret)) return ret; |
541 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 567 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
542 return 0; | 568 return 0; |
543 } | 569 } |
544 | 570 |
| 571 /** (Required if referenced from FontFile3; PDF 1.2) A name specifying the forma
t of the |
| 572 * embedded font program. The name must be Type1C for Type 1 compact fonts or C
ID- |
| 573 * FontType0C for Type 0 compact CIDFonts. When additional font formats are add
ed |
| 574 * to PDF, more values will be defined for Subtype. |
| 575 **/ |
| 576 bool has_Subtype() const { |
| 577 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subty
pe", "", NULL)); |
| 578 } |
| 579 |
545 std::string Subtype() const { | 580 std::string Subtype() const { |
546 std::string ret; | 581 std::string ret; |
547 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", "
", &ret)) return ret; | 582 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", "
", &ret)) return ret; |
548 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 583 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
549 return ""; | 584 return ""; |
550 } | 585 } |
551 | 586 |
| 587 /** (Optional; PDF 1.4) A metadata stream containing metadata for the embedded f
ont |
| 588 * program (see Section 9.2.2, "Metadata Streams"). |
| 589 **/ |
| 590 bool has_Metadata() const { |
| 591 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metad
ata", "", NULL)); |
| 592 } |
| 593 |
552 SkPdfStream Metadata() const { | 594 SkPdfStream Metadata() const { |
553 SkPdfStream ret; | 595 SkPdfStream ret; |
554 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metadata"
, "", &ret)) return ret; | 596 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metadata"
, "", &ret)) return ret; |
555 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 597 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
556 return SkPdfStream(); | 598 return SkPdfStream(); |
557 } | 599 } |
558 | 600 |
559 }; | 601 }; |
560 | 602 |
561 #endif // __DEFINED__SkPdfEmbeddedFontStreamDictionary | 603 #endif // __DEFINED__SkPdfEmbeddedFontStreamDictionary |
OLD | NEW |