| 1 |
/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. |
| 2 |
This software is licensed as OpenSource, under the Apache License, Version 2.0. |
| 3 |
This license is available at: http://opensource.org/licenses/Apache-2.0. */ |
| 4 |
|
| 5 |
#ifndef PUBLIC_DICTOPS_H |
| 6 |
#define PUBLIC_DICTOPS_H |
| 7 |
|
| 8 |
/* |
| 9 |
* CFF dictionary operator definitions. |
| 10 |
* |
| 11 |
* There are several kinds of fonts that are supported by CFF that have |
| 12 |
* different dict organizations: |
| 13 |
* |
| 14 |
* Top Private FDs PDs |
| 15 |
* --- ------- --- --- |
| 16 |
* name-keyed x x |
| 17 |
* synthetic x |
| 18 |
* CID-keyed x x x |
| 19 |
* chameleon x |
| 20 |
* |
| 21 |
* The Top dict, so named because of its position in the dictionary hierarchy, |
| 22 |
* is also known as the Font dict in all but CID-keyed fonts. CID-keyed fonts |
| 23 |
* contain an array called FDArray in their top dict called FDArray whose |
| 24 |
* elements are font dicts (FDs) which each contain a Private sub-dictionary |
| 25 |
* (PD). Synthetic fonts just have a Top dict containing a reference to another |
| 26 |
* font. |
| 27 |
* |
| 28 |
* This file defines the dict operators that can appear in these dicts. In |
| 29 |
* order to aid font recognition and parsing, the following restrictions are |
| 30 |
* imposed upon dict op ordering: |
| 31 |
* |
| 32 |
* Synthetic/top: Must begin with cff_SyntheticBase. |
| 33 |
* CID/top: Must begin with cff_ROS. |
| 34 |
* Chameleon/top: Must begin with cff_Chameleon. |
| 35 |
* Private/PD: cff_OtherBlues must follow cff_BlueValues and |
| 36 |
* cff_FamilyOtherBlues must follow cff_FamilyBlues. |
| 37 |
* |
| 38 |
* If the top dict doesn't begin with one of the operators listed above it is |
| 39 |
* assumed to define a name-keyed font. Chameleon fonts don't define a Private |
| 40 |
* dict but instead use the Private operator to specify the size and offset of |
| 41 |
* the Chameleon font descriptor for the font. |
| 42 |
* |
| 43 |
* Comments indicate in which dicts an op may appear along with a default |
| 44 |
* value, if any, within parentheses. |
| 45 |
*/ |
| 46 |
|
| 47 |
/* One byte operators (0-31) */ |
| 48 |
#define cff_version 0 /* Top/FD */ |
| 49 |
#define cff_Notice 1 /* Top/FD */ |
| 50 |
#define cff_FullName 2 /* Top/FD */ |
| 51 |
#define cff_FamilyName 3 /* Top/FD */ |
| 52 |
#define cff_Weight 4 /* Top/FD */ |
| 53 |
#define cff_FontBBox 5 /* Top/FD */ |
| 54 |
#define cff_BlueValues 6 /* Private/PD (empty array) */ |
| 55 |
#define cff_OtherBlues 7 /* Private/PD */ |
| 56 |
#define cff_FamilyBlues 8 /* Private/PD */ |
| 57 |
#define cff_FamilyOtherBlues 9 /* Private/PD */ |
| 58 |
#define cff_StdHW 10 /* Private/PD */ |
| 59 |
#define cff_StdVW 11 /* Private/PD */ |
| 60 |
#define cff_escape 12 /* All. Shared with T2 op */ |
| 61 |
#define cff_UniqueID 13 /* Top/FD */ |
| 62 |
#define cff_XUID 14 /* Top/FD */ |
| 63 |
#define cff_charset 15 /* Top/FD (0) */ |
| 64 |
#define cff_Encoding 16 /* Top/FD (0) */ |
| 65 |
#define cff_CharStrings 17 /* Top/FD */ |
| 66 |
#define cff_Private 18 /* Top/FD */ |
| 67 |
#define cff_Subrs 19 /* Private/PD */ |
| 68 |
#define cff_defaultWidthX 20 /* Private/PD (0) */ |
| 69 |
#define cff_nominalWidthX 21 /* Private/PD (0) */ |
| 70 |
#define cff_vsindex 22 |
| 71 |
#define cff_blend 23 |
| 72 |
#define cff_VarStore 24 |
| 73 |
#define cff_maxstack 25 |
| 74 |
#define cff_reserved26 26 |
| 75 |
#define cff_reserved27 27 |
| 76 |
#define cff_shortint 28 /* All. Shared with T2 ops */ |
| 77 |
#define cff_longint 29 /* All */ |
| 78 |
#define cff_BCD 30 /* All */ |
| 79 |
#define cff_BlendLE 31 |
| 80 |
#define cff_reserved255 255 |
| 81 |
#define cff_LAST_ONE_BYTE_OP cff_BlendLE |
| 82 |
|
| 83 |
/* Make escape operator value; may be redefined to suit implementation */ |
| 84 |
#ifndef cff_ESC |
| 85 |
#define cff_ESC(op) (cff_escape << 8 | (op)) |
| 86 |
#endif |
| 87 |
|
| 88 |
/* Two byte operators */ |
| 89 |
#define cff_Copyright cff_ESC(0) /* Top/FD */ |
| 90 |
#define cff_isFixedPitch cff_ESC(1) /* Top/FD (false) */ |
| 91 |
#define cff_ItalicAngle cff_ESC(2) /* Top/FD (0) */ |
| 92 |
#define cff_UnderlinePosition cff_ESC(3) /* Top/FD (-100) */ |
| 93 |
#define cff_UnderlineThickness cff_ESC(4) /* Top/FD (50) */ |
| 94 |
#define cff_PaintType cff_ESC(5) /* Top/FD (0) */ |
| 95 |
#define cff_CharstringType cff_ESC(6) /* Top/FD (2) */ |
| 96 |
#define cff_FontMatrix cff_ESC(7) /* Top/FD (.001 0 0 .001 0 0)*/ |
| 97 |
#define cff_StrokeWidth cff_ESC(8) /* Top/FD (0) */ |
| 98 |
#define cff_BlueScale cff_ESC(9) /* Private/PD (0.039625) */ |
| 99 |
#define cff_BlueShift cff_ESC(10) /* Private/PD (7) */ |
| 100 |
#define cff_BlueFuzz cff_ESC(11) /* Private/PD (1) */ |
| 101 |
#define cff_StemSnapH cff_ESC(12) /* Private/PD */ |
| 102 |
#define cff_StemSnapV cff_ESC(13) /* Private/PD */ |
| 103 |
#define cff_ForceBold cff_ESC(14) /* Private/PD (false) */ |
| 104 |
#define cff_reservedESC15 cff_ESC(15) |
| 105 |
#define cff_reservedESC16 cff_ESC(16) /* Was lenIV (don't reuse) */ |
| 106 |
#define cff_LanguageGroup cff_ESC(17) /* Private/PD */ |
| 107 |
#define cff_ExpansionFactor cff_ESC(18) /* Private/PD (0.06) */ |
| 108 |
#define cff_initialRandomSeed cff_ESC(19) /* Private/PD (0) */ |
| 109 |
#define cff_SyntheticBase cff_ESC(20) /* Top/FD */ |
| 110 |
#define cff_PostScript cff_ESC(21) /* Private/PD */ |
| 111 |
#define cff_BaseFontName cff_ESC(22) /* Top/FD */ |
| 112 |
#define cff_BaseFontBlend cff_ESC(23) /* Top/FD (instance UDV) */ |
| 113 |
#define cff_numMasters cff_ESC(24) |
| 114 |
#define cff_reservedESC25 cff_ESC(25) |
| 115 |
#define cff_reservedESC26 cff_ESC(26) |
| 116 |
#define cff_reservedESC27 cff_ESC(27) |
| 117 |
#define cff_reservedESC28 cff_ESC(28) |
| 118 |
#define cff_reservedESC29 cff_ESC(29) |
| 119 |
#define cff_ROS cff_ESC(30) /* Top */ |
| 120 |
#define cff_CIDFontVersion cff_ESC(31) /* Top (0) */ |
| 121 |
#define cff_CIDFontRevision cff_ESC(32) /* Top (0) */ |
| 122 |
#define cff_CIDFontType cff_ESC(33) /* Top (0) */ |
| 123 |
#define cff_CIDCount cff_ESC(34) /* Top (8720) */ |
| 124 |
#define cff_UIDBase cff_ESC(35) /* Top */ |
| 125 |
#define cff_FDArray cff_ESC(36) /* Top */ |
| 126 |
#define cff_FDSelect cff_ESC(37) /* Top */ |
| 127 |
#define cff_FontName cff_ESC(38) /* FD (CID-only) */ |
| 128 |
#define cff_Chameleon cff_ESC(39) /* Top */ |
| 129 |
#define cff_reservedESC40 cff_ESC(40) /* Was VToHOrigin (don't reuse) */ |
| 130 |
#define cff_reservedESC41 cff_ESC(41) /* Was defaultWidthY (don't reuse) */ |
| 131 |
#define cff_LAST_TWO_BYTE_OP cff_reservedESC41 |
| 132 |
/* 42-255 Reserved */ |
| 133 |
|
| 134 |
/* Default operator values */ |
| 135 |
#define cff_DFLT_isFixedPitch 0 /* False */ |
| 136 |
#define cff_DFLT_ItalicAngle 0 |
| 137 |
#define cff_DFLT_UnderlinePosition -100 |
| 138 |
#define cff_DFLT_UnderlineThickness 50 |
| 139 |
#define cff_DFLT_PaintType 0 |
| 140 |
#define cff_DFLT_CharstringType 2 |
| 141 |
#define cff_DFLT_StrokeWidth 0 |
| 142 |
|
| 143 |
#define cff_DFLT_CIDFontVersion 0.0 |
| 144 |
#define cff_DFLT_CIDFontRevision 0 |
| 145 |
#define cff_DFLT_CIDCount 8720 |
| 146 |
|
| 147 |
#define cff_DFLT_BlueScale 0.039625 |
| 148 |
#define cff_DFLT_BlueShift 7 |
| 149 |
#define cff_DFLT_BlueFuzz 1 |
| 150 |
#define cff_DFLT_ForceBold 0 /* False */ |
| 151 |
#define cff_DFLT_LanguageGroup 0 |
| 152 |
#define cff_DFLT_ExpansionFactor 0.06 |
| 153 |
#define cff_DFLT_initialRandomSeed 0 |
| 154 |
#define cff_DFLT_defaultWidthX 0 |
| 155 |
#define cff_DFLT_nominalWidthX 0 |
| 156 |
|
| 157 |
/* Predefined charsets (cff_charset operands) */ |
| 158 |
enum |
| 159 |
{ |
| 160 |
cff_ISOAdobeCharset, |
| 161 |
cff_ExpertCharset, |
| 162 |
cff_ExpertSubsetCharset, |
| 163 |
cff_PredefCharsetCount, |
| 164 |
cff_CharSetfromPost, |
| 165 |
}; |
| 166 |
|
| 167 |
/* Predefined encodings (cff_Encoding operands) */ |
| 168 |
enum |
| 169 |
{ |
| 170 |
cff_StandardEncoding, |
| 171 |
cff_ExpertEncoding, |
| 172 |
cff_PredefEncodingCount |
| 173 |
}; |
| 174 |
|
| 175 |
#endif /* PUBLIC_DICTOPS_H */ |