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

📄 base.htm

📁 TrueType字库标准文档
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<HTML>
<HEAD>
<TITLE>The 'base' Table</TITLE>
<STYLE>
<!--
	BODY  {background: #FFFFFF; link: #000080}
	H1	{font-size: 24pt; color: #c60029}
	H2	{font-size: 18pt; color: black}
	H3    {font-size: 16pt; color: black}
	H4    {font-size: 14pt; color: black}
 CAPTION    {font-size: 16pt; font-weight: Bold}
	A:link {text-decoration: none}
-->
</STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000080">
<TABLE WIDTH=480 CELLPADDING=8 CELLSPACING=0 BORDER=0>
<TR><TD></TD>
<TD><IMG WIDTH=100 HEIGHT=1 ALT="DIAGRAM" SRC="/TRUETYPE/OTSPEC/pixel.gif" BORDER=0></TD>
<TD><H1>Table Formats</H1></TD>
</TR>

<TR><TD></TD><TD></TD><TD ALIGN=TOP>
<H2>BASE - Baseline Table</H2>

<P>The Baseline table (BASE) provides information used to align glyphs of different scripts and sizes in a line of text, whether the glyphs are in the same font or in different fonts. To improve text layout, the Baseline table also provides minimum (min) and maximum (max) glyph extent values for each script, language system, or feature in a font.

<H3>Overview</H3>

<P>Lines of text composed with glyphs of different scripts and point sizes need adjustment to correct interline spacing and alignment. For example, glyphs designed to be the same point size often differ in height and depth from one font to another (see figure 5a). This variation can produce interline spacing that looks too large or too small, and diacritical marks, math symbols, subscripts, and superscripts may be clipped.<BR>

<IMG  WIDTH=187 HEIGHT=51 ALT="DIAGRAM" SRC="/TRUETYPE/OTSPEC/fig5a.gif"><BR> 
<STRONG>figure 5a. Incorrect alignment of glyphs from Latin and Kanji (Latin dominant)</STRONG>

<P>In addition, different baselines can cause text lines to waver visually as glyphs from different scripts are placed next to one another. For example, ideographic scripts position all glyphs on a low baseline. With Latin scripts, however, the baseline is higher, and some glyphs descend below it. Finally, several Indic scripts use a high &quot;hanging baseline&quot; to align the tops of the glyphs. 

<P>To solve these composition problems, the BASE table recommends baseline positions and min/max extents for each script (see figure 5b). Script min/max extents can be modified for particular language systems or features.<BR>

<IMG  WIDTH=187 HEIGHT=48 ALT="DIAGRAM" SRC="/TRUETYPE/OTSPEC/fig5b.gif"><BR>
<STRONG>figure 5b. Proper alignment of glyphs from Latin and Kanji (Latin dominant)</STRONG>

<H3>Baseline Values</H3>

<P>The BASE table uses a model that assumes one script at one size is the &quot;dominant run&quot; during text processing-that is, all other baselines are defined in relation to this the dominant run.

<P>For example, Latin glyphs and the ideographic Kanji glyphs have different baselines. If a Latin script of a particular size is specified as the dominant run, then all Latin glyphs of all sizes will be aligned on the roman baseline, and all Kanji glyphs will be aligned on the lower ideographic baseline defined for use with Latin text. As a result, all glyphs will look aligned within each line of text.

<P>The BASE table supplies recommended baseline positions; a client can specify others. For instance, the client may want to assign baseline positions different from those in the font.

<IMG WIDTH=572 HEIGHT=205 ALT="DIAGRAM" SRC="/TRUETYPE/OTSPEC/fig5c.gif">
<STRONG>figure 5c. Comparing Latin and Kanji baselines, with characters aligned according to the dominant run</STRONG>

<H3>Min/Max Extent Values</H3>

<P>The BASE table gives clients the option of using script, language system, or feature-specific extent values to improve composition (see figure 5c). For example, suppose a font contains glyphs in Latin and Arabic scripts, and the min/max extents defined for the Arabic script are larger than the Latin extents. The font also supports Urdu, a language system that includes specific variants of the Arabic glyphs, and some Urdu variants require larger min/max extents than the default Arabic extents. To accommodate the Urdu glyphs, the BASE table can define language-specific min/max extent values that will override the default Arabic extents-but only when rendering Urdu glyphs.

<P>The BASE table also can define feature-specific min/max values that apply only when a particular feature is enabled. Suppose that the font described earlier also supports the Farsi language system, which has one feature that requires a minor alteration of the Arabic script extents to display properly. The BASE table can specify these extent values and apply them only when that feature is enabled in the Farsi language. 

<H3>Table Organization</H3>

<P>The BASE table begins with offsets to Axis tables that describe layout data for the horizontal and vertical layout directions of text. A font can provide layout data for both text directions or for only one text direction:

<UL>
<LI>The Horizontal Axis table (HorizAxis) defines information used to lay out text horizontally. All baseline and min/max values refer to the Y direction.
<LI>The Vertical Axis table (VertAxis) defines information used to lay out text vertically. All baseline and min/max values refer to the X direction. 
</UL>

<P>figure 5d shows how the BASE table is organized.

<IMG  WIDTH=555 HEIGHT=375 ALT="DIAGRAM" SRC="/TRUETYPE/OTSPEC/fig5d.gif">
<STRONG>figure 5d. High-level organization of BASE table</STRONG>

<H3>Text Direction</H3>

<P>The HorizAxis and VertAxis tables organize layout information by script in BaseScriptList tables. A BaseScriptList enumerates all scripts in the font that are written in a particular direction (horizontal or vertical). 

<P>For example, consider a Japanese font that contains Kanji, Kana, and Latin scripts. Because all three scripts are rendered horizontally, all three are defined in the BaseScriptList of the HorizAxis table. Kanji and Kana also are rendered vertically, so those two scripts are defined in the BaseScriptList of the VertAxis table, too.

<H3>Baseline Data</H3>

<P>Each Axis table also references a BaseTagList, which identifies all the baselines for all scripts written in the same direction (horizontal or vertical). The BaseTagList may also include baseline tags for scripts supported in other fonts.

<P>Each script in a BaseScriptList is represented by a BaseScriptRecord. This record references a BaseScript table, which contains layout data for the script. In turn, the BaseScript table references a BaseValues table, which contains baseline information and several MinMax tables that define min/max extent values.

<P>The BaseValues table specifies the coordinate values for all baselines in the BaseTagList. In addition, it identifies one of these baselines as the default baseline for the script. As glyphs in a script are scaled, they grow or shrink from the script's default baseline position. Each baseline can have unique coordinates. This contrasts with TrueType 1.0, which implies a single, fixed baseline for all scripts in a font. With TrueType Open, each script can be aligned independently, although more than one script may use the same baseline values.

<P>Baseline coordinates for scripts in the same font must be specified in relation to each other for correct alignment of the glyphs. Consider the font, discussed earlier, containing both Latin and Kanji glyphs. If the BaseTagList of the HorizAxis table specifies two baselines, the roman and the ideographic, then the layout data for both the Latin and Kanji scripts will specify coordinate positions for both baselines:

<UL>
<LI>The BaseValues table for the Latin script will give coordinates for both baselines and specify the roman baseline as the default. 
<LI>The BaseValues table for the Kanji script will give coordinates for both baselines and specify the ideographic baseline as the default.
</UL>

<H3>Min/Max Extents</H3>

<P>The BaseScript table can define minimum and maximum extent values for each script, language system, or feature. (These values are distinct from the min/max extent values recorded for the font as a whole in four TrueType 1.0 tables: head, hhea, vhea, and OS/2.) These extent values appear in three tables:

<UL>
<LI>The DefaultMinMax table defines the default min/max extents for the script.
<LI>A MinMax table, referenced through a BaseLangSysRecord, specifies min/max extents to accommodate the glyphs in a specific language system.
<LI>A FeatMinMaxRecord, referenced from the MinMax table, provides min/max extent values to support feature-specific glyph actions. 
</UL>

<BLOCKQUOTE>
<STRONG>Note:</STRONG> Language-system or feature-specific extent values may be essential to define some fonts. However, the default min/max extent values specified for each script should usually be enough to support high-quality text layout.
</BLOCKQUOTE>

<P>The actual baseline and min/max extent values used by the BASE table reside in BaseCoord tables. Three formats are defined for BaseCoord table data. All formats define single X or Y coordinate values in design units, but two formats support fine adjustments to these values based on a contour point or a Device table.

<P>The rest of this chapter describes all the tables defined within the BASE table. Sample tables and lists that illustrate typical data for a font are supplied at the end of the chapter.

<H3>BASE Header</H3>

<P>The BASE table begins with a header that consists of a version number for the table (Version), initially set to 1.0 (0x00010000), and offsets to horizontal and vertical Axis tables (HorizAxis and VertAxis).

<P>Each Axis table stores all baseline information and min/max extents for one layout direction. The HorizAxis table contains Y values for horizontal text layout; the VertAxis table contains X values for vertical text layout.

<P>A font may supply information for both layout directions. If a font has values for only one text direction, the Axis table offset value for the other direction will be set to NULL.

<P>Example 1 at the end of this chapter shows a sample BASE Header.

<BR>&nbsp;<BR><FONT SIZE=5>BASE Header</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>fixed32</TD><TD VALIGN=TOP>Version</TD><TD>Version of the BASE table-initially 0x00010000</TD></TR>
<TR>	
<TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>HorizAxis</TD><TD>Offset to horizontal Axis table-from beginning of BASE table-may be NULL</TD></TR>
<TR>	
<TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>VertAxis</TD><TD>Offset to vertical Axis table-from beginning of BASE table-may be NULL</TD></TR>
</TABLE>
&nbsp;&nbsp;

	
<H3>Axis Tables: HorizAxis and VertAxis</H3>

<P>An Axis table is used to render scripts either horizontally or vertically. It consists of offsets, measured from the beginning of the Axis table, to a BaseTagList and a BaseScriptList:

<UL>
<LI>The BaseScriptList enumerates all scripts rendered in the text layout direction.
<LI>The BaseTagList enumerates all baselines used to render the scripts in the text layout direction. If no baseline data is available for a text direction, the offset to the corresponding BaseTagList may be set to NULL.
</UL>

<P>Example 1 at the end of this chapter shows an example of an Axis table.

<BR>&nbsp;<BR><FONT SIZE=5>Axis 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>Offset</TD><TD VALIGN=TOP>BaseTagList</TD><TD>Offset to BaseTagList table-from beginning of Axis table-may be NULL</TD></TR>
<TR>	
<TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>BaseScriptList</TD><TD>Offset to BaseScriptList table-from beginning of Axis table</TD></TR>
</TABLE>
&nbsp;&nbsp;

	
<H3>BaseTagList Table</H3>
<P>The BaseTagList table identifies the baselines for all scripts in the font that are rendered in the same text direction. Each baseline is identified with a 4-byte baseline tag. The BaseTagList can define any number of baselines, and it may include baseline tags for scripts supported in other fonts.

<P>Each script in the BaseScriptList table must designate one of these BaseTagList baselines as its default, which TrueType Open uses to align all glyphs in the script. Even though the BaseScriptList and the BaseTagList are defined independently of one another, the BaseTagList typically includes a tag for each different default baseline needed to render the scripts in the layout direction. If some scripts use the same default baseline, the BaseTagList needs to list the common baseline tag only once.

<P>The BaseTagList table consists of an array of baseline identification tags (BaselineTag), listed alphabetically, and a count of the total number of baseline Tags in the array (BaseTagCount).

<P>Example 1 at the end of this chapter shows a sample BaseTagList table.

<BR>&nbsp;<BR><FONT SIZE=5>BaseTagList 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>BaseTagCount</TD><TD>Number of baseline identification tags in this text direction-may be zero (0)</TD></TR>
<TR>
<TD VALIGN=TOP>Tag</TD><TD VALIGN=TOP>BaselineTag[BaseTagCount]</TD><TD>Array of 4-byte baseline identification tags-must be in alphabetical order</TD></TR>
</TABLE>
&nbsp;&nbsp;

	
<H3>BaseScriptList Table</H3>

⌨️ 快捷键说明

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