📄 base.htm
字号:
<BR> <BR><FONT SIZE=5>FeatMinMaxRecord</font>
<TABLE BGCOLOR="#F0F0F0" WIDTH=480 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>Tag</TD><TD VALIGN=TOP>FeatureTableTag</TD><TD>4-byte feature identification tag-must match FeatureTag in FeatureList</TD></TR>
<TR>
<TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>MinCoord</TD><TD>Offset to BaseCoord table-defines minimum extent value-from beginning of MinMax table-may be NULL</TD></TR>
<TR>
<TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>MaxCoord</TD><TD>Offset to BaseCoord table-defines maximum extent value-from beginning of MinMax table-may be NULL</TD></TR>
</TABLE>
<H3>BaseCoord Tables</H3>
<P>Within the BASE table, a BaseCoord table defines baseline and min/max extent values. Each BaseCoord table defines one X or Y value:
<UL>
<LI>If defined within the HorizAxis table, then the BaseCoord table contains a Y value.
<LI>If defined within the VertAxis table, then the BaseCoord table contains an X value.
</UL>
<P>All values are defined in design units, which typically are scaled and rounded to the nearest integer when scaling the glyphs. Values may be negative.
<P>Three formats available for BaseCoord table data define single X or Y coordinate values in design units. Two of the formats also support fine adjustments to the X or Y values based on a contour point or a Device table.
<H4>BaseCoord Format 1</H4>
<P>The first BaseCoord format (BaseCoordFormat1) consists of a format identifier, followed by a single design unit coordinate that specifies the BaseCoord value. This format has the benefits of small size and simplicity, but the BaseCoord value cannot be hinted for fine adjustments at different sizes or device resolutions.
<P>Example 5 at the end of the chapter shows a sample of a BaseCoordFormat1 table.
<BR> <BR><FONT SIZE=5>BaseCoordFormat1 table: Design units only</font>
<TABLE BGCOLOR="#F0F0F0" WIDTH=480 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>BaseCoordFormat</TD><TD>Format identifier-format = 1</TD></TR>
<TR>
<TD VALIGN=TOP>int16</TD><TD VALIGN=TOP>Coordinate</TD><TD>X or Y value, in design units</TD></TR>
</TABLE>
<H4>BaseCoord Format 2</H4>
<P>The second BaseCoord format (BaseCoordFormat2) specifies the BaseCoord value in design units, but also supplies a glyph index and a contour point for reference. During font hinting, the contour point on the glyph outline may move. The point's final position after hinting provides the final value for rendering a given font size.
<BLOCKQUOTE>
<STRONG>Note:</STRONG> Glyph positioning operations defined in the GPOS table do not affect the point's final position.
</BLOCKQUOTE>
<P>Example 6 shows a sample of a BaseCoordFormat2 table.
<BR> <BR><FONT SIZE=5>BaseCoordFormat2 table: Design units plus contour point</font>
<TABLE BGCOLOR="#F0F0F0" WIDTH=480 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>BaseCoordFormat</TD><TD>Format identifier-format = 2</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>GlyphID</TD><TD VALIGN=TOP>ReferenceGlyph</TD><TD>GlyphID of control glyph</TD></TR>
<TR>
<TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>BaseCoordPoint</TD><TD>Index of contour point on the ReferenceGlyph</TD></TR>
</TABLE>
<H4>BaseCoord Format 3</H4>
<P>The third BaseCoord format (BaseCoordFormat3) also specifies the BaseCoord 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 BaseCoord value for any font size and device resolution. (For more information about Device tables, see the chapter, Common Table Formats.)
<P>Example 7 at the end of this chapter shows a sample of a BaseCoordFormat3 table.
<BR> <BR><FONT SIZE=5>BaseCoordFormat3 table: Design units plus Device table</font>
<TABLE BGCOLOR="#F0F0F0" WIDTH=480 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>BaseCoordFormat</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</TD></TR>
</TABLE>
<H3>BASE Table Examples</H3>
<P>The rest of this chapter describes and illustrates examples of all the BASE tables. All the examples reflect unique parameters described below, but the samples provide a useful reference for building tables specific to other situations.
<P>Most of the examples have three columns showing hex data, source, and comments.
<H4>Example 1: BASE Header Table, Axis Table, BaseTagList Table, BaseScriptList Table, and BaseScriptRecord</H4>
<P>Example 1 describes a sample font that contains four scripts: Cyrillic, Devanagari, Han, and Latin. All four scripts are rendered horizontally; only one script, Han, is rendered vertically. As a result, the BASE header gives offsets to two Axis tables: HorizAxis and VertAxis. Example 1 only shows data defined in the HorizAxis table.
<P>In the HorizAxis table, the BaseScriptList enumerates all four scripts. The BaseTagList table names three horizontal baselines for rendering these scripts: hanging, ideographic, and roman. The hanging baseline is the default for Devanagari, the ideographic baseline is the default for Han, and the roman baseline is the default for both Latin and Cyrillic.
<P>The VertAxis table (not shown) would be defined similarly: its BaseScriptList would enumerate one script, Han, and its BaseTagList would specify the vertically centered baseline for rendering the Han script.
<BR> <BR><FONT SIZE=5>Example 1</font>
<TABLE BGCOLOR="#F0F0F0" WIDTH=480 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>BASEHeader</STRONG><BR>TheBASEHeader</TD><TD VALIGN=BOTTOM>BASE table header definition</TD></TR>
<TR>
<TD VALIGN=TOP>00010000</TD><TD VALIGN=TOP>0x00010000</TD><TD>Version</TD></TR>
<TR>
<TD VALIGN=TOP>0008</TD><TD VALIGN=TOP>HorizontalAxisTable</TD><TD>Offset to HorizAxis table</TD></TR>
<TR>
<TD VALIGN=TOP>010C</TD><TD VALIGN=TOP>VerticalAxisTable</TD><TD>Offset to VertAxis table<HR></TD></TR>
<TR>
<TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>Axis</STRONG><BR>HorizontalAxisTable</TD><TD VALIGN=BOTTOM>Axis table definition</TD></TR>
<TR>
<TD VALIGN=TOP>0004</TD><TD VALIGN=TOP>HorizBaseTagList</TD><TD>Offset to BaseTagList table</TD></TR>
<TR>
<TD VALIGN=TOP>0012</TD><TD VALIGN=TOP>HorizBaseScriptList</TD><TD>Offset to BaseScriptList table<HR></TD></TR>
<TR>
<TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>BaseTagList</STRONG><BR>HorizBaseTagList</TD><TD VALIGN=BOTTOM>BaseTagList table definition</TD></TR>
<TR>
<TD VALIGN=TOP>0003</TD><TD VALIGN=TOP>3</TD><TD>BaseTagCount</TD></TR>
<TR>
<TD VALIGN=TOP>68616E67</TD><TD VALIGN=TOP>"hang"</TD><TD>BaselineTag[0], in alphabetical order</TD></TR>
<TR>
<TD VALIGN=TOP>6964656F</TD><TD VALIGN=TOP>"ideo"</TD><TD>BaselineTag[1]</TD></TR>
<TR>
<TD VALIGN=TOP>726F6D6E</TD><TD VALIGN=TOP>"romn"</TD><TD>BaselineTag[2]</TD></TR>
<TR>
<TD VALIGN=TOP> </TD><TD VALIGN=TOP><STRONG>BaseScriptList</STRONG><BR>HorizBaseScriptList</TD><TD VALIGN=BOTTOM>BaseScriptList table definition</TD></TR>
<TR>
<TD VALIGN=TOP>0004</TD><TD VALIGN=TOP>4</TD><TD>BaseScriptCount<BR>BaseScriptRecord[0], in alphabetical order</TD></TR>
<TR>
<TD VALIGN=TOP>6379726C</TD><TD VALIGN=TOP>"cyrl"</TD><TD>BaseScriptTag for Cyrillic script</TD></TR>
<TR>
<TD VALIGN=TOP>001A</TD><TD VALIGN=TOP>HorizCyrillicBaseScriptTable</TD><TD>Offset to BaseScript table for Cyrillic script BaseScriptRecord[1]</TD></TR>
<TR>
<TD VALIGN=TOP>6465766E</TD><TD VALIGN=TOP>"devn"</TD><TD>BaseScriptTag for Devanagari script</TD></TR>
<TR>
<TD VALIGN=TOP>0060</TD><TD VALIGN=TOP>HorizDevanagariBaseScriptTable</TD><TD>Offset to BaseScript table for Devanagari script BaseScriptRecord[2]</TD></TR>
<TR>
<TD VALIGN=TOP>68616E69</TD><TD VALIGN=TOP>"hani"</TD><TD>BaseScriptTag for Han script</TD></TR>
<TR>
<TD VALIGN=TOP>008A</TD><TD VALIGN=TOP>HorizHanBaseScriptTable</TD><TD>Offset to BaseScript table for Han script BaseScriptRecord[3]</TD></TR>
<TR>
<TD VALIGN=TOP>6C61746E</TD><TD VALIGN=TOP>"latn"</TD><TD>BaseScriptTag for Latin script</TD></TR>
<TR>
<TD VALIGN=TOP>00B4</TD><TD VALIGN=TOP>HorizLatinBaseScriptTable</TD><TD>Offset to BaseScript table for Latin script</TD></TR>
</TABLE>
<H4>Example 2: BaseScript Table and BaseLangSysRecord</H4>
<P>Example 2 shows the BaseScript table and BaseLangSysRecord for the Cyrillic script, one of the four scripts included in the sample font described in Example 1. The BaseScript table specifies offsets to tables that contain the baseline and min/max extent data for Cyrillic. (The BaseScript tables for the other three scripts in the font would be defined similarly.) Again, the table specifies only the horizontal text-layout information.
<P>The HorizCyrillicBaseValues table contains the baseline information for the script, and the HorizCyrillicDefaultMinMax table contains the default script extents. In addition, a BaseLangSysRecord defines min/max extent data for the Russian language system.
<BR> <BR><FONT SIZE=5>Example 2</font>
<TABLE BGCOLOR="#F0F0F0" WIDTH=480 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>BaseScript</STRONG><BR>HorizCyrillicBaseScriptTable</TD><TD VALIGN=BOTTOM>BaseScript table definition for Cyrillic script</TD></TR>
<TR>
<TD VALIGN=TOP>000C</TD><TD VALIGN=TOP>HorizCyrillicBaseValuesTable</TD><TD>Offset to BaseValues table</TD></TR>
<TR>
<TD VALIGN=TOP>0022</TD><TD VALIGN=TOP>HorizCyrillicDefaultMinMaxTable</TD><TD>Offset to DefaultMinMax table default script extents</TD></TR>
<TR>
<TD VALIGN=TOP>0001</TD><TD VALIGN=TOP>1</TD><TD>BaseLangSysCount, feature-specific extents BaseLangSysRecord[0] in alphabetical order</TD></TR>
<TR>
<TD VALIGN=TOP>52555320</TD><TD VALIGN=TOP>"RUS "</TD><TD>BaseLangSysTag, Russian language system</TD></TR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -