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