📄 gpos.htm
字号:
<TBODY>
<TR><TD VALIGN=TOP>fixed32</TD><TD VALIGN=TOP>Version</TD><TD>Version of the GPOS table-initially = 0x00010000</TD></TR>
<TR><TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>ScriptList</TD><TD>Offset to ScriptList table-from beginning of GPOS table</TD></TR>
<TR><TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>FeatureList</TD><TD>Offset to FeatureList table-from beginning of GPOS table</TD></TR>
<TR><TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>LookupList</TD><TD>Offset to LookupList table-from beginning of GPOS table</TD></TR>
</TABLE>
<H3>Lookup Type 1:<BR>
Single Adjustment Positioning Subtable</H3>
<P>A single adjustment positioning subtable (SinglePos) is used to adjust the position of a single glyph, such as a subscript or superscript. In addition, a SinglePos subtable is commonly used to implement lookup data for contextual positioning.
<P>A SinglePos subtable will have one of two formats: one that applies the same adjustment to a series of glyphs, or one that applies a different adjustment for each unique glyph.
<H4>Single Adjustment Positioning: Format 1</H4>
<P>A SinglePosFormat1 subtable applies the same positioning value or values to each glyph listed in its Coverage table. For instance, when a font uses old-style numerals, this format could be applied to uniformly lower the position of all math operator glyphs.
<P>The Format 1 subtable consists of a format identifier (PosFormat), an offset to a Coverage table that defines the glyphs to be adjusted by the positioning values (Coverage), and the format identifier (ValueFormat) that describes the amount and kinds of data in the ValueRecord.
<P>The ValueRecord specifies one or more positioning values to be applied to all covered glyphs (Value). For example, if all glyphs in the Coverage table require both horizontal and vertical adjustments, the ValueRecord will specify values for both XPlacement and Yplacement.
<P>Example 2 at the end of this chapter shows a SinglePosFormat1 subtable used to adjust the placement of subscript glyphs.
<BR> <BR><FONT SIZE=5>SinglePosFormat1 subtable:<BR> Single positioning value</FONT>
<TABLE BGCOLOR="#F0F0F0" WIDTH=480 BORDER=0 CELLPADDING=3>
<THEAD>
<TR><TH BGCOLOR="#COCOCO">Type</TH><TH BGCOLOR="#COCOCO">Name</TH><TH BGCOLOR="#COCOCO">Description</TH></TR>
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>PosFormat</TD><TD>Format identifier-format = 1</TD></TR>
<TR><TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>Coverage</TD><TD>Offset to Coverage table-from beginning of SinglePos subtable</TD></TR>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>ValueFormat</TD><TD>Defines the types of data in the ValueRecord</TD></TR>
<TR><TD VALIGN=TOP>ValueRecord</TD><TD VALIGN=TOP>Value</TD><TD>Defines positioning value(s)-applied to all glyphs in the Coverage table</TD></TR>
</TABLE>
<H4>Single Adjustment Positioning: Format 2</H4>
<P>A SinglePosFormat2 subtable provides an array of ValueRecords that contains one positioning value for each glyph in the Coverage table. This format is more flexible than Format 1, but it requires more space in the font file.
<P>For example, assume that the Cyrillic script will be used in left-justified text. For all glyphs, Format 2 could define position adjustments for left side bearings to align the left edges of the paragraphs. To achieve this, the Coverage table would list every glyph in the script, and the SinglePosFormat2 subtable would define a ValueRecord for each covered glyph. Correspondingly, each ValueRecord would specify an XPlacement adjustment value for the left side bearing.
<BLOCKQUOTE>
<STRONG>Note:</STRONG> All ValueRecords defined in a SinglePos subtable must have the same ValueFormat. In this example, if XPlacement is the only value that a ValueRecord needs to optically align the glyphs, then XPlacement will be the only value specified in the ValueFormat of the subtable.
</BLOCKQUOTE>
<P>As in Format 1, the Format 2 subtable consists of a format identifier (PosFormat), an offset to a Coverage table that defines the glyphs to be adjusted by the positioning values (Coverage), and the format identifier (ValueFormat) that describes the amount and kinds of data in the ValueRecords. In addition, the Format 2 subtable includes:
<UL>
<LI>A count of the ValueRecords (ValueCount). One ValueRecord is defined for each glyph in the Coverage table.
<LI>An array of ValueRecords that specify positioning values (Value). Because the array follows the Coverage Index order, the first ValueRecord applies to the first glyph listed in the Coverage table, and so on.
</UL>
<P>Example 3 at the end of this chapter shows how to adjust the spacing of three dash glyphs with a SinglePosFormat2 subtable.
<BR> <BR><FONT SIZE=5>SinglePosFormat2 subtable:<BR> Array of positioning values</FONT>
<TABLE BGCOLOR="#F0F0F0" WIDTH=480 BORDER=0 CELLPADDING=3>
<THEAD>
<TR><TH BGCOLOR="#COCOCO">Type</TH><TH BGCOLOR="#COCOCO">Name</TH><TH BGCOLOR="#COCOCO">Description</TH></TR>
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>PosFormat</TD><TD>Format identifier-format = 2</TD></TR>
<TR><TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>Coverage</TD><TD>Offset to Coverage table-from beginning of SinglePos subtable</TD></TR>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>ValueFormat</TD><TD>Defines the types of data in the ValueRecord</TD></TR>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>ValueCount</TD><TD>Number of ValueRecords</TD></TR>
<TR><TD VALIGN=TOP>ValueRecord</TD><TD VALIGN=TOP>Value<BR>[ValueCount]</TD><TD VALIGN=TOP>Array of ValueRecords-positioning values applied to glyphs</TD></TR>
</TABLE>
<H3>Lookup Type 2:<BR>
Pair Adjustment Positioning Subtable</H3>
<P>A pair adjustment positioning subtable (PairPos) is used to adjust the positions of two glyphs in relation to one another-for instance, to specify kerning data for pairs of glyphs. Compared to a typical kerning table, however, a PairPos subtable offers more flexiblity and precise control over glyph positioning. The PairPos subtable can adjust each glyph in a pair independently in both the X and Y directions, and it can explicitly describe the particular type of adjustment applied to each glyph. In addition, a PairPos subtable can use Device tables to subtly adjust glyph positions at each font size and device resolution.
<P>PairPos subtables can be either of two formats: one that identifies glyphs individually by index (Format 1), or one that identifies glyphs by class (Format 2).
<H4>Pair Positioning Adjustment: Format 1</H4>
<P>Format 1 uses glyph indices to access positioning data for one or more specific pairs of glyphs. All pairs are specified in the order determined by the layout direction of the text.
<BLOCKQUOTE>
<STRONG>Note:</STRONG> For text written from right to left, the right-most glyph will be the first glyph in a pair; conversely, for text written from left to right, the left-most glyph will be first.
</BLOCKQUOTE>
<P>A PairPosFormat1 subtable contains a format identifier (PosFormat) and two ValueFormats:
<UL>
<LI>ValueFormat1 applies to the ValueRecord of the first glyph in each pair. ValueRecords for all first glyphs must use ValueFormat1.
<LI>ValueFormat2 applies to the ValueRecord of the second glyph in each pair. ValueRecords for all second glyphs must use ValueFormat2.
</UL>
<P>Either of the two ValueFormats may be set to zero (0) to indicate that the corresponding glyph has no ValueRecord and, therefore, should not be repositioned.
<P>A PairPos subtable also defines an offset to a Coverage table (Coverage) that lists the indices of the first glyphs in each pair. More than one pair can have the same first glyph, but the Coverage table will list that glyph only once.
<P>The subtable also contains an array of offsets to PairSet tables (PairSet) and a count of the defined tables (PairSetCount). The PairSet array contains one offset for each glyph listed in the Coverage table and uses the same order as the Coverage Index.
<BR> <BR><FONT SIZE=5>PairPosFormat1 subtable: Adjustments for glyph pairs</FONT>
<TABLE BGCOLOR="#F0F0F0" WIDTH=480 BORDER=0 CELLPADDING=3>
<THEAD>
<TR><TH BGCOLOR="#COCOCO">Type</TH><TH BGCOLOR="#COCOCO">Name</TH><TH BGCOLOR="#COCOCO">Description</TH></TR>
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>PosFormat</TD><TD>Format identifier-format = 1</TD></TR>
<TR><TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>Coverage</TD><TD>Offset to Coverage table-from beginning of PairPos subtable-only the first glyph in each pair</TD></TR>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>ValueFormat1</TD><TD>Defines the types of data in ValueRecord1-for the first glyph in the pair
-may be zero (0)</TD></TR>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>ValueFormat2</TD><TD>Defines the types of data in ValueRecord2-for the second glyph in the pair
-may be zero (0)</TD></TR>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>PairSetCount</TD><TD>Number of PairSet tables</TD></TR>
<TR><TD VALIGN=TOP>ValueRecord</TD><TD VALIGN=TOP>PairSet<BR>[PairSetCount]</TD><TD>Array of offsets to PairSet tables-from beginning of PairPos subtable-ordered by Coverage Index</TD></TR>
</TABLE>
<P>A PairSet table enumerates all the glyph pairs that begin with a covered glyph. An array of PairValueRecords (PairValueRecord) contains one record for each pair and lists the records alphabetically by the second glyph in each pair. PairValueCount specifies the number of PairValueRecords in the set.
<BR> <BR><FONT SIZE=5>PairSet table</FONT>
<TABLE BGCOLOR="#F0F0F0" WIDTH=480 BORDER=0 CELLPADDING=3>
<THEAD>
<TR><TH BGCOLOR="#COCOCO">Type</TH><TH BGCOLOR="#COCOCO">Name</TH><TH BGCOLOR="#COCOCO">Description</TH></TR>
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>PairValueCount</TD><TD>Number of PairValueRecords</TD></TR>
<TR><TD VALIGN=TOP>struct</TD><TD VALIGN=TOP>PairValueRecord<BR>[PairValueCount]</TD><TD VALIGN=TOP>Array of PairValueRecords-ordered alphabetically by second glyph</TD></TR>
</TABLE>
<P>A PairValueRecord specifies the second glyph in a pair (SecondGlyph) and defines a ValueRecord for each glyph (Value1 and Value2). If ValueFormat1 is set to zero (0) in the PairPos subtable, ValueRecord1 will be empty; similarly, if ValueFormat2 is 0, Value2 will be empty.
<P>Example 4 at the end of this chapter shows a PairPosFormat1 subtable that defines two cases of pair kerning.
<BR> <BR><FONT SIZE=5>PairValueRecord</FONT>
<TABLE BGCOLOR="#F0F0F0" WIDTH=480 BORDER=0 CELLPADDING=3>
<THEAD>
<TR><TH BGCOLOR="#COCOCO">Type</TH><TH BGCOLOR="#COCOCO">Name</TH><TH BGCOLOR="#COCOCO">Description</TH></TR>
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP>GlyphID</TD><TD VALIGN=TOP>SecondGlyph</TD><TD>GlyphID of second glyph in the pair-first glyph is listed in the Coverage table</TD></TR>
<TR><TD VALIGN=TOP>ValueRecord</TD><TD VALIGN=TOP>Value1</TD><TD>Positioning data for the first glyph in the pair</TD></TR>
<TR><TD VALIGN=TOP>ValueRecord</TD><TD VALIGN=TOP>Value2</TD><TD>Positioning data for the second glyph in the pair</TD></TR>
</TABLE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -