Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(454)

Side by Side Diff: experimental/PdfViewer/autogen/SkPdfFontDescriptorDictionary_autogen.h

Issue 17856004: refactoring for pdf viewer lib (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #ifndef __DEFINED__SkPdfFontDescriptorDictionary 1 #ifndef __DEFINED__SkPdfFontDescriptorDictionary
2 #define __DEFINED__SkPdfFontDescriptorDictionary 2 #define __DEFINED__SkPdfFontDescriptorDictionary
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 common to all font descriptors 9 // Entries common to all font descriptors
10 class SkPdfFontDescriptorDictionary : public SkPdfDictionary { 10 class SkPdfFontDescriptorDictionary : public SkPdfDictionary {
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 525
526 SkPdfFontDescriptorDictionary& operator=(const SkPdfFontDescriptorDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; r eturn *this;} 526 SkPdfFontDescriptorDictionary& operator=(const SkPdfFontDescriptorDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; r eturn *this;}
527 527
528 /** (Required) The type of PDF object that this dictionary describes; must be 528 /** (Required) The type of PDF object that this dictionary describes; must be
529 * FontDescriptor for a font descriptor. 529 * FontDescriptor for a font descriptor.
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 /** (Required) The PostScript name of the font. This should be the same as the 536 /** (Required) The PostScript name of the font. This should be the same as the
543 * value of BaseFont in the font or CIDFont dictionary that refers to this font 537 * value of BaseFont in the font or CIDFont dictionary that refers to this font
544 * descriptor. 538 * descriptor.
545 **/ 539 **/
546 bool has_FontName() const { 540 bool has_FontName() const {
547 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontN ame", "", NULL)); 541 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontN ame", "", NULL));
548 } 542 }
549 543
550 std::string FontName() const { 544 std::string FontName() const;
551 std::string ret;
552 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontName", "", &ret)) return ret;
553 // TODO(edisonn): warn about missing required field, assert for known good p dfs
554 return "";
555 }
556
557 /** (Required) A collection of flags defining various characteristics of the fon t 545 /** (Required) A collection of flags defining various characteristics of the fon t
558 * (see Section 5.7.1, "Font Descriptor Flags"). 546 * (see Section 5.7.1, "Font Descriptor Flags").
559 **/ 547 **/
560 bool has_Flags() const { 548 bool has_Flags() const {
561 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Flags ", "", NULL)); 549 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Flags ", "", NULL));
562 } 550 }
563 551
564 long Flags() const { 552 long Flags() const;
565 long ret;
566 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Flags", "", &ret)) return ret;
567 // TODO(edisonn): warn about missing required field, assert for known good p dfs
568 return 0;
569 }
570
571 /** (Required) A rectangle (see Section 3.8.3, "Rectangles"), expressed in the 553 /** (Required) A rectangle (see Section 3.8.3, "Rectangles"), expressed in the
572 * glyph coordinate system, specifying the font bounding box. This is the small - 554 * glyph coordinate system, specifying the font bounding box. This is the small -
573 * est rectangle enclosing the shape that would result if all of the glyphs of the 555 * est rectangle enclosing the shape that would result if all of the glyphs of the
574 * font were placed with their origins coincident and then filled. 556 * font were placed with their origins coincident and then filled.
575 **/ 557 **/
576 bool has_FontBBox() const { 558 bool has_FontBBox() const {
577 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontB Box", "", NULL)); 559 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontB Box", "", NULL));
578 } 560 }
579 561
580 SkRect* FontBBox() const { 562 SkRect* FontBBox() const;
581 SkRect* ret;
582 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontBBox" , "", &ret)) return ret;
583 // TODO(edisonn): warn about missing required field, assert for known good p dfs
584 return NULL;
585 }
586
587 /** (Required) The angle, expressed in degrees counterclockwise from the verti- 563 /** (Required) The angle, expressed in degrees counterclockwise from the verti-
588 * cal, of the dominant vertical strokes of the font. (For example, the 9-o'clo ck 564 * cal, of the dominant vertical strokes of the font. (For example, the 9-o'clo ck
589 * position is 90 degrees, and the 3-o'clock position is '90 degrees.) The valu e is 565 * position is 90 degrees, and the 3-o'clock position is '90 degrees.) The valu e is
590 * negative for fonts that slope to the right, as almost all italic fonts do. 566 * negative for fonts that slope to the right, as almost all italic fonts do.
591 **/ 567 **/
592 bool has_ItalicAngle() const { 568 bool has_ItalicAngle() const {
593 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Itali cAngle", "", NULL)); 569 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Itali cAngle", "", NULL));
594 } 570 }
595 571
596 double ItalicAngle() const { 572 double ItalicAngle() const;
597 double ret;
598 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ItalicAng le", "", &ret)) return ret;
599 // TODO(edisonn): warn about missing required field, assert for known good p dfs
600 return 0;
601 }
602
603 /** (Required) The maximum height above the baseline reached by glyphs in this 573 /** (Required) The maximum height above the baseline reached by glyphs in this
604 * font, excluding the height of glyphs for accented characters. 574 * font, excluding the height of glyphs for accented characters.
605 **/ 575 **/
606 bool has_Ascent() const { 576 bool has_Ascent() const {
607 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Ascen t", "", NULL)); 577 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Ascen t", "", NULL));
608 } 578 }
609 579
610 double Ascent() const { 580 double Ascent() const;
611 double ret;
612 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Ascent", "", &ret)) return ret;
613 // TODO(edisonn): warn about missing required field, assert for known good p dfs
614 return 0;
615 }
616
617 /** (Required) The maximum depth below the baseline reached by glyphs in this 581 /** (Required) The maximum depth below the baseline reached by glyphs in this
618 * font. The value is a negative number. 582 * font. The value is a negative number.
619 **/ 583 **/
620 bool has_Descent() const { 584 bool has_Descent() const {
621 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Desce nt", "", NULL)); 585 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Desce nt", "", NULL));
622 } 586 }
623 587
624 double Descent() const { 588 double Descent() const;
625 double ret;
626 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Descent", "", &ret)) return ret;
627 // TODO(edisonn): warn about missing required field, assert for known good p dfs
628 return 0;
629 }
630
631 /** (Optional) The desired spacing between baselines of consecutive lines of tex t. 589 /** (Optional) The desired spacing between baselines of consecutive lines of tex t.
632 * Default value: 0. 590 * Default value: 0.
633 **/ 591 **/
634 bool has_Leading() const { 592 bool has_Leading() const {
635 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Leadi ng", "", NULL)); 593 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Leadi ng", "", NULL));
636 } 594 }
637 595
638 double Leading() const { 596 double Leading() const;
639 double ret;
640 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Leading", "", &ret)) return ret;
641 // TODO(edisonn): warn about missing required field, assert for known good p dfs
642 return 0;
643 }
644
645 /** (Required) The vertical coordinate of the top of flat capital letters, measu red 597 /** (Required) The vertical coordinate of the top of flat capital letters, measu red
646 * from the baseline. 598 * from the baseline.
647 **/ 599 **/
648 bool has_CapHeight() const { 600 bool has_CapHeight() const {
649 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CapHe ight", "", NULL)); 601 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CapHe ight", "", NULL));
650 } 602 }
651 603
652 double CapHeight() const { 604 double CapHeight() const;
653 double ret;
654 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CapHeight ", "", &ret)) return ret;
655 // TODO(edisonn): warn about missing required field, assert for known good p dfs
656 return 0;
657 }
658
659 /** (Optional) The font's x height: the vertical coordinate of the top of flat n on- 605 /** (Optional) The font's x height: the vertical coordinate of the top of flat n on-
660 * ascending lowercase letters (like the letter x), measured from the baseline. 606 * ascending lowercase letters (like the letter x), measured from the baseline.
661 * Default value: 0. 607 * Default value: 0.
662 **/ 608 **/
663 bool has_XHeight() const { 609 bool has_XHeight() const {
664 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "XHeig ht", "", NULL)); 610 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "XHeig ht", "", NULL));
665 } 611 }
666 612
667 double XHeight() const { 613 double XHeight() const;
668 double ret;
669 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "XHeight", "", &ret)) return ret;
670 // TODO(edisonn): warn about missing required field, assert for known good p dfs
671 return 0;
672 }
673
674 /** (Required) The thickness, measured horizontally, of the dominant vertical 614 /** (Required) The thickness, measured horizontally, of the dominant vertical
675 * stems of glyphs in the font. 615 * stems of glyphs in the font.
676 **/ 616 **/
677 bool has_StemV() const { 617 bool has_StemV() const {
678 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "StemV ", "", NULL)); 618 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "StemV ", "", NULL));
679 } 619 }
680 620
681 double StemV() const { 621 double StemV() const;
682 double ret;
683 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "StemV", " ", &ret)) return ret;
684 // TODO(edisonn): warn about missing required field, assert for known good p dfs
685 return 0;
686 }
687
688 /** (Optional) The thickness, measured invertically, of the dominant horizontal 622 /** (Optional) The thickness, measured invertically, of the dominant horizontal
689 * stems of glyphs in the font. Default value: 0. 623 * stems of glyphs in the font. Default value: 0.
690 **/ 624 **/
691 bool has_StemH() const { 625 bool has_StemH() const {
692 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "StemH ", "", NULL)); 626 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "StemH ", "", NULL));
693 } 627 }
694 628
695 double StemH() const { 629 double StemH() const;
696 double ret;
697 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "StemH", " ", &ret)) return ret;
698 // TODO(edisonn): warn about missing required field, assert for known good p dfs
699 return 0;
700 }
701
702 /** (Optional) The average width of glyphs in the font. Default value: 0. 630 /** (Optional) The average width of glyphs in the font. Default value: 0.
703 **/ 631 **/
704 bool has_AvgWidth() const { 632 bool has_AvgWidth() const {
705 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AvgWi dth", "", NULL)); 633 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AvgWi dth", "", NULL));
706 } 634 }
707 635
708 double AvgWidth() const { 636 double AvgWidth() const;
709 double ret;
710 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AvgWidth" , "", &ret)) return ret;
711 // TODO(edisonn): warn about missing required field, assert for known good p dfs
712 return 0;
713 }
714
715 /** (Optional) The maximum width of glyphs in the font. Default value: 0. 637 /** (Optional) The maximum width of glyphs in the font. Default value: 0.
716 **/ 638 **/
717 bool has_MaxWidth() const { 639 bool has_MaxWidth() const {
718 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "MaxWi dth", "", NULL)); 640 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "MaxWi dth", "", NULL));
719 } 641 }
720 642
721 double MaxWidth() const { 643 double MaxWidth() const;
722 double ret;
723 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "MaxWidth" , "", &ret)) return ret;
724 // TODO(edisonn): warn about missing required field, assert for known good p dfs
725 return 0;
726 }
727
728 /** (Optional) The width to use for character codes whose widths are not speci- 644 /** (Optional) The width to use for character codes whose widths are not speci-
729 * fied in a font dictionary's Widths array. This has a predictable effect only if all 645 * fied in a font dictionary's Widths array. This has a predictable effect only if all
730 * such codes map to glyphs whose actual widths are the same as the Missing- 646 * such codes map to glyphs whose actual widths are the same as the Missing-
731 * Width value. Default value: 0. 647 * Width value. Default value: 0.
732 **/ 648 **/
733 bool has_MissingWidth() const { 649 bool has_MissingWidth() const {
734 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Missi ngWidth", "", NULL)); 650 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Missi ngWidth", "", NULL));
735 } 651 }
736 652
737 double MissingWidth() const { 653 double MissingWidth() const;
738 double ret;
739 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "MissingWi dth", "", &ret)) return ret;
740 // TODO(edisonn): warn about missing required field, assert for known good p dfs
741 return 0;
742 }
743
744 /** (Optional) A stream containing a Type 1 font program (see Section 5.8, 654 /** (Optional) A stream containing a Type 1 font program (see Section 5.8,
745 * "Embedded Font Programs"). 655 * "Embedded Font Programs").
746 **/ 656 **/
747 bool has_FontFile() const { 657 bool has_FontFile() const {
748 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontF ile", "", NULL)); 658 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontF ile", "", NULL));
749 } 659 }
750 660
751 SkPdfStream* FontFile() const { 661 SkPdfStream* FontFile() const;
752 SkPdfStream* ret;
753 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontFile" , "", &ret)) return ret;
754 // TODO(edisonn): warn about missing required field, assert for known good p dfs
755 return NULL;
756 }
757
758 /** (Optional; PDF 1.1) A stream containing a TrueType font program (see Sec- 662 /** (Optional; PDF 1.1) A stream containing a TrueType font program (see Sec-
759 * tion 5.8, "Embedded Font Programs"). 663 * tion 5.8, "Embedded Font Programs").
760 **/ 664 **/
761 bool has_FontFile2() const { 665 bool has_FontFile2() const {
762 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontF ile2", "", NULL)); 666 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontF ile2", "", NULL));
763 } 667 }
764 668
765 SkPdfStream* FontFile2() const { 669 SkPdfStream* FontFile2() const;
766 SkPdfStream* ret;
767 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontFile2 ", "", &ret)) return ret;
768 // TODO(edisonn): warn about missing required field, assert for known good p dfs
769 return NULL;
770 }
771
772 /** (Optional; PDF 1.2) A stream containing a font program other than Type 1 or 670 /** (Optional; PDF 1.2) A stream containing a font program other than Type 1 or
773 * TrueType. The format of the font program is specified by the Subtype entry 671 * TrueType. The format of the font program is specified by the Subtype entry
774 * in the stream dictionary (see Section 5.8, "Embedded Font Programs," and 672 * in the stream dictionary (see Section 5.8, "Embedded Font Programs," and
775 * implementation note 49 in Appendix H). 673 * implementation note 49 in Appendix H).
776 * At most, only one of the FontFile, FontFile2, and FontFile3 entries may be 674 * At most, only one of the FontFile, FontFile2, and FontFile3 entries may be
777 * present. 675 * present.
778 **/ 676 **/
779 bool has_FontFile3() const { 677 bool has_FontFile3() const {
780 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontF ile3", "", NULL)); 678 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontF ile3", "", NULL));
781 } 679 }
782 680
783 SkPdfStream* FontFile3() const { 681 SkPdfStream* FontFile3() const;
784 SkPdfStream* ret;
785 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontFile3 ", "", &ret)) return ret;
786 // TODO(edisonn): warn about missing required field, assert for known good p dfs
787 return NULL;
788 }
789
790 /** (Optional; meaningful only in Type 1 fonts; PDF 1.1) A string listing the ch ar- 682 /** (Optional; meaningful only in Type 1 fonts; PDF 1.1) A string listing the ch ar-
791 * acter names defined in a font subset. The names in this string must be in PD F 683 * acter names defined in a font subset. The names in this string must be in PD F
792 * syntax-that is, each name preceded by a slash (/). The names can appear in 684 * syntax-that is, each name preceded by a slash (/). The names can appear in
793 * any order. The name .notdef should be omitted; it is assumed to exist in the 685 * any order. The name .notdef should be omitted; it is assumed to exist in the
794 * font subset. If this entry is absent, the only indication of a font subset i s the 686 * font subset. If this entry is absent, the only indication of a font subset i s the
795 * subset tag in the FontName entry (see Section 5.5.3, "Font Subsets"). 687 * subset tag in the FontName entry (see Section 5.5.3, "Font Subsets").
796 **/ 688 **/
797 bool has_CharSet() const { 689 bool has_CharSet() const {
798 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CharS et", "", NULL)); 690 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CharS et", "", NULL));
799 } 691 }
800 692
801 std::string CharSet() const { 693 std::string CharSet() const;
802 std::string ret;
803 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CharSet", "", &ret)) return ret;
804 // TODO(edisonn): warn about missing required field, assert for known good p dfs
805 return "";
806 }
807
808 }; 694 };
809 695
810 #endif // __DEFINED__SkPdfFontDescriptorDictionary 696 #endif // __DEFINED__SkPdfFontDescriptorDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698