⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cffspec.htm

📁 TrueType字库标准文档
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<TD VALIGN=TOP>Subrs</TD><TD VALIGN=TOP>19</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>-, Offset (self) to local subrs</TD></TR>
<TR>
<TD VALIGN=TOP>defaultWidthX</TD><TD VALIGN=TOP>20</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>0, see below</TD></TR>
<TR>
<TD VALIGN=TOP>nominalWidthX</TD><TD VALIGN=TOP>21</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>0, see below</TABLE>

<P>The local subrs offset is relative to the beginning of the Private DICT data.

<P>The defaultWidthX and nominalWidthX operators supply width values for glyphs.
If a glyph width equals the defaultWidthX value it can be omitted from the
charstring otherwise the the glyph width is computed by adding the charstring
width to nominalWidthX value. If nominalWidthX is carefully chosen the bulk of
the widths in the charstrings can be reduced from 2-byte to single-byte numbers
thereby saving space.

<P>The OtherBlues and FamilyOtherBlues operators must occur after the BlueValues
and FamilyBlues operators, respectively.

<P>Multiple master fonts require the following extensions to the Private DICT
operator set.<BR>&nbsp;
<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>NDV</TD><TD VALIGN=TOP>12 27</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>65535</TD></TR>
<TR>
<TD VALIGN=TOP>CDV</TD><TD VALIGN=TOP>12 28</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>65535</TD></TR>
<TR>
<TD VALIGN=TOP>lenBuildCharArray</TD><TD VALIGN=TOP>12 29</TD><TD VALIGN=TOP>number</TD><TD VALIGN=TOP>32</TABLE>

<P>The NDV and CDV operators specify the local subrs that contains the "Normalize
Design Vector" and "Convert Design Vector" subroutines, respectively. A default
value of 65535 indicates the corresponding subr is not present in the font. The
lenBuildCharArray specifies the size of the array used by these subrs.

<H2>16. Local/Global Subrs INDEXes</H2>

<P>Both Type 1 and Type 2 charstrings support the notion of subroutines or subrs.
A subr is typically a sequence of charstring bytes representing a sub-program
that occurs in more than one place in a font's charstring data. This subr may
be stored once but referenced many times from within one or more charstrings by
the use of the "callsubr" operator whose operand is the number of the subr to
be called. The subrs are local to a particular font and cannot be shared
between fonts. Type 2 charstrings also permit global subrs which function in
the same way but are called by the "callgsubr" operator and may be shared
across fonts.

<P>Local subrs are stored in an INDEX structure which is located via the offset
operand of the Subrs operator in the Private DICT. A font without local subrs
has no Subrs operator in the Private DICT.

<P>Global subrs are stored in an INDEX structure which follows the String INDEX. A
FontSet without any global subrs is represented by an empty Global Subrs INDEX.

<P>Subr numbers in Type 2 charstrings are skewed by a number called the "subr
number bias" which is calculated from the count of the subroutines in either
the local or Global Subr INDEXes. The bias is calculated as follows:

<PRE>
Card16 bias;
Card16 nSubrs = subrINDEX.count;

if (CharstringType == 1)
    bias = 0;
else if (nSubrs &lt;1239)
    bias = 107;
else if (nSubrs &lt;33899)
    bias = 1131;
else
    bias = 32768;
</PRE>

<P>For correct subr selection the calculated bias must be added to the subr
number operand before accessing the appropriate subr INDEX. This technique
allows subr numbers to be specified using negative as well as positive numbers
thereby fully utilizing the available number ranges and thus saving space. (The
above calculation obviates the need for an explicit bias to be stored in the
font which is currently the case for PostScript fonts.)

<H2>17. PostScript File Structure</H2>

<P>CFF data is enclosed in a wrapper and treated as a file when used by a
PostScript interpreter. The wrapper allows the file to be directly executed by
PostScript, specially handled by fontrun, and permits insertion or removal by a
DSC-aware driver. A well-formatted FontSet file has the following structure.

<PRE>
%!PS-Adobe-3.0 Resource-FontSet
% &lt;4-binary-bytes&gt;
%%DocumentNeededResources: ProcSet (FontSetInit)
%%IncludeResource: ProcSet (FontSetInit)
%%BeginResource: FontSet (&lt;fontsetname&gt;)
%%Version: &lt;realversion&gt; [&lt;intrevision&gt;]
/FontSetInit /ProcSet findresource begin
%%BeginData &lt;m&gt; Binary Bytes
/&lt;fontsetname&gt; &lt;n&gt; StartData&lt;space&gt;&lt;n-binary-data-bytes&gt;
%%EndData
%%EndResource
%%EOF
</PRE>
    
<P>The initial 4 binary bytes have codes 128 or greater and encourage file
transfer programs to transfer the file in binary, rather than text, mode. This
is the scheme used in PDF 1.1. The recommended content is 0xc3, 0xcc, 0xd5,
0xc5.

<P>A single space (0x20) follows the StartData procedure call which is followed
immediately by &lt;n&gt; binary data bytes. Note that the %%EndData DSC comment must
be proceeded by a newline character (that is not part of the binary data) so
that it is correctly parsed. The count &lt;m&gt; in the %%BeginData DSC is greater
than that used by the StartData procedure call by the number of characters in
the call itself.

<P>All the (0) offsets in the &lt;binary data&gt; are relative to the start of the
&lt;binary data&gt;. That is, the byte following the space that terminates StartData
is numbered zero.

<H2>18. Copyright and Trademark Notices</H2>

<P>In order to satisfy legal obligations, a FontSet should include copyright and
trademark notices that relate to the specific fonts in the FontSet. It is not
required that this information be made available at a PostScript level and
therefore it is sufficient to collect all the legal information together and
append it the the FontSet data as an ASCII string. (Although it is also
possible to retain full copyright and notice text via the Copyright and Notice
operators in the Top DICT.)

<P>Wording for the core 13 fonts for printer ROM use might be as follows:

<P>Copyright 1985, 1987, 1989-91 Adobe Systems Incorporated. All rights reserved.
Times and Helvetica are trademarks of Linotype AG and/or its subsidiaries. 

<H2>19. Synthetic Fonts</H2>

<P>A synthetic font is a modification of another font by means of a different
transformation matrix. Obliqued, expanded, and condensed fonts are examples of
fonts that may be constructed as synthetic fonts.

<P>Synthetic fonts have a name and a Top DICT that refers to a base font. The
Top DICT contains the following operators<BR>&nbsp;

<TABLE BGCOLOR="#F0F0F0" width=480  CELLPADDING=3>
<THEAD>
<TR>
<TH BGCOLOR="#C0C0C0">Name</TH><TH BGCOLOR="#C0C0C0">Optional
</THEAD><TBODY></TR>
<TR>
<TD VALIGN=TOP>FullName</TD><TD VALIGN=TOP>yes</TD></TR>
<TR>
<TD VALIGN=TOP>ItalicAngle</TD><TD VALIGN=TOP>yes</TD></TR>
<TR>
<TD VALIGN=TOP>FontMatrix</TD><TD VALIGN=TOP>no</TD></TR>
<TR>
<TD VALIGN=TOP>SyntheticBase</TD><TD VALIGN=TOP>no</TABLE>

<P>The SyntheticBase operator specifies the index of the font that is to be used
as the base font. The FontMatrix is applied to this font in order to
algorithmically create a new font. The other operator values override those
given in the base font. The Top DICT must begin with a SyntheticBase operator.

<H2>20. Multiple Master fonts</H2>

<P>Multiple master fonts describe a range of font designs within a design space. A
particular design may be chosen by selecting a point within the design space
called an instance. An instance in the design space is specified by a User
Design Vector, an array of per-axis user design coordinates.

<P>The design space is characterized by having one or more axes (up to a maximum
of four) that vary an aspect of the design, e.g. weight.  The font designs at
critical points in the design space are specified by up to sixteen master
designs. The design at all other points in the design space is derived by
interpolating the master designs. If a multiple master font is rendered without
explicitly selecting an instance the font will be rendered at the default
instance which represents the quintessential design within the design space.

<P>Multiple master fonts differ from other kinds of fonts because they need to
support a mechanism for interpolating values at an instance in the design
space. Within charstrings this interpolation is typically performed for widths,
outlines, and hints. Within the Top and Private DICTs interpolation is
typically performed for hint zones and metrics.

<P>The interpolation mechanism is implemented using Type 2 font programs which
typically use the blend operator although a wide variety of techniques are
available by use of the registry in conjunction with conditional arithmetic.

<P>A Type 2 font program within the Top or Private DICTs is specified by a T2
operator preceding a sequence of Type 2 operand and operator bytes terminated
with an endchar operator. Interpretation of a Type 2 font program at a specific
instance will yield one or more operand values on the stack. These are then
used in conjunction with the subsequent DICT operator. The following drawing
and hinting operators are not permitted to occur in the Top or Private DICTs:

<BLOCKQUOTE>
    hstem, compose, vstem, vmoveto, rlineto, hlineto, vlineto, rrcurveto,
    hstemhm, hintmask, cntrmask, rmoveto, hmoveto, vstemhm, rcurveline,
    rlinecurve, vvcurveto, hhcurveto, vhcurveto, hvcurveto, dotsection, setwv,
    hflex, flex, hflex1, flex1, cntron
</BLOCKQUOTE>

<P>Further details may be found in the Type 2 Operator Specification.

<P>Multiple master fonts may specify custom Normalize Design Vector and Convert
Design Vector subroutines via the NDV and CDV Private DICT operators. If an
NDV isn't specified the font has no intermediate designs and all the masters
occupy positions at the corners of the design space hypercube, i.e. their axis
coordinates are either 0 or 1. In this case the masters must be ordered
according to their axis coordinates as follows<BR>&nbsp;

<TABLE BGCOLOR="#F0F0F0" width=480  CELLPADDING=3>
<COLGROUP ALIGN=RIGHT>
<COLGROUP ALIGN=CENTER><COLGROUP ALIGN=CENTER>
<COLGROUP ALIGN=CENTER><COLGROUP ALIGN=CENTER>
<THEAD>
<TR>
<TH BGCOLOR="#C0C0C0">Master</TH><TH BGCOLOR="#C0C0C0">axis1</TH><TH BGCOLOR="#C0C0C0">axis2</TH><TH BGCOLOR="#C0C0C0">axis3</TH><TH BGCOLOR="#C0C0C0">axis4
</THEAD><TBODY></TR>
<TR>
<TD VALIGN=TOP>1</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>0</TD></TR>
<TR>
<TD VALIGN=TOP>2</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>0</TD></TR>
<TR>
<TD VALIGN=TOP>3</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>0</TD></TR>
<TR>
<TD VALIGN=TOP>4</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>0</TD></TR>
<TR>
<TD VALIGN=TOP>5</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>0</TD></TR>
<TR>
<TD VALIGN=TOP>6</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>0</TD></TR>
<TR>
<TD VALIGN=TOP>7</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>0</TD></TR>
<TR>
<TD VALIGN=TOP>8</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>0</TD></TR>
<TR>
<TD VALIGN=TOP>9</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>1</TD></TR>
<TR>
<TD VALIGN=TOP>10</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>1</TD></TR>
<TR>
<TD VALIGN=TOP>11</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>1</TD></TR>
<TR>
<TD VALIGN=TOP>12</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>1</TD></TR>
<TR>
<TD VALIGN=TOP>13</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>1</TD></TR>
<TR>
<TD VALIGN=TOP>14</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>1</TD></TR>
<TR>
<TD VALIGN=TOP>15</TD><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>1</TD></TR>
<TR>
<TD VALIGN=TOP>16</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>1</TABLE>

<P>The order of the axes is specified by the Top DICT BlendAxisTypes operator.

<H2>21. CID-keyed Fonts</H2>

<P>The representation of a CIDFont is designed to be separable from its encoding.
In keeping with this strategy, the CFF representation does not include any
encoding information which instead resides in a CMap file. If a need arises for
a more compact representation of the CMap file, CFF can be extended to
accommodate it.

<P>A CFF CIDFont has the CIDFontName in the Name INDEX and a corresponding Top
DICT. The Top DICT begins with ROS operator which specifies the the

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -