| OLD | NEW |
| 1 #ifndef __DEFINED__SkPdfEncodingDictionary | 1 #ifndef __DEFINED__SkPdfEncodingDictionary |
| 2 #define __DEFINED__SkPdfEncodingDictionary | 2 #define __DEFINED__SkPdfEncodingDictionary |
| 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 // Entries in an encoding dictionary | 9 // Entries in an encoding dictionary |
| 10 class SkPdfEncodingDictionary : public SkPdfDictionary { | 10 class SkPdfEncodingDictionary : public SkPdfDictionary { |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 | 525 |
| 526 SkPdfEncodingDictionary& operator=(const SkPdfEncodingDictionary& from) {this-
>fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;
} | 526 SkPdfEncodingDictionary& operator=(const SkPdfEncodingDictionary& from) {this-
>fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;
} |
| 527 | 527 |
| 528 /** (Optional) The type of PDF object that this dictionary describes; if present
, must | 528 /** (Optional) The type of PDF object that this dictionary describes; if present
, must |
| 529 * be Encoding for an encoding dictionary. | 529 * be Encoding for an encoding dictionary. |
| 530 **/ | 530 **/ |
| 531 bool has_Type() const { | 531 bool has_Type() const { |
| 532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type"
, "", NULL)); | 532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type"
, "", NULL)); |
| 533 } | 533 } |
| 534 | 534 |
| 535 std::string Type() const { | 535 std::string Type() const; |
| 536 std::string ret; | |
| 537 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "",
&ret)) return ret; | |
| 538 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 539 return ""; | |
| 540 } | |
| 541 | |
| 542 /** (Optional) The base encoding-that is, the encoding from which the Difference
s | 536 /** (Optional) The base encoding-that is, the encoding from which the Difference
s |
| 543 * entry (if present) describes differences-specified as the name of a predefin
ed | 537 * entry (if present) describes differences-specified as the name of a predefin
ed |
| 544 * encoding MacRomanEncoding, MacExpertEncoding, or WinAnsiEncoding (see | 538 * encoding MacRomanEncoding, MacExpertEncoding, or WinAnsiEncoding (see |
| 545 * Appendix D). | 539 * Appendix D). |
| 546 * If this entry is absent, the Differences entry describes differences from an
im- | 540 * If this entry is absent, the Differences entry describes differences from an
im- |
| 547 * plicit base encoding. For a font program that is embedded in the PDF file, t
he | 541 * plicit base encoding. For a font program that is embedded in the PDF file, t
he |
| 548 * implicit base encoding is the font program's built-in encoding, as described | 542 * implicit base encoding is the font program's built-in encoding, as described |
| 549 * above and further elaborated in the sections on specific font types below. O
ther- | 543 * above and further elaborated in the sections on specific font types below. O
ther- |
| 550 * wise, for a nonsymbolic font, it is StandardEncoding, and for a symbolic fon
t, it | 544 * wise, for a nonsymbolic font, it is StandardEncoding, and for a symbolic fon
t, it |
| 551 * is the font's built-in encoding. | 545 * is the font's built-in encoding. |
| 552 **/ | 546 **/ |
| 553 bool has_BaseEncoding() const { | 547 bool has_BaseEncoding() const { |
| 554 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BaseE
ncoding", "", NULL)); | 548 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BaseE
ncoding", "", NULL)); |
| 555 } | 549 } |
| 556 | 550 |
| 557 std::string BaseEncoding() const { | 551 std::string BaseEncoding() const; |
| 558 std::string ret; | |
| 559 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BaseEncodin
g", "", &ret)) return ret; | |
| 560 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 561 return ""; | |
| 562 } | |
| 563 | |
| 564 /** (Optional; not recommended with TrueType fonts) An array describing the diff
er- | 552 /** (Optional; not recommended with TrueType fonts) An array describing the diff
er- |
| 565 * ences from the encoding specified by BaseEncoding or, if BaseEncoding is ab- | 553 * ences from the encoding specified by BaseEncoding or, if BaseEncoding is ab- |
| 566 * sent, from an implicit base encoding. The Differences array is described abo
ve. | 554 * sent, from an implicit base encoding. The Differences array is described abo
ve. |
| 567 * The value of the Differences entry is an array of character codes and cha
racter | 555 * The value of the Differences entry is an array of character codes and cha
racter |
| 568 * names organized as follows: | 556 * names organized as follows: |
| 569 * code1 name1,1 name1,2 ... | 557 * code1 name1,1 name1,2 ... |
| 570 * code2 name2,1 name2,2 ... | 558 * code2 name2,1 name2,2 ... |
| 571 * ... | 559 * ... |
| 572 * coden namen,1 namen,2 ... | 560 * coden namen,1 namen,2 ... |
| 573 * Each code is the first index in a sequence of characters to be changed. T
he first | 561 * Each code is the first index in a sequence of characters to be changed. T
he first |
| 574 * character name after the code becomes the name corresponding to that code
. | 562 * character name after the code becomes the name corresponding to that code
. |
| 575 * Subsequent names replace consecutive code indices until the next code app
ears in | 563 * Subsequent names replace consecutive code indices until the next code app
ears in |
| 576 * the array or the array ends. These sequences may be specified in any orde
r but | 564 * the array or the array ends. These sequences may be specified in any orde
r but |
| 577 * should not overlap. | 565 * should not overlap. |
| 578 * For example, in the encoding dictionary in Example 5.10, the name quotesi
ngle | 566 * For example, in the encoding dictionary in Example 5.10, the name quotesi
ngle |
| 579 * ( ' ) is associated with character code 39, Adieresis (A) with code 128,
Aring (A) | 567 * ( ' ) is associated with character code 39, Adieresis (A) with code 128,
Aring (A) |
| 580 * with 129, and trademark ((TM)) with 170. | 568 * with 129, and trademark ((TM)) with 170. |
| 581 **/ | 569 **/ |
| 582 bool has_Differences() const { | 570 bool has_Differences() const { |
| 583 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Diffe
rences", "", NULL)); | 571 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Diffe
rences", "", NULL)); |
| 584 } | 572 } |
| 585 | 573 |
| 586 SkPdfArray* Differences() const { | 574 SkPdfArray* Differences() const; |
| 587 SkPdfArray* ret; | |
| 588 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Difference
s", "", &ret)) return ret; | |
| 589 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 590 return NULL; | |
| 591 } | |
| 592 | |
| 593 }; | 575 }; |
| 594 | 576 |
| 595 #endif // __DEFINED__SkPdfEncodingDictionary | 577 #endif // __DEFINED__SkPdfEncodingDictionary |
| OLD | NEW |