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

📄 gpos.htm

📁 TrueType字库标准文档
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<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>Mark1Coverage</TD><TD>Offset to Combining Mark Coverage table-from beginning of MarkMarkPos subtable</TD></TR>
<TR><TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>Mark2Coverage</TD><TD>Offset to Base Mark Coverage table-from beginning of MarkMarkPos subtable</TD></TR>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>ClassCount</TD><TD>Number of Combining Mark classes defined<TR>	
<TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>Mark1Array</TD><TD VALIGN=TOP>Offset to MarkArray table for Mark1-from beginning of MarkMarkPos subtable</TD></TR>
<TR><TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>Mark2Array</TD><TD>Offset to Mark2Array table for Mark2-from beginning of MarkMarkPos subtable</TD></TR>
</TABLE>&nbsp;&nbsp;
	
<P>The Mark2Array, shown next, contains one Mark2Record for each Mark2 glyph listed in the Mark2Coverage table. It stores the records in the same order as the Mark2Coverage Index.

<BR>&nbsp;<BR><FONT SIZE=5>Mark2Array 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>Mark2Count</TD><TD>Number of Mark2 records</TD></TR>
<TR><TD VALIGN=TOP>struct</TD><TD VALIGN=TOP>Mark2Record<BR>[Mark2Count]</TD><TD VALIGN=TOP>Array of Mark2 records-in Coverage order</TD></TR>
</TABLE>&nbsp;&nbsp;
	
<P>Each Mark2Record contains an array of offsets to Anchor tables (Mark2Anchor). The array of zero-based offsets, measured from the beginning of the Mark2Array table, defines the entire set of Mark2 attachment points used to attach Mark1 glyphs to a specific Mark2 glyph. The Anchor tables in the Mark2Anchor array are ordered by Mark1 class value.

<P>A Mark2Record declares one Anchor table for each mark class (including Class 0) identified in the MarkRecords of the MarkArray. Each Anchor table specifies one Mark2 attachment point used to attach all the Mark1 glyphs in a particular class to the Mark2 glyph. 

<P>Example 9 at the end of the chapter shows a MarkMarkPosFormat1 subtable for attaching one mark to another in the Arabic script.

<BR>&nbsp;<BR><FONT SIZE=5>Mark2Record</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>Offset</TD><TD VALIGN=TOP>Mark2Anchor<BR>[ClassCount]</TD><TD>Array of offsets (one per class) to Anchor tables-from beginning of Mark2Array table-zero-based array</TD></TR>
</TABLE>&nbsp;&nbsp;
	
<H3>Lookup Type 7:<BR> 
Contextual Positioning Subtables</H3>

<P>A Contextual Positioning (ContextPos) subtable defines the most powerful type of glyph positioning lookup. It describes glyph positioning in context so a text-processing client can adjust the position of one or more glyphs within a certain pattern of glyphs. Each subtable describes one or more &quot;input&quot; glyph sequences and one or more positioning operations to be performed on that sequence. 

<P>ContextPos subtables can have one of three formats, which closely mirror the formats used for contextual glyph substitution. One format applies to specific glyph sequences (Format 1), one defines the context in terms of glyph classes (Format 2), and the third format defines the context in terms of sets of glyphs (Format 3).

<P>All ContextPos subtables specify positioning data in a PosLookupRecord. A description of that record follows the descriptions of the three formats available for ContextPos subtables.

<H4>Context Positioning Subtable: Format 1</H4>

<P>Format 1 defines the context for a glyph positioning operation as a particular sequence of glyphs. For example, a context could be &lt;To&gt;, &lt;xyzabc&gt;, &lt;!?*#@&gt;, or any other glyph sequence. 

<P>Within the context, Format 1 identifies particular glyph positions (not glyph indices) as the targets for specific adjustments. When a text-processing client locates a context in a string of text, it makes the adjustment by applying the lookup data defined for a targeted position at that location.

<P>For example, suppose that accent mark glyphs above lowercase x-height vowel glyphs must be lowered when an overhanging capital letter glyph precedes the vowel. When the client locates this context in the text, the subtable identifies the position of the accent mark and a lookup index. A lookup specifies a positioning action that lowers the accent mark over the vowel so that it does not collide with the overhanging capital.

<P>ContextPosFormat1 defines the context in two places. A Coverage table specifies the first glyph in the input sequence, and a PosRule table identifies the remaining glyphs. To describe the context used in the previous example, the Coverage table lists the glyph index of the first component of the sequence (the overhanging capital), and a PosRule table defines indices for the lowercase x-height vowel glyph and the accent mark.

<BLOCKQUOTE>
<STRONG>Note:</STRONG> The glyph order in the context sequence depends on the writing direction of the text. For text written from right to left, the right-most glyph will be first. Conversely, for text written from left to right, the left-most glyph will be first.
</BLOCKQUOTE>

<P>A single ContextPosFormat1 subtable may define more than one context glyph sequence. If different context sequences begin with the same glyph, then the Coverage table should list the glyph only once because all first glyphs in the table must be unique. For example, if three contexts each start with an &quot;s&quot; and two start with a &quot;t,&quot; then the Coverage table will list one &quot;s&quot; and one &quot;t.&quot; 

<P>For each context, a PosRule table lists all the glyphs, in order, that follow the first glyph. The table also contains an array of PosLookupRecords that specify the positioning lookup data for each glyph position (including the first glyph position) in the context.

<P>All the PosRule tables defining contexts that begin with the same first glyph are grouped together and defined in a PosRuleSet table. For example, the PosRule tables that define the three contexts that begin with an &quot;s&quot; are grouped in one PosRuleSet table, and the PosRule tables that define the two contexts that begin with a &quot;t&quot; are grouped in a second PosRuleSet table. Each unique glyph listed in the Coverage table must have a PosRuleSet table that defines all the PosRule tables for a covered glyph.

<P>To locate a context glyph sequence, the text-processing client searches the Coverage table each time it encounters a new text glyph. If the glyph is covered, the client reads the corresponding PosRuleSet table and examines each PosRule table in the set to determine whether the rest of the context defined there matches the subsequent glyphs in the text. If the context and text string match, the client finds the target glyph position, applies the lookup for that position, and completes the positioning action. 

<P>A ContextPosFormat1 subtable contains a format identifier (PosFormat), an offset to a Coverage table (Coverage), a count of the number of PosRuleSets that are defined (PosRuleSetCount), and an array of offsets to the PosRuleSet tables (PosRuleSet). As mentioned, one PosRuleSet table must be defined for each glyph listed in the Coverage table. 
<P>In the PosRuleSet array, the PosRuleSet tables are ordered in the Coverage Index order. The first PosRuleSet in the array applies to the first GlyphID listed in the Coverage table, the second PosRuleSet in the array applies to the second GlyphID listed in the Coverage table, and so on.

<BR>&nbsp;<BR><FONT SIZE=5>ContextPosFormat1 subtable: Simple context positioning</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 ContextPos subtable</TD></TR>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>PosRuleSetCount</TD><TD>Number of PosRuleSet tables</TD></TR>
<TR><TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>PosRuleSet<BR>[PosRuleSetCount]</TD><TD>Array of offsets to PosRuleSet tables-from beginning of ContextPos subtable-ordered by Coverage Index</TD></TR>
</TABLE>&nbsp;&nbsp;
	
<P>A PosRuleSet table consists of an array of offsets to PosRule tables (PosRule), ordered by preference, and a count of the PosRule tables defined in the set (PosRuleCount). 

<BR>&nbsp;<BR><FONT SIZE=5>PosRuleSet table: All contexts beginning with the same glyph</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>PosRuleCount</TD><TD>Number of PosRule tables</TD></TR>
<TR><TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>PosRule<BR>[PosRuleCount]</TD><TD>Array of offsets to PosRule tables-from beginning of PosRuleSet-ordered by preference</TD></TR>
</TABLE>&nbsp;&nbsp;
	
<P>A PosRule table consists of a count of the glyphs to be matched in the input context sequence (GlyphCount), including the first glyph in the sequence, and an array of glyph indices that describe the context (Input). The Coverage table specifies the index of the first glyph in the context, and the Input array begins with the second glyph in the context sequence. As a result, the first index position in the array is specified with the number one (1), not zero (0). The Input array lists the indices in the order the corresponding glyphs appear in the text. For text written from right to left, the right-most glyph will be first; conversely, for text written from left to right, the left-most glyph will be first.

<P>A PosRule table also contains a count of the positioning operations to be performed on the input glyph sequence (PosCount) and an array of PosLookupRecords (PosLookupRecord). Each record specifies a position in the input glyph sequence and a LookupList index to the positioning lookup to be applied there. The array should list records in design order, or the order the lookups should be applied to the entire glyph sequence.

<P>Example 10 at the end of this chapter demonstrates glyph kerning in context with a 
ContextPosFormat1 subtable.

<BR>&nbsp;<BR><FONT SIZE=5>PosRule table: One simple context definition</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>GlyphCount</TD><TD>Number of glyphs in the Input glyph sequence</TD></TR>
<TR><TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>PosCount</TD><TD>Number of PosLookupRecords</TD></TR>
<TR><TD VALIGN=TOP>GlyphID</TD><TD VALIGN=TOP>Input<BR>[GlyphCount - 1]</TD><TD VALIGN=TOP>Array of input GlyphIDs-starting with the second glyph</TD></TR>
<TR><TD VALIGN=TOP>struct</TD><TD VALIGN=TOP>PosLookupRecord[PosCount]</TD><TD>Array of positioning lookups-in design order</TD></TR>
</TABLE>&nbsp;&nbsp;
	
<H4>Context Positioning Subtable: Format 2</H4>
<P>Format 2, more flexible than Format 1, describes class-based context positioning. For this format, a specific integer, called a class value, must be assigned to each glyph in all context glyph sequences. Contexts are then defined as sequences of class values. This subtable may define more than one context.

<P>To clarify the notion of class-based context rules, suppose that certain sequences of three glyphs need special kerning. The glyph sequences consist of an uppercase glyph that overhangs on the right side, a punctuation mark glyph, and then a quote glyph. In this case, the set of uppercase glyphs would constitute one glyph class (Class1), the set of punctuation mark glyphs would constitute a second glyph class (Class 2), and the set of quote mark glyphs would constitute a third glyph class (Class 3). The input context might be specified with a context rule (PosClassRule) that describes &quot;the set of glyph strings that form a sequence of three glyph classes, one glyph from Class 1, followed by one glyph from Class 2, followed by one glyph from Class 3.&quot;

<P>Each ContextPosFormat2 subtable contains an offset to a class definition table (ClassDef), which defines the class values of all glyphs in the input contexts that the subtable describes. Generally, a unique ClassDef will be declared in each instance of the ContextPosFormat2 subtable that is included in a font, even though several Format 2 subtables may share ClassDef tables. Classes are exclusive sets; a glyph cannot be in more than one class at a time. The output glyphs that replace the glyphs in the context sequence do not need class values because they are specified elsewhere by GlyphID.

<P>The ContextPosFormat2 subtable also contains a format identifier (PosFormat) and defines an offset to a Coverage table (Coverage). For this format, the Coverage table lists indices for the complete set of glyphs (not glyph classes) that may appear as the first glyph of any class-based context. In other words, the Coverage table contains the list of glyph indices for all the glyphs in all classes that may be first in any of the context class sequences. For example, if the contexts begin with a Class 1 or Class 2 glyph, then the Coverage table will list the indices of all Class 1 and Class 2 glyphs. This Coverage listing is redundant because the ClassDef table also identifies input glyphs, but it accelerates the lookup process.

<P>A ContextPosFormat2 subtable also defines an array of offsets to the PosClassSet tables (PosClassSet), along with a count (including Class0) of the PosClassSet tables (PosClassSetCnt). In the array, the PosClassSet tables are ordered by ascending class value (from 0 to PosClassSetCnt - 1). 

<P>A PosClassSet array contains one offset for each glyph class, including Class 0. PosClassSets are not explicitly tagged with a class value; rather, the index value of the PosClassSet in the PosClassSet array defines the class that a PosClassSet represents. 

<P>For example, the first PosClassSet listed in the array contains all the PosClassRules that define contexts beginning with Class 0 glyphs, the second PosClassSet contains all PosClassRules that define contexts beginning with Class 1 glyphs, and so on. If no PosClassRules begin with a particular class (that is, if a PosClassSet contains no PosClassRules), then the offset to that particular PosClassSet in the PosClassSet array will be set to NULL.

<BR>&nbsp;<BR><FONT SIZE=5>ContextPosFormat2 subtable: Class-based context glyph positioning</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=TO

⌨️ 快捷键说明

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