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

📄 base.htm

📁 TrueType字库标准文档
💻 HTM
📖 第 1 页 / 共 5 页
字号:

<P>The BaseScriptList table identifies all scripts in the font that are rendered in the same layout direction. If a script is not listed here, then the text-processing client will render the script using the layout information specified for the entire font. 

<P>For each script listed in the BaseScriptList table, a BaseScriptRecord must be defined that identifies the script and references its layout data. BaseScriptRecords are stored in the BaseScriptRecord array, ordered alphabetically by the BaseScriptTag in each record. The BaseScriptCount specifies the total number of BaseScriptRecords in the array.

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


<BR>&nbsp;<BR><FONT SIZE=5>BaseScriptList 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>BaseScriptCount</TD><TD>Number of BaseScriptRecords defined</TD></TR>
<TR>	
<TD VALIGN=TOP>struct</TD><TD VALIGN=TOP>BaseScriptRecord[BaseScriptCount]</TD><TD>Array of BaseScriptRecords-in alphabetical order by BaseScriptTag</TD></TR>
</TABLE>
&nbsp;&nbsp;

	
<H3>BaseScriptRecord</H3>

<P>A BaseScriptRecord contains a script identification tag (BaseScriptTag), which must be identical to the ScriptTag used to define the script in the ScriptList of a GSUB or GPOS table. Each record also must include an offset to a BaseScript table that defines the baseline and min/max extent data for the script. 

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

<BR>&nbsp;<BR><FONT SIZE=5>BaseScriptRecord</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>BaseScriptTag</TD><TD>4-byte script identification tag</TD></TR>
<TR>
<TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>BaseScript</TD><TD>Offset to BaseScript table-from beginning of BaseScriptList</TD></TR>
</TABLE>
&nbsp;&nbsp;

	
<H3>BaseScript Table</H3>

<P>A BaseScript table organizes and specifies the baseline data and min/max extent data for one script. Within a BaseScript table, the BaseValues table contains baseline information, and one or more MinMax tables contain min/max extent data. 

<P>The BaseValues table identifies the default baseline for the script and lists coordinate positions for each baseline named in the corresponding BaseTagList. Each script can assign a different position to each baseline, so each script can be aligned independently in relation to any other script. (For more details, see the BaseValues table description later in this chapter.)

<P>The DefaultMinMax table defines the default min/max extent values for the script. (For details, see the MinMax table description below.) If a language system or feature defined in the font has no effect on the script's default min/max extents, TrueType Open will use the default script values.

<P>Sometimes language-specific overrides for min/max extents are needed to properly render the glyphs in a specific language system. For example, a glyph substitution required in a language system may result in a glyph whose extents exceed the script's default min/max extents. Each language system that specifies min/max extent values must define a BaseLangSysRecord. The record should identify the language system (BaseLangSysTag) and contain an offset to a MinMax table of language-specific extent coordinates.

<P>Feature-specific overrides for min/max extents also may be needed to accommodate the effects of glyph actions used to implement a specific feature. For example, superscript or subscript features may require changes to the default script or language system extents. Feature-specific extent values not limited to a specific language system may be specified in the DefaultMinMax table. However, extent values used for a specific language system require a BaseLangSysRecord and a MinMax table. In addition to specifying coordinate data, the MinMax table must contain offsets to FeatMinMaxRecords that define the feature-specific min/max data.

<P>A BaseScript table has four components:

<UL> 
<LI>An offset to a BaseValues table (BaseValues). If no baseline data is defined for the script or the corresponding BaseTagList is set to NULL, the offset to the BaseValues table may be set to NULL.
<LI>An offset to the DefaultMinMax table. If no default min/max extent data is defined for the script, this offset may be set to NULL.
<LI>An array of BaseLangSysRecords (BaseLangSysRecord). The individual records stored in the BaseLangSysRecord array are listed alphabetically by BaseLangSysTag. 
<LI>A count of the BaseLangSysRecords included (BaseLangSysCount). If no language system or language-specific feature min/max values are defined, the BaseLangSysCount may be set to zero (0).
</UL>

<P>Example 2 at the end of this chapter shows a sample BaseScript table.

<BR>&nbsp;<BR><FONT SIZE=5>BaseScript 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>BaseValues</TD><TD>Offset to BaseValues table-from beginning of BaseScript table-may be NULL</TD></TR>
<TR>
<TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>DefaultMinMax</TD><TD>Offset to MinMax table- from beginning of BaseScript table-may be NULL</TD></TR>
<TR>	
<TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>BaseLangSysCount</TD><TD>Number of BaseLangSysRecords defined-may be zero (0)</TD></TR>
<TR>	
<TD VALIGN=TOP>struct</TD><TD VALIGN=TOP>BaseLangSysRecord[BaseLangSysCount]</TD><TD>Array of BaseLangSysRecords-in alphabetical order by BaseLangSysTag</TD></TR>
</TABLE>
&nbsp;&nbsp;
	
<H3>BaseLangSysRecord</H3>

<P>A BaseLangSysRecord defines min/max extents for a language system or a language-specific feature. Each record contains an identification tag for the language system (BaseLangSysTag) and an offset to a MinMax table (MinMax) that defines extent coordinate values for the language system and references feature-specific extent data.

<P>Example 2 at the end of this chapter shows a BaseLangSysRecord.

<BR>&nbsp;<BR><FONT SIZE=5>BaseLangSysRecord</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>BaseLangSysTag</TD><TD>4-byte language system identification tag</TD></TR>
<TR>	
<TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>MinMax</TD><TD>Offset to MinMax table-from beginning of BaseScript table</TD></TR>
</TABLE>
&nbsp;&nbsp;
	
<H3>BaseValues Table</H3>

<P>A BaseValues table lists the coordinate positions of all baselines named in the BaselineTag array of the corresponding BaseTagList and identifies a default baseline for a script.

<BLOCKQUOTE>
<STRONG>Note:</STRONG> When the offset to the corresponding BaseTagList is NULL, a BaseValues table is not needed. However, if the offset is not NULL, then each script must specify coordinate positions for all baselines named in the BaseTagList.
</BLOCKQUOTE>

<P>The default baseline, one per script, is the baseline used to lay out and align the glyphs in the script. The DefaultIndex in the BaseValues table identifies the default baseline with a value that equals the array index position of the corresponding tag in the BaselineTag array. 

<P>For example, the Han and Latin scripts use different baselines to align text. If a font supports both of these scripts, the BaselineTag array in the BaseTagList of the HorizAxis table will contain two tags, listed alphabetically: "ideo" in BaselineTag[0] for the Han ideographic baseline, and &quot;romn&quot; in BaselineTag[1] for the Latin baseline. The BaseValues table for the Latin script will specify the roman baseline as the default, so the DefaultIndex in the BaseValues table for Latin will be &quot;1&quot; to indicate the roman baseline tag. In the BaseValues table for the Han script, the DefaultIndex will be &quot;0&quot; to indicate the ideographic baseline tag.

<P>Two or more scripts may share a default baseline. For instance, if the font described above also supports the Cyrillic script, the BaselineTag array does not need a baseline tag for Cyrillic because Cyrillic and Latin share the same baseline. The DefaultIndex defined in the BaseValues table for the Cyrillic script will specify &quot;1&quot; to indicate the roman baseline tag, listed in the second position in the BaselineTag array.

<P>In addition to identifying the DefaultIndex, the BaseValues table contains an offset to an array of BaseCoord tables (BaseCoord) that list the coordinate positions for all baselines, including the default baseline, named in the associated BaselineTag array. One BaseCoord table is defined for each baseline. The BaseCoordCount defines the total number of BaseCoord tables, which must equal the number of baseline tags listed in BaseTagCount in the BaseTagList.

<P>Each baseline coordinate is defined as a single X or Y value in design units measured from the zero position on the relevant X or Y axis. For example, a BaseCoord table defined in the HorizAxis table will contain a Y value because horizontal baselines are positioned vertically. BaseCoord values may be negative. Each script may assign a different coordinate to each baseline.

<P>Offsets to each BaseCoord table are stored in a BaseCoord array within the BaseValues table. The order of the stored offsets corresponds to the order of the tags listed in the BaselineTag array of the BaseTagList. In other words, the first position in the BaseCoord array will define the offset to the BaseCoord table for the first baseline named in the BaselineTag array, the second position will define the offset to the BaseCoord table for the second baseline named in the BaselineTag array, and so on.

<P>Example 3 at the end of the chapter has two parts, one that shows a BaseValues table and one that shows a chart with different baseline positions defined for several scripts. 

<BR>&nbsp;<BR><FONT SIZE=5>BaseValues 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>DefaultIndex</TD><TD>Index number of default baseline for this script-equals index position of baseline tag in BaselineArray of the BaseTagList</TD></TR>
<TR>	
<TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>BaseCoordCount</TD><TD>Number of BaseCoord tables defined-should equal BaseTagCount in the BaseTagList</TD></TR>
<TR>	
<TD VALIGN=TOP>Offset</TD><TD VALIGN=TOP>BaseCoord[BaseCoordCount]</TD><TD>Array of offsets to BaseCoord-from beginning of BaseValues table-order matches BaselineTag array in the BaseTagList</TD></TR>
</TABLE>
&nbsp;&nbsp;

	
<H3>The MinMax Table and FeatMinMaxRecord</H3>

<P>The MinMax table specifies extents for scripts and language systems. It also contains an array of FeatMinMaxRecords used to define feature-specific extents.

<P>Both the MinMax table and the FeatMinMaxRecord define offsets to two BaseCoord tables: one that defines the mimimum extent value (MinCoord), and one that defines the maximum extent value (MaxCoord). Each extent value is a single X or Y value, depending upon the text direction, and is specified in design units. Coordinate values may be negative.

<P>Different tables define the min/max extent values for scripts, language systems, and features: 

<UL>
<LI>Min/max extent values for a script are defined in the DefaultMinMax table, referenced in a BaseScript table.
<LI>Within the DefaultMinMax table, FeatMinMaxRecords can specify extent values for features that apply to the entire script.
<LI>Min/max extent values for a language system are defined in the MinMax table, referenced in a BaseLangSysRecord.
<LI>FeatMinMaxRecords can be defined within the MinMax table to specify extent values for features applied within a language system.
</UL>

<P>In a FeatMinMaxRecord, the MinCoord and MaxCoord tables specify the minimum and maximum coordinate values for the feature, and a FeatureTableTag defines a 4-byte feature identification tag. The FeatureTableTag must match the tag used to identify the feature in the FeatureList of the GSUB or GPOS table. 

<P>Each feature that exceeds the default min/max values requires a FeatMinMaxRecord. All FeatMinMaxRecords are listed alphabetically by FeatureTableTag in an array (FeatMinMaxRecord) within the MinMax table. FeatMinMaxCount defines the total number of FeatMinMaxRecords. 

<P>Text-processing clients should use the following procedure to access the script, language system, and feature-specific extent data:

<OL>
<LI>Determine script extents in relation to the text content.
<LI>Select language-specific extent values with respect to the language system in use.
<LI>Have the application or user choose feature-specific extent values. 
<LI>If no extent values are defined for a language system or for language-specific features, use the default min/max extent values for the script.
</OL>

<P>Example 4 at the end of this chapter has two parts. One shows MinMax tables and a FeatMinMaxRecord for different script, language system, and feature extents. The second part shows how to define these tables when a language system needs feature-specific extent values for an obscure feature, but otherwise the language system and script extent values match.

<BR>&nbsp;<BR><FONT SIZE=5>MinMax 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>MinCoord</TD><TD>Offset to BaseCoord table-defines minimum extent value-from the 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 the beginning of MinMax table-may be NULL</TD></TR>
<TR>	
<TD VALIGN=TOP>uint16</TD><TD VALIGN=TOP>FeatMinMaxCount</TD><TD>Number of FeatMinMaxRecords-may be zero (0)</TD></TR>
<TR>	
<TD VALIGN=TOP>struct</TD><TD VALIGN=TOP>FeatMinMaxRecord[FeatMinMaxCount]</TD><TD>Array of FeatMinMaxRecords-in alphabetical order, by FeatureTableTag</TD></TR>
</TABLE>
&nbsp;&nbsp;
	

⌨️ 快捷键说明

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