📄 cffspec.htm
字号:
<TH BGCOLOR="#C0C0C0">Type</TH><TH BGCOLOR="#C0C0C0">Name</TH><TH BGCOLOR="#C0C0C0">Description
</THEAD><TBODY></TR>
<TR>
<TD VALIGN=TOP>Card8</TD><TD VALIGN=TOP>nCodes</TD><TD VALIGN=TOP>Number of encoded glyphs</TD></TR>
<TR>
<TD VALIGN=TOP>Card8</TD><TD VALIGN=TOP>code[nCodes]</TD><TD VALIGN=TOP>Code array</TABLE>
<P>Each element of the code array represents the encoding for the corresponding
glyph. This format should be used when the codes are in a fairly random order.
<H3>Format 1</H3><BR>
<TABLE BGCOLOR="#F0F0F0" width=480 CELLPADDING=3>
<THEAD>
<TR>
<TH BGCOLOR="#C0C0C0">Type</TH><TH BGCOLOR="#C0C0C0">Name</TH><TH BGCOLOR="#C0C0C0">Description
</THEAD><TBODY></TR>
<TR>
<TD VALIGN=TOP>Card8</TD><TD VALIGN=TOP>nRanges</TD><TD VALIGN=TOP>Number of code ranges</TD></TR>
<TR>
<TD VALIGN=TOP>struct</TD><TD VALIGN=TOP>Range1[nRanges]</TD><TD VALIGN=TOP>Range1 array (see below)</TABLE>
<P>A Range1 has the following format.<BR>
<TABLE BGCOLOR="#F0F0F0" width=480 CELLPADDING=3>
<THEAD>
<TR>
<TH BGCOLOR="#C0C0C0">Type</TH><TH BGCOLOR="#C0C0C0">Name</TH><TH BGCOLOR="#C0C0C0">Description
</THEAD><TBODY></TR>
<TR>
<TD VALIGN=TOP>Card8</TD><TD VALIGN=TOP>first</TD><TD VALIGN=TOP>First code in range</TD></TR>
<TR>
<TD VALIGN=TOP>Card8</TD><TD VALIGN=TOP>nLeft</TD><TD VALIGN=TOP>Codes left in range (excluding first)</TABLE>
<P>Each Range1 describes a group of sequential codes. For example, the codes
51 52 53 54 55 could be represented by the Range1: 51 4, and a perfectly
ordered encoding of 256 codes can be described with the Range1: 0 255.
<P>This format is particularly suited to encodings that are well ordered.
<P>A few fonts have multiply encoded glyphs which are not supported directly by
any of the above formats. This situation is indicated by setting the high-order
bit in the format byte and supplementing the encoding, regardless of format
type, with the following data<BR>
<TABLE BGCOLOR="#F0F0F0" width=480 CELLPADDING=3>
<THEAD>
<TR>
<TH BGCOLOR="#C0C0C0">Type</TH><TH BGCOLOR="#C0C0C0">Name</TH><TH BGCOLOR="#C0C0C0">Description
</THEAD><TBODY></TR>
<TR>
<TD VALIGN=TOP>Card8</TD><TD VALIGN=TOP>nSups</TD><TD VALIGN=TOP>Number of supplementary mappings</TD></TR>
<TR>
<TD VALIGN=TOP>struct</TD><TD VALIGN=TOP>Supplement[nSups]</TD><TD VALIGN=TOP>Supplementary encoding array (see below)</TABLE>
<P>A Supplement has the following format.<BR>
<TABLE BGCOLOR="#F0F0F0" width=480 CELLPADDING=3>
<THEAD>
<TR>
<TH BGCOLOR="#C0C0C0">Type</TH><TH BGCOLOR="#C0C0C0">Name</TH><TH BGCOLOR="#C0C0C0">Description
</THEAD><TBODY></TR>
<TR>
<TD VALIGN=TOP>Card8</TD><TD VALIGN=TOP>code</TD><TD VALIGN=TOP>Encoding</TD></TR>
<TR>
<TD VALIGN=TOP>SID</TD><TD VALIGN=TOP>glyph</TD><TD VALIGN=TOP>Name</TABLE>
<P>Each Supplement describes a single code->glyph mapping which provides another
encoding for a glyph that has already been mentioned in the main encoding
table.
<P>Sorting glyphs by encoding and then SID for unencoded glyphs (remembering that
.notdef must be first) typically yields very small font encodings. Still more
optimization is possible by observing that many fonts adopt one of two common
encodings. In these cases the operand to the Encoding operator in the Top DICT
specifies a predefined encoding id, thus<BR>
<TABLE BGCOLOR="#F0F0F0" width=480 CELLPADDING=3>
<THEAD>
<TR>
<TH BGCOLOR="#C0C0C0">Id</TH><TH BGCOLOR="#C0C0C0">Name
</THEAD><TBODY></TR>
<TR>
<TD VALIGN=TOP>0</TD><TD VALIGN=TOP>Standard Encoding</TD></TR>
<TR>
<TD VALIGN=TOP>1</TD><TD VALIGN=TOP>Expert Encoding</TABLE>
<P>If the font uses Standard Encoding the Encoding operator can be omitted from
the Top DICT since its default value is 0. Details of predefined encodings can
be found in appendix B.
<P>It isn't necessary for a font to contain all the glyphs specified by a
predefined encoding in order to be able to use it. The only requirement is
that every glyph in the font has an identical encoding to those in the
predefined encoding (including unencoded glyphs).
<P>Two or more fonts may share the same encoding by setting the offset operand of
the Encoding operator to the same value in each font.
<H2>13. Charsets</H2>
<P>Charset data is located via the offset operand to the charset operator in the
Top DICT. Each charset is described by a format-type identifier byte followed
by format-specific data. Three formats are currently defined.
<H3>Format 0</H3><BR>
<TABLE BGCOLOR="#F0F0F0" width=480 CELLPADDING=3>
<THEAD>
<TR>
<TH BGCOLOR="#C0C0C0">Type</TH><TH BGCOLOR="#C0C0C0">Name</TH><TH BGCOLOR="#C0C0C0">Description
</THEAD><TBODY></TR>
<TR>
<TD VALIGN=TOP>SID</TD><TD VALIGN=TOP>glyph[nGlyphs-1]</TD><TD VALIGN=TOP>Glyph name array</TABLE>
<P>Each element of the glyph array represents the name of the corresponding
glyph. This format should be used when the SIDs or are in a fairly random
order. The number of glyphs (nGlyphs) is the value of the count field in the
CharStrings INDEX. (There is one less element in the glyph name array than
nGlyphs because the .notdef glyph name is omitted.)
<H3>Format 1</H3><BR>
<TABLE BGCOLOR="#F0F0F0" width=480 CELLPADDING=3>
<THEAD>
<TR>
<TH BGCOLOR="#C0C0C0">Type</TH><TH BGCOLOR="#C0C0C0">Name</TH><TH BGCOLOR="#C0C0C0">Description
</THEAD><TBODY></TR>
<TR>
<TD VALIGN=TOP>struct</TD><TD VALIGN=TOP>Range1[<varies>]</TD><TD VALIGN=TOP>Range1 array (see below)</TABLE>
<P>A Range1 has the following format.<BR>
<TABLE BGCOLOR="#F0F0F0" width=480 CELLPADDING=3>
<THEAD>
<TR>
<TH BGCOLOR="#C0C0C0">Type</TH><TH BGCOLOR="#C0C0C0">Name</TH><TH BGCOLOR="#C0C0C0">Description
</THEAD><TBODY></TR>
<TR>
<TD VALIGN=TOP>SID</TD><TD VALIGN=TOP>first</TD><TD VALIGN=TOP>First glyph in range</TD></TR>
<TR>
<TD VALIGN=TOP>Card8</TD><TD VALIGN=TOP>nLeft</TD><TD VALIGN=TOP>Glyphs left in range (excluding first)</TABLE>
<P>Each Range1 describes a group of sequential SIDs. The number of ranges is not
explicitly specified in the font. Instead, software utilizing this data simply
processes ranges until all glyphs in the font are covered. This format is
particularly suited to charsets that are well ordered.
<H3>Format 2</H3><BR>
<TABLE BGCOLOR="#F0F0F0" width=480 CELLPADDING=3>
<THEAD>
<TR>
<TH BGCOLOR="#C0C0C0">Type</TH><TH BGCOLOR="#C0C0C0">Name</TH><TH BGCOLOR="#C0C0C0">Description
</THEAD><TBODY></TR>
<TR>
<TD VALIGN=TOP>struct</TD><TD VALIGN=TOP>Range2[<varies>]</TD><TD VALIGN=TOP>Range2 array (see below)</TABLE>
<P>A Range2 has the following format.<BR>
<TABLE BGCOLOR="#F0F0F0" width=480 CELLPADDING=3>
<THEAD>
<TR>
<TH BGCOLOR="#C0C0C0">Type</TH><TH BGCOLOR="#C0C0C0">Name</TH><TH BGCOLOR="#C0C0C0">Description
</THEAD><TBODY></TR>
<TR>
<TD VALIGN=TOP>SID</TD><TD VALIGN=TOP>first</TD><TD VALIGN=TOP>First glyph in range</TD></TR>
<TR>
<TD VALIGN=TOP>Card16</TD><TD VALIGN=TOP>nLeft</TD><TD VALIGN=TOP>Glyphs left in range (excluding first)</TABLE>
<P>Format 2 differs from format 1 only in the size of the nLeft field in each
range. This format is most suitable for fonts with a large well-ordered
charset, Asian CIDFonts, for example.
<P>Careful attention to the allocation order of SIDs typically yields very small
font charsets. Still more optimization is possible by observing that many fonts
adopt one of 3 common charsets. In these cases the operand to the charset
operator in the Top DICT specifies a predefined charset id, thus<BR>
<TABLE BGCOLOR="#F0F0F0" width=480 CELLPADDING=3>
<THEAD>
<TR>
<TH BGCOLOR="#C0C0C0">Id</TH><TH BGCOLOR="#C0C0C0">Name
</THEAD><TBODY></TR>
<TR>
<TD VALIGN=TOP>0</TD><TD VALIGN=TOP>ISOAdobe</TD></TR>
<TR>
<TD VALIGN=TOP>1</TD><TD VALIGN=TOP>Expert</TD></TR>
<TR>
<TD VALIGN=TOP>2</TD><TD VALIGN=TOP>ExpertSubset</TABLE>
<P>If the font has an ISOAdobe charset, the charset operator can be omitted from
the Top DICT since its default value is 0. Details of predefined charsets can
be found in appendix C. A font may use a predefined encoding if it exactly
matches in the first nGlyphs.
<P>Two or more fonts may share the same charset by setting the offset operand of
the charset operator to the same value in each font.
<H2>14. CharStrings INDEX</H2>
<P>This contains the charstrings of all the glyphs in a font stored in an
INDEX structure. Charstring objects contained within this INDEX are accessed
by GID. The first charstring (GID 0) must be the .notdef glyph. The number of
glyphs available in a font may be determined from the count field in the INDEX.
<P>The format of the charstring data, and therefore the method of interpretation,
is specified by the CharstringType operator in the Top DICT. The CharstringType
operator has default value of 2 indicating a new format designed in conjunction
with CFF. Type 1 charstrings are documented in the "Adobe Type 1 Font Format"
published by Addison-Wesley. Type 2 charstrings will be described in a
forthcoming document. Other CharstringTypes may also be supported by this
method.
<H2>15. Private DICT Data</H2>
<P>The names of the Private DICT operators shown below are, where possible, the
same as the corresponding PostScript dict key. Operators that have no
corresponding PostScript dict key are noted in the table below.<BR>
<TABLE BGCOLOR="#F0F0F0" width=480 CELLPADDING=3>
<THEAD>
<TR>
<TH BGCOLOR="#C0C0C0">Name</TH><TH BGCOLOR="#C0C0C0">Value</TH><TH BGCOLOR="#C0C0C0">Operand(s)</TH><TH BGCOLOR="#C0C0C0">Default,notes
</THEAD><TBODY></TR>
<TR>
<TD VALIGN=TOP>BlueValues</TD><TD VALIGN=TOP>6</TD><TD VALIGN=TOP>delta</TD><TD VALIGN=TOP>-</TD></TR>
<TR>
<TD VALIGN=TOP>OtherBlues</TD><TD VALIGN=TOP>7</TD><TD VALIGN=TOP>delta</TD><TD VALIGN=TOP>-</TD></TR>
<TR>
<TD VALIGN=TOP>FamilyBlues</TD><TD VALIGN=TOP>8</TD><TD VALIGN=TOP>delta</TD><TD VALIGN=TOP>-</TD></TR>
<TR>
<TD VALIGN=TOP>FamilyOtherBlues</TD><TD VALIGN=TOP>9</TD><TD VALIGN=TOP>delta</TD><TD VALIGN=TOP>-</TD></TR>
<TR>
<TD VALIGN=TOP>BlueScale</TD><TD VALIGN=TOP>12 9</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>0.039625</TD></TR>
<TR>
<TD VALIGN=TOP>BlueShift</TD><TD VALIGN=TOP>12 10</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>7</TD></TR>
<TR>
<TD VALIGN=TOP>BlueFuzz</TD><TD VALIGN=TOP>12 11</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>1</TD></TR>
<TR>
<TD VALIGN=TOP>StdHW</TD><TD VALIGN=TOP>10</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>-</TD></TR>
<TR>
<TD VALIGN=TOP>StdVW</TD><TD VALIGN=TOP>11</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>-</TD></TR>
<TR>
<TD VALIGN=TOP>StemSnapH</TD><TD VALIGN=TOP>12 12</TD><TD VALIGN=TOP>delta</TD><TD VALIGN=TOP>-</TD></TR>
<TR>
<TD VALIGN=TOP>StemSnapV</TD><TD VALIGN=TOP>12 13</TD><TD VALIGN=TOP>delta</TD><TD VALIGN=TOP>-</TD></TR>
<TR>
<TD VALIGN=TOP>ForceBold</TD><TD VALIGN=TOP>12 14</TD><TD VALIGN=TOP>boolean</TD><TD VALIGN=TOP>false</TD></TR>
<TR>
<TD VALIGN=TOP>ForceBoldThreshold</TD><TD VALIGN=TOP>12 15</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>0</TD></TR>
<TR>
<TD VALIGN=TOP>lenIV</TD><TD VALIGN=TOP>12 16</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>-1</TD></TR>
<TR>
<TD VALIGN=TOP>LanguageGroup</TD><TD VALIGN=TOP>12 17</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>0</TD></TR>
<TR>
<TD VALIGN=TOP>ExpansionFactor</TD><TD VALIGN=TOP>12 18</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>0.06</TD></TR>
<TR>
<TD VALIGN=TOP>initialRandomSeed</TD><TD VALIGN=TOP>12 19</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>0</TD></TR>
<TR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -