BASE Table Examples

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.

Most of the examples have three columns showing hex data, source, and comments.

Example 1: BASE Header Table, Axis Table, BaseTagList Table, BaseScriptList Table, and BaseScriptRecord

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.

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.

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.

Example 1

Hex Data

Source

Comments

BASEHeader

TheBASEHeader

;BASE table header definition

00010000

0x00010000

;Version

0008

HorizontalAxisTable

;Offset to HorizAxis table

010C

VerticalAxisTable

;Offset to VertAxis table

Axis

HorizontalAxisTable

;Axis table definition

0004

HorizBaseTagList

;Offset to BaseTagList table

0012

HorizBaseScriptList

;Offset to BaseScriptList table

BaseTagList

HorizBaseTagList

;BaseTagList table definition

0003

3

;BaseTagCount

68616E67

"hang"

;BaselineTag[0]

; in alphabetical order

6964656F

"ideo"

;BaselineTag[1]

726F6D6E

"romn"

;BaselineTag[2]

BaseScriptList

HorizBaseScriptList

;BaseScriptList table definition

0004

4

;BaseScriptCount

;BaseScriptRecord[0]

; in alphabetical order

6379726C

"cyrl"

;BaseScriptTag

; for Cyrillic script

001A

HorizCyrillicBaseScriptTable

;Offset to BaseScript table

; for Cyrillic script

;BaseScriptRecord[1]

6465766E

"devn"

;BaseScriptTag

; for Devanagari script

0060

HorizDevanagariBaseScriptTable

;Offset to BaseScript table

; for Devanagari script

;BaseScriptRecord[2]

68616E69

"hani"

;BaseScriptTag

; for Han script

008A

HorizHanBaseScriptTable

;Offset to BaseScript table

; for Han script

;BaseScriptRecord[3]

6C61746E

"latn"

;BaseScriptTag

; for Latin script

00B4

HorizLatinBaseScriptTable

;Offset to BaseScript table

; for Latin script


Example 2: BaseScript Table and BaseLangSysRecord

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.

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.

Example 2

Hex Data

Source

Comments

BaseScript

HorizCyrillicBaseScriptTable

;BaseScript table definition

; for Cyrillic script

000C

HorizCyrillicBaseValuesTable

;Offset to BaseValues table

0022

HorizCyrillicDefaultMinMaxTable

;Offset to DefaultMinMax table

; default script extents

0001

1

;BaseLangSysCount

; feature-specific extents

;BaseLangSysRecord[0]

; in alphabetical order

52555320

"RUS "

;BaseLangSysTag

; Russian language system

0030

HorizRussianMinMaxTable

;Offset to MinMax table

; feature—specific extents


Example 3: BaseValues Table

Example 3 extends the BASE table definition for the Cyrillic script described in Examples 1 and 2. It contains two parts:

Example 3A illustrates a fully defined BaseValues table for Cyrillic. The table includes the corresponding BaseCoord table definitions.

Example 3B shows two different sets of baseline values that can be defined for each of the four scripts in the sample font.

The examples show only horizontal text-layout data, and the font uses 2,048 design units/em.

Example 3A: BaseValues Table for Cyrillic

The BaseValues table of Example 3A identifies the default baseline for Cyrillic and specifies coordinate positions for each baseline listed in the BaseTagList shown in Example 1:

The hanging baseline is the default for the Devanagari script, and it has the highest baseline position.

The ideographic baseline is the default for the Han script, and it has the lowest baseline position.

The roman baseline is the default for both the Latin and Cyrillic scripts, and its position lies between the hanging and ideographic baselines.

Example 3A

Hex Data

Source

Comments

BaseValues

HorizCyrillicBaseValuesTable

;BaseValues table definition

; for Cyrillic script

0002

2

;DefaultIndex

; roman baseline

; BaselineTag index

0003

3

;BaseCoordCount

; equals BaseTagCount

000A

HorizHangingBaseCoordForCyrl

;Offset to BaseCoord[0] table

; hanging baseline coordinate

; order matches order of

; BaselineTag array in

; BaseTagList

000E

HorizideographicBaseCoordForCyrl

;Offset to BaseCoord[1] table

; ideographic baseline

; coordinate

0012

HorizromanBaseCoordForCyrl

;Offset to BaseCoord[2] table

; roman baseline coordinate

BaseCoordFormat1

HorizHangingBaseCoordForCyrl

;BaseCoord table definition

0001

1

;BaseCoordFormat

; design units only

05DC

1500

;Coordinate

; Y value, in design units

BaseCoordFormat1

HorizideographicBaseCoordForCyrl

;BaseCoord table definition

0001

1

;BaseCoordFormat

; design units only

FEE0

-288

;Coordinate

; Y value, in design units

BaseCoordFormat1

HorizromanBaseCoordinateForCyrl

;BaseCoord table definition

0001

1

;BaseCoordFormat

; design units only

0000

0

;Coordinate

; Y value, in design units


Example 3B: Baseline Values for Four Scripts

Example 3B shows two tables that contain baseline values for each of the four scripts in the sample font described in Example 1:

The first table shows what might happen if the baseline values in all four scripts are designed consistently. Their respective BaseValues tables list identical baseline values with the roman baseline positioned at a Y value of zero (0), the ideographic baseline at 1500, and the hanging baseline at -288.

The second table shows what might happen if the baseline values in the scripts are designed differently with the default baseline for each script at the zero (0) coordinate.

Either method of assigning baseline values can be used in the BASE table.

Example 3B: Identical baseline values

Baseline type

Han

Latin

Cyrillic

Devanagari

hanging

1500

1500

1500

1500

roman

0

0

0

0

ideographic

-288

-288

-288

-288


Example 3B: Assigned baseline values with default baselines at 0

Baseline type

Han

Latin

Cyrillic

Devanagari

hanging

1788

1500

1500

0

roman

288

0

0

-1500

ideographic

0

-288

-288

-1788


Example 4: MinMax Table and FeatMinMaxRecord

Example 4 shows MinMax table and FeatMinMaxRecord definitions for the same Cyrillic script described in the previous example. It contains two parts:

Example 4A defines tables with different script, language system, and feature extents.

Example 4B shows these same table definitions written when the language system extents match the script extents, but an obscure feature of the language system requires feature-specific extents if that feature is implemented.

The examples show only horizontal text-layout data, and the font uses 2,048 design units/em.

Example 4A: Min/Max Extents For Cyrillic Script, Russian Language, and
Russian Feature

Example 4A shows two MinMax tables and a FeatMinMaxRecord for the Cyrillic script, along with sample BaseCoord tables. Only the MinCoord extent data is included.

The DefaultMinMax table defines the default minimum and maximum extents for the Cyrillic script. Another MinMax table defines language-specific min/max extents for the Russian language system to accommodate the height and width of certain glyphs used in Russian. Also, a FeatMinMaxRecord defines min/max extents for a single feature in the Russian language system that substitutes a tall integral math symbol when required.

Example 4A

Hex Data

Source

Comments

MinMax

HorizCyrillicDefaultMinMaxTable

;DefaultMinMax table definition

; Cyrillic script

0006

HorizCyrillicMinCoordTable

;MinCoord

; offset to BaseCoord table

000A

HorizCyrillicMaxCoordTable

;MaxCoord

; offset to BaseCoord table

0000

0

;FeatMinMaxCount

; no default feature extents

;FeatMinMaxRecord[]

; no FeatMinMaxRecords

BaseCoordFormat1

HorizCyrillicMinCoordTable

;BaseCoord table definition

; default Cyrillic Min

; extent coordinate

0001

1

;BaseCoordFormat

; design units only

FF38

-200

;Coordinate

; Y value, in design units

BaseCoordFormat1

HorizCyrillicMaxCoordTable

;BaseCoord table definition

; default Cyrillic Max

; extent coordinate

0001

1

;BaseCoordFormat

; design units only

0674

1652

;Coordinate

; Y value, in design units

MinMax

HorizRussianMinMaxTable

;MinMax table definition

; Russian language extents

000E

HorizRussianLangSysMinCoordTable

;MinCoord

; Offset to BaseCoord table

0012

HorizRussianLangSysMaxCoordTable

;MaxCoord

; Offset to BaseCoord table

0001

1

;FeatMinMaxCount

;FeatMinMaxRecord[0]

; in alphabetical order

696E7467

"intg"

;FeatureTableTag

; integral math symbol Feature

; must be same as Tag in

; FeatureList

0016

HorizRussianFeatureMinCoordTable

;MinCoord

; Offset to BaseCoord table

001A

HorizRussianFeatureMaxCoordTable

;MaxCoord

; Offset to BaseCoord table

BaseCoordFormat1

HorizRussianLangSysMinCoordTable

;BaseCoord table definition

; Russian language min extent

; coordinate

0001

1

;BaseCoordFormat

; design units only

FF08

-248

;Coordinate

; Y value, in design units

; increased Min extent beyond

; default Cyrillic min extent

BaseCoordFormat1

HorizRussianLangSysMaxCoordTable

;BaseCoord table definition

; Russian language feature Max

; extent coordinate

0001

1

;BaseCoordFormat

; design units only

06A4

1700

;Coordinate

; Y value, in design units

; increased max extent beyond

; default Cyrillic max extent

BaseCoordFormat1

HorizRussianFeatureMinCoordTable

;BaseCoord table definition

; Russian language Min

; extent coordinate

0001

1

;BaseCoordFormat

; Design Units Only

FED8

-296

;Coordinate

; Y value, in design units

; increased Min extent beyond

; default Cyrillic script and

; Russian language min extents

BaseCoordFormat1

HorizRussianFeatureMaxCoordTable

;BaseCoord table definition

; Russian language feature Max

; extent coordinate

0001

1

;BaseCoordFormat

; design units only

06D8

1752

;Coordinate

; Y value, in design units

; increased Max extent beyond

; default Cyrillic script and

; Russian language max extents


Example 4B: Min/Max Extents For Cyrillic Script and Russian Feature

A particular language system does not need to define min/max extent coordinates if its extents match the default extents defined for the script. However, an obscure or infrequently used feature within the language system may require feature-specific extent values for proper rendering.

Example 4B shows the MinMax and FeatMinMaxRecord table definitions for this situation. The example also includes a BaseScript table, but not a BaseValues tables since it is not relevant in this example. The example shows horizontal text layout extents for the Cyrillic script and feature-specific extents for one feature in the Russian language system. Much of the data is repeated from Example 4A and modified here for comparison.

The BaseScript table includes a DefaultMinMax table for the Cyrillic script and a BaseLangSysRecord that defines a BaseLangSysTag and an offset to a MinMax table for the Russian language. The MinMax table includes a FeatMinMaxRecord and specifies a FeatMinMaxCount, but both the MinCoord and MaxCoord offsets in the MinMax table are set to NULL since no language-specific extent values are defined for Russian. The FeatMinMaxRecord defines the min/max coordinates for the Russian feature and specifies the correct FeatureTableTag.

Example 4B

Hex Data

Source

Comments

BaseScript

HorizCyrillicBaseScriptTable

;BaseScript table definition

; Cyrillic script

0000

NULL

;offset to BaseValues table

000C

HorizCyrillicDefaultMinMaxTable

;offset to DefaultMinMax table

; for default script extents

0001

1

;BaseLangSysCount

;BaseLangSysRecord[0]

; for Russian feature-specific-

; extents

52555320

"RUS "

;BaseLangSysTag = Russian

001A

HorizRussianMinMaxTable

;offset to MinMax table

; for feature-specific extents

MinMax

HorizCyrillicDefaultMinMaxTable

;DefaultMinMax table definition

; Cyrillic script

0006

HorizCyrillicMinCoordTable

;MinCoord

; offset to BaseCoord table

000A

HorizCyrillicMaxCoordTable

;MaxCoord

; offset to BaseCoord table

0000

0

;FeatMinMaxCount

; no default feature extents

;FeatMinMaxRecord[]

; no FeatMinMaxRecords

BaseCoordFormat1

HorizCyrillicMinCoordTable

;BaseCoord table definition

; default Cyrillic Min

; extent coordinate

0001

1

;BaseCoordFormat

; design units only

FF38

-200

;Coordinate

; Y value, in design units

BaseCoordFormat1

HorizCyrillicMaxCoordTable

;BaseCoord table definition

; default Cyrillic Min

; extent coordinate

0001

1

;BaseCoordFormat

; design units only

0674

1652

;Coordinate

; Y value, in design units

MinMax

HorizRussianMinMaxTable

;MinMax table definition

; for Russian feature

; no extent differences for

; Russian language itself

0000

NULL

;offset to Min BaseCoord table

; not defined, matches default

0000

NULL

;offset to Max BaseCoord table

; not defined, matches default

0001

1

;FeatMinMaxCount

;FeatMinMaxRecord[0]

; in alphabetical order

696E7467

"intg"

;FeatureTableTag

; integral math sign Feature

; must be same as Tag in

; FeatureList

000E

HorizRussianFeatureMinCoordTable

;MinCoord

; offset to BaseCoord table

0012

HorizRussianFeatureMaxCoordTable

;MaxCoord

; offset to BaseCoord table

BaseCoordFormat1

HorizRussianFeatureMinCoordTable

;BaseCoord table definition

; Russian Feature Min extent

; coordinate

0001

1

;BaseCoordFormat

; design units only

FED8

-296

;Coordinate

; Y value, in design units

; increased Min extent deyond

; default Cyrillic Min extent

BaseCoordFormat1

HorizRussianFeatureMaxCoordTable

;BaseCoord table definition

; Russian feature Max extent

; coordinate

0001

1

;BaseCoordFormat

; design units only

06D8

1752

;Coordinate

; Y value, in design units

; increased Max extent deyond

; default Cyrillic Max extent


Example 5: BaseCoordFormat1 Table

Example 5 illustrates BaseCoordFormat1, which specifies single coordinate values in design units only. The font uses 2,048 design units/em. The example defines the default minimum extent coordinate for a math script.

Example 5

Hex Data

Source

Comments

BaseCoordFormat1

HorizMathMinCoordTable

;Definition of BaseCoord table

; for Math Min coordinate

0001

1

;BaseCoordFormat

; design units only

FEE8

-280

;Coordinate

; Y value, in design units


Example 6: BaseCoordFormat2 Table

Example 6 illustrates the BaseCoord Format 2. Like Example 5, it specifies the minimum extent coordinate for a math script. With this format, the coordinate value depends on the final position of a specific contour point on one glyph, the integral math symbol, after hinting. Again, the value is in design units (2,048 units/em).

Example 6

Hex Data

Source

Comments

BaseCoordFormat2

HorizMathMinCoordTable

;BaseCoord table definition

; for Math Min coordinate

0002

2

;BaseCoordFormat

; design units plus contour

; point

FEE8

-280

;Coordinate

; Y value, in design units

0128

IntegralSignGlyphID

;ReferenceGlyph

; math integral sign

0043

67

;BaseCoordPoint

; glyph contour point index


Example 7: BaseCoordFormat3 Table

Example 7 illustrates the BaseCoord Format 3. Like Examples 5 and 6, it specifies the minimum extent coordinate for a math script in design units (2,048 units/em). This format, however, uses a Device table to modify the coordinate value for the point size and resolution of the output font. Here, the Device table defines pixel adjustments for font sizes from 11 ppem to 15 ppem. The adjustments add one pixel at each size.

Example 7

Hex Data

Source

Comments

BaseCoordFormat3

HorizMathMinCoordTable

;BaseCoord table definition

; for Math Min coordinate

0003

3

;BaseCoordFormat

; design units plus device

; table

-280

;Coordinate

; Y value, in design units

000C

HorizMathMinCoordDeviceTable

;Offset to Device table

DeviceTableFormat1

HorizMathMinCoordDeviceTable

;Device table definition

; for MinCoord

000B

11

;StartSize —11 ppem

000F

15

;EndSize —15 ppem

0001

1

;DeltaFormat

; signed 2 bit value, 8 values

; per uint16

1

;Increase 11ppem by 1 pixel

1

;Increase 12ppem by 1 pixel

1

;Increase 13ppem by 1 pixel

1

;Increase 14ppem by 1 pixel

5540

1

;Increase 15ppem by 1 pixel