📄 gdef.htm
字号:
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>CaretValueFormat</TD><TD>Format identifier-format = 2</TD></TR>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>CaretValuePoint</TD><TD>Contour point index on glyph</TD></TR>
</TABLE>
<H4>CaretValue Format 3</H4>
<P>The third format (CaretValueFormat3) also specifies the value in design units, but it uses a Device table rather than a contour point to adjust the value. This format offers the advantage of fine-tuning the Coordinate value for any device resolution. (For more information about Device tables, see the chapter, Common Table Formats.)
<P>The format consists of a format identifier (CaretValueFormat), an X or Y value (Coordinate), and an offset to a Device table (DeviceTable).
<P>Example 6 at the end of this chapter shows a CaretValueFormat3 table.
<BR> <BR><FONT SIZE=5>CaretValueFormat3 table: Design units plus Device table</FONT>
<TABLE BGCOLOR="#F0F0F0" WIDTH=530 BORDER=0 CELLPADDING=3>
<THEAD>
<TR><TH BGCOLOR="#C0C0C0">Type</TH><TH BGCOLOR="#C0C0C0">Name</TH><TH BGCOLOR="#C0C0C0">Description</TH></TR>
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>CaretValueFormat</TD><TD>Format identifier-format = 3</TD></TR>
<TR><TD VALIGN=TOP>int16</TD><TD VALIGN=TOP>Coordinate</TD><TD>X or Y value, in design units</TD></TR>
<TR><TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>DeviceTable</TD><TD>Offset to Device table for X or Y value-from beginning of CaretValue table</TD></TR>
</TABLE>
<H3>GDEF Table Examples</H3>
<P>The rest of this chapter describes examples of all the GDEF table formats. All the examples reflect unique parameters described below, but the samples provide a useful reference for building tables specific to other situations.
<P>The examples have three columns showing hex data, source, and comments.
<H4>Example 1: GDEF Header</H4>
<P>Example 1 shows a GDEF Header definition with offsets to each of the main tables in GDEF.
<BR> <BR><FONT SIZE=5>Example 1</FONT>
<TABLE BGCOLOR="#F0F0F0" WIDTH=530 BORDER=0 CELLPADDING=3>
<THEAD>
<TR><TH BGCOLOR="#C0C0C0">Hex Data</TH><TH BGCOLOR="#C0C0C0">Source</TH><TH BGCOLOR="#C0C0C0">Comments</TH></TR>
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>GDEFHeader</STRONG><BR><BR>TheGDEFHeader</TD><TD VALIGN=BOTTOM>GDEFHeader table definition</TD></TR>
<TR><TD VALIGN=TOP>00010000</TD><TD VALIGN=TOP>0x00010000</TD><TD>Version</TD></TR>
<TR><TD VALIGN=TOP>000A</TD><TD VALIGN=TOP>GlyphClassDefTable</TD><TD>offset to GlyphClassDef table</TD></TR>
<TR><TD VALIGN=TOP>0026</TD><TD VALIGN=TOP>AttachListTable</TD><TD>offset to AttachList table</TD></TR>
<TR><TD VALIGN=TOP>0040</TD><TD VALIGN=TOP>LigCaretListTable</TD><TD>offset to LigCaretList table</TD></TR>
</TABLE>
<H4>Example 2: GlyphClassDef Table</H4>
<P>The GlyphClassDef table in Example 2 specifies a glyph for the each of the glyph classes predefined in the GlyphClassDef Enumeration List.
<BR> <BR><FONT SIZE=5>Example 2</FONT>
<TABLE BGCOLOR="#F0F0F0" WIDTH=530 BORDER=0 CELLPADDING=3>
<THEAD>
<TR><TH BGCOLOR="#C0C0C0">Hex Data</TH><TH BGCOLOR="#C0C0C0">Source</TH><TH BGCOLOR="#C0C0C0">Comments</TH></TR>
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>ClassDefFormat2</STRONG><BR>GlyphClassDefTable</TD><TD VALIGN=BOTTOM>ClassDef table definition</TD></TR>
<TR><TD VALIGN=TOP>0002</TD><TD VALIGN=TOP>2</TD><TD>ClassFormat</TD></TR>
<TR><TD VALIGN=TOP>0004</TD><TD VALIGN=TOP>4</TD><TD>ClassRangeCount<BR>ClassRangeRecord[0]</TD></TR>
<TR><TD VALIGN=TOP>0024</TD><TD VALIGN=TOP>iGlyphID</TD><TD>Start</TD></TR>
<TR><TD VALIGN=TOP>0024</TD><TD VALIGN=TOP>iGlyphID</TD><TD>End</TD></TR>
<TR><TD VALIGN=TOP>0001</TD><TD VALIGN=TOP>1</TD><TD>Class, 1 = simple glyphs<BR>ClassRangeRecord[1]</TD></TR>
<TR><TD VALIGN=TOP>009F</TD><TD VALIGN=TOP>ffiLigGlyphID</TD><TD>Start</TD></TR>
<TR><TD VALIGN=TOP>009F</TD><TD VALIGN=TOP>ffiLigGlyphID</TD><TD>End</TD></TR>
<TR><TD VALIGN=TOP>0002</TD><TD VALIGN=TOP>2</TD><TD>Class, 2 = ligature glyphs<BR>ClassRangeRecord[2]</TD></TR>
<TR><TD VALIGN=TOP>0058</TD><TD VALIGN=TOP>umlautAccentGlyphID</TD><TD>Start</TD></TR>
<TR><TD VALIGN=TOP>0058</TD><TD VALIGN=TOP>umlautAccentGlyphID</TD><TD>End</TD></TR>
<TR><TD VALIGN=TOP>0003</TD><TD VALIGN=TOP>3</TD><TD>Class, 3 = mark glyphs<BR>ClassRangeRecord[3]</TD></TR>
<TR><TD VALIGN=TOP>018F</TD><TD VALIGN=TOP>CurvedTailComponentGlyphID</TD><TD>Start</TD></TR>
<TR><TD VALIGN=TOP>018F</TD><TD VALIGN=TOP>CurvedTailComponentGlyphID</TD><TD>End</TD></TR>
<TR><TD VALIGN=TOP>0004</TD><TD VALIGN=TOP>4</TD><TD>Class, 4 = component glyphs</TD></TR>
</TABLE>
<H4>Example 3: AttachList Table</H4>
<P>In Example 3, the AttachList table enumerates the attachment points defined for two glyphs. The GlyphCoverage table identifies the glyphs: "a" and "e." For each covered glyph, an AttachPoint table specifies the attachment point count and point indices: one point for the "a" glyph and two for the "e" glyph.
<BR> <BR><FONT SIZE=5>Example 3</FONT>
<TABLE BGCOLOR="#F0F0F0" WIDTH=530 BORDER=0 CELLPADDING=3>
<THEAD>
<TR><TH BGCOLOR="#C0C0C0">Hex Data</TH><TH BGCOLOR="#C0C0C0">Source</TH><TH BGCOLOR="#C0C0C0">Comments</TH></TR>
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>AttachList</STRONG><BR>AttachListTable</TD><TD VALIGN=BOTTOM>AttachList table definition</TD></TR>
<TR><TD VALIGN=TOP>0012</TD><TD VALIGN=TOP>GlyphCoverage</TD><TD>offset to Coverage table</TD></TR>
<TR><TD VALIGN=TOP>0002</TD><TD VALIGN=TOP>2</TD><TD>GlyphCount</TD></TR>
<TR><TD VALIGN=TOP>0008</TD><TD VALIGN=TOP>aAttachPoint</TD><TD>AttachPoint[0]</TD></TR>
<TR><TD VALIGN=TOP>000C</TD><TD VALIGN=TOP>eAttachPoint</TD><TD>AttachPoint[1]<HR></TD></TR>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>AttachPoint</STRONG><BR>aAttachPoint</TD><TD VALIGN=BOTTOM>AttachPoint table definition</TD></TR>
<TR><TD VALIGN=TOP>0001</TD><TD VALIGN=TOP>1</TD><TD>PointCount</TD></TR>
<TR><TD VALIGN=TOP>0012</TD><TD VALIGN=TOP>18</TD><TD>PointIndex[0]<HR></TD></TR>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>AttachPoint</STRONG><BR>eAttachPoint</TD><TD VALIGN=BOTTOM>AttachPoint table definition</TD></TR>
<TR><TD VALIGN=TOP>0002</TD><TD VALIGN=TOP>2</TD><TD>PointCount</TD></TR>
<TR><TD VALIGN=TOP>000E</TD><TD VALIGN=TOP>14</TD><TD>PointIndex[0]</TD></TR>
<TR><TD VALIGN=TOP>0017</TD><TD VALIGN=TOP>23</TD><TD>PointIndex[1]<HR></TD></TR>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>CoverageFormat1</STRONG><BR>GlyphCoverage</TD><TD VALIGN=BOTTOM>Coverage table definition</TD></TR>
<TR><TD VALIGN=TOP>0001</TD><TD VALIGN=TOP>1</TD><TD>CoverageFormat</TD></TR>
<TR><TD VALIGN=TOP>0002</TD><TD VALIGN=TOP>2</TD><TD>GlyphCount</TD></TR>
<TR><TD VALIGN=TOP>001C</TD><TD VALIGN=TOP>aGlyphID</TD><TD>GlyphArray[0]</TD></TR>
<TR><TD VALIGN=TOP>0020</TD><TD VALIGN=TOP>eGlyphID</TD><TD>GlyphArray[1]</TD></TR>
</TABLE>
<H4>Example 4: LigCaretList Table, LigGlyph Table and CaretValueFormat1 Table</H4>
<P>Example 4 defines a list of ligature carets. The LigCoverage table lists all the ligature glyphs that define caret positions. In this example, two ligatures are covered, "ffi" and "fi." For each covered glyph, a LigGlyph table specifies the number of carets for the ligature and their coordinate values. The "fi" ligature defines one caret, positioned between the "f" and "i" components; the "ffi" ligature defines two, one positioned between the two "f" components and the other positioned between the "f" and "i." The CaretValue tables shown here use Format1, where values are specified in design units only.
<BR> <BR><FONT SIZE=5>Example 4</FONT>
<TABLE BGCOLOR="#F0F0F0" WIDTH=530 BORDER=0 CELLPADDING=3>
<THEAD>
<TR><TH BGCOLOR="#C0C0C0">Hex Data</TH><TH BGCOLOR="#C0C0C0">Source</TH><TH BGCOLOR="#C0C0C0">Comments</TH></TR>
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>LigCaretList</STRONG><BR>LigCaretListTable</TD><TD VALIGN=BOTTOM>LigCaretList table definition</TD></TR>
<TR><TD VALIGN=TOP>0008</TD><TD VALIGN=TOP>LigCoverage</TD><TD>offset to Coverage table</TD></TR>
<TR><TD VALIGN=TOP>0002</TD><TD VALIGN=TOP>2</TD><TD>LigGlyphCount</TD></TR>
<TR><TD VALIGN=TOP>0010</TD><TD VALIGN=TOP>fiLigGlyph</TD><TD>offset to LigGlyph table[0]</TD></TR>
<TR><TD VALIGN=TOP>0014</TD><TD VALIGN=TOP>ffiLigGlyph</TD><TD>offset to LigGlyph table[1]<HR></TD></TR>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>CoverageFormat1</STRONG><BR>LigCoverage</TD><TD VALIGN=BOTTOM>Coverage table definition</TD></TR>
<TR><TD VALIGN=TOP>0001</TD><TD VALIGN=TOP>1</TD><TD>CoverageFormat</TD></TR>
<TR><TD VALIGN=TOP>0002</TD><TD VALIGN=TOP>2</TD><TD>GlyphCount</TD></TR>
<TR><TD VALIGN=TOP>009F</TD><TD VALIGN=TOP>ffiLigGlyphID</TD><TD>GlyphArray[0]</TD></TR>
<TR><TD VALIGN=TOP>00A5</TD><TD VALIGN=TOP>fiLigGlyphID</TD><TD>GlyphArray[1]<HR></TD></TR>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>LigGlyph</STRONG><BR>fiLigGlyph</TD><TD VALIGN=BOTTOM>LigGlyph table definition</TD></TR>
<TR><TD VALIGN=TOP>0001</TD><TD VALIGN=TOP>1</TD><TD>CaretCount, equals the number of components - 1</TD></TR>
<TR><TD VALIGN=TOP>000E</TD><TD VALIGN=TOP>CaretFI</TD><TD>CaretValue[0]<HR></TD></TR>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>LigGlyph</STRONG><BR>ffiLigGlyph</TD><TD VALIGN=BOTTOM>LigGlyph table definition</TD></TR>
<TR><TD VALIGN=TOP>0002</TD><TD VALIGN=TOP>2</TD><TD>CaretCount, equals the number of components - 1</TD></TR>
<TR><TD VALIGN=TOP>0006</TD><TD VALIGN=TOP>CaretFFI1</TD><TD>CaretValue[0]</TD></TR>
<TR><TD VALIGN=TOP>000E</TD><TD VALIGN=TOP>CaretFFI2</TD><TD>CaretValue[1]<HR></TD></TR>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>CaretValueFormat1</STRONG><BR>CaretFI</TD><TD VALIGN=BOTTOM>CaretValue table definition</TD></TR>
<TR><TD VALIGN=TOP>0001</TD><TD VALIGN=TOP>1</TD><TD>CaretValueFormat design units only</TD></TR>
<TR><TD VALIGN=TOP>025B</TD><TD VALIGN=TOP>603</TD><TD>Coordinate X or Y value<HR></TD></TR>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>CaretValueFormat1</STRONG><BR>CaretFFI1</TD><TD VALIGN=BOTTOM>CaretValue table definition</TD></TR>
<TR><TD VALIGN=TOP>0001</TD><TD VALIGN=TOP>1</TD><TD>CaretValueFormat design units only</TD></TR>
<TR><TD VALIGN=TOP>025B</TD><TD VALIGN=TOP>603</TD><TD>Coordinate X or Y value<HR></TD></TR>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>CaretValueFormat1</STRONG><BR>CaretFFI2</TD><TD VALIGN=BOTTOM>CaretValue table definition</TD></TR>
<TR><TD VALIGN=TOP>0001</TD><TD VALIGN=TOP>1</TD><TD>CaretValueFormat design units only</TD></TR>
<TR><TD VALIGN=TOP>04B6</TD><TD VALIGN=TOP>1206</TD><TD>Coordinate X or Y value</TD></TR>
</TABLE>
<H4>Example 5: CaretValueFormat2 Table</H4>
<P>Example 5 shows a CaretValueFormat2 table that specifies a ligature caret coordinate in terms of a contour point index on a specific glyph. The final position of the caret depends on the location of the contour point on the glyph after hinting.
<BR> <BR><FONT SIZE=5>Example 5</FONT>
<TABLE BGCOLOR="#F0F0F0" WIDTH=530 BORDER=0 CELLPADDING=3>
<THEAD>
<TR><TH BGCOLOR="#C0C0C0">Hex Data</TH><TH BGCOLOR="#C0C0C0">Source</TH><TH BGCOLOR="#C0C0C0">Comments</TH></TR>
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>CaretValueFormat2</STRONG><BR>Caret1</TD><TD VALIGN=BOTTOM>CaretValue table definition</TD></TR>
<TR><TD VALIGN=TOP>0002</TD><TD VALIGN=TOP>2</TD><TD>CaretValueFormat contour point</TD></TR>
<TR><TD VALIGN=TOP>000D</TD><TD VALIGN=TOP>13</TD><TD>CaretValuePoint contour point index</TD></TR>
</TABLE>
<H4>Example 6: CaretValueFormat3 Table</H4>
<P>In Example 6, the CaretValueFormat3 table defines a caret position in design units, but includes a Device table to adjust the X or Y coordinate for the point size and resolution of the output font. Here, the Device table specifies pixel adjustments for font sizes from 12 ppem to 17 ppem.
<BR> <BR><FONT SIZE=5>Example 6</FONT>
<TABLE BGCOLOR="#F0F0F0" WIDTH=530 BORDER=0 CELLPADDING=3>
<THEAD>
<TR><TH BGCOLOR="#C0C0C0">Hex Data</TH><TH BGCOLOR="#C0C0C0">Source</TH><TH BGCOLOR="#C0C0C0">Comments</TH></TR>
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>CaretValueFormat3</STRONG><BR>Caret3</TD><TD VALIGN=BOTTOM>CaretValue table definition</TD></TR>
<TR><TD VALIGN=TOP>0003</TD><TD VALIGN=TOP>3</TD><TD>CaretValueFormat design units plus Device table</TD></TR>
<TR><TD VALIGN=TOP>04B6</TD><TD VALIGN=TOP>1206</TD><TD>Coordinate X or Y value, design units</TD></TR>
<TR><TD VALIGN=TOP>0006</TD><TD VALIGN=TOP>CaretDevice</TD><TD>offset to Device table<HR></TD></TR>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>DeviceTableFormat2</STRONG><BR>CaretDevice</TD><TD VALIGN=BOTTOM>Device Table definition</TD></TR>
<TR><TD VALIGN=TOP>000C</TD><TD VALIGN=TOP>12</TD><TD>StartSize</TD></TR>
<TR><TD VALIGN=TOP>0011</TD><TD VALIGN=TOP>17</TD><TD>EndSize</TD></TR>
<TR><TD VALIGN=TOP>0002</TD><TD VALIGN=TOP>2</TD><TD>DeltaFormat</TD></TR>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP>1</TD><TD>increase 12ppm by 1 pixel</TD></TR>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP>1</TD><TD>increase 13ppm by 1 pixel</TD></TR>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP>1</TD><TD>increase 14ppm by 1 pixel</TD></TR>
<TR><TD VALIGN=TOP>1111</TD><TD VALIGN=TOP>1</TD><TD>increase 15ppm by 1 pixel</TD></TR>
<TR><TD VALIGN=TOP> </TD><TD VALIGN=TOP>2</TD><TD>increase 16ppm by 1 pixel</TD></TR>
<TR><TD VALIGN=TOP>2200</TD><TD VALIGN=TOP>2</TD><TD>increase 17ppm by 1 pixel</TD></TR>
</TABLE>
<br> <br>
<FONT FACE="Arial, Helvetica" SIZE=1>
Microsoft Typography Web Site <A HREF="/truetype/otspec/CPYRIGHT.htm">© 1996 Microsoft Corporation</A>
<BR>
Comments to the Microsoft Typography group: <A HREF="mailto:ttwsite@microsoft.com">ttwsite@microsoft.com</A>
<BR>
<A HREF="/truetype/default.htm">Home</a> | <a href="/truetype/creators.htm">Information for Developers</a>
<BR>
Last updated 03 September 1996
</FONT>
</TD></TR>
</TABLE>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -