Fonts

This chapter explains about the fonts which AH Formatter V6.5 supports and how to use them. Also it explains the general consideration for each type of font. These are mainly for the non-Windows version. In the Windows version, the installed fonts are used as is without further effort.

The Font Configuration File is for setting the details of the font environment.
In non-Windows version: Although the initial file is prepared, you need to set it in accordance with your font environment.
In the Windows version: The font configuration file may be used as is.

Supported font formats

AH Formatter V6.5 supports the following types of fonts.

Adobe Type1 fonts

Adobe Type1 font usually consists of a pair of font files .AFM+.PFB or .PFM+.PFB. The former is used in non-Windows environment. The latter is used in Windows environment. For further information about Type1 fonts, see Adobe Type1 font.
In the following sentences, the word Type1 font indicates Adobe Type1 font.

OpenType font files have the extension .TTF or .OTF. The former has the TrueType outline information in the font file. The latter has the PostScript outline in the font file. Supports also OpenType Collection.
For further information about OpenType fonts, see OpenType (PostScript outline) font.

WOFF (Web Open Font Format)no-LT

You can treat WOFF (Web Open Font Format) by specifying to <axf:font-face>. WOFF fonts cannot be specified directly. The WOFF font specified by <axf:font-face> is treated as a TrueType font or an OpenType font. It's not necessary to specify the place where the WOFF font is located in the Font Configuration File.
These functions are not available with AH Formatter V6.5 Lite.

Macintosh TrueType font data fork suitcase

Supports Macintosh TrueType font Suitcase expressed by the .dfont extension or the .dfon extension. This is the Font Suitcase whose font is defined as the data fork. The old Font Suitcase, which is used by Classic MacOS and whose font is defined in the resource fork, is not supported. The contents is TrueType fonts. See also TrueType font, OpenType (TrueType outline) font for details about TrueType font.

CAUTION:

When different types of fonts with the same file name or the same font family name exist in the same directory, it is indefinite which one is adopted. Also there is a possibility to interfere with the operation. Please avoid such a mixture.

Font Configuration File

To configure the font environment for AH Formatter V6.5, you must make a Font Configuration File.

The Font Configuration File is a simple structured XML file and is usually located in the [Install directory]/etc on non-Windows and [Install directory] on Windows.

The Font Configuration File should be set in the Environment Variables .
The name font-config.xml is set as default.

In the Font Configuration File, the most important element is <font-folder>. If you want to use more than the PDF Standard 14 Fonts on non-Windows, you must locate the font files in the some directory and add the <font-folder path="..."> element to the configuration file.

AH Formatter V6.5 automatically detects the font files in the specified directory at the <font-folder path="...">.
However, there are a few cases where the font name cannot be resolved, only in such cases it is necessary to describe the font file. Normally it is not necessary to specify each file to be used.

In Windows version, all fonts installed in the Windows font directory are always available to use. AH Formatter V6.5 reads the information on the fonts available to use when starting up AH Formatter. In other words, the more the fonts exist, the more processing time is taken. This means that it may take more time to initialize fonts than time to format when formatting a small document. With a big document, the time to initialize font may not be significant. In order to save the time to initialize fonts, reduce the available fonts. There are the following three solutions available:

Reduce the font installed in the Windows font directory.

In the Font Configuration File, enumerate fonts that are not used in the Windows font directory by using the font-exclude attribute.

Prepare the separate directory where only necessary fonts are included and specify only that directory in the Font Configuration File.

A realistic solution may probably be 3. For example, put fonts you'd like to use in the directory of C:\MyFonts and prepare the Font Configuration File like the following:

The conventional evaluation method until V4.2 has defect that commonly used Japanese font such as Ryumin is displayed lower position. The new method resolved this defect, but there is baseline positioning difference between new and old method. If you use CJK and Latin fonts together, new method influences line-height. If you want to avoid incompatibility with conventional version, specify "windows".

use-preferred-family

true

Specifies whether the information on NameID=16 is used for a font family name with TrueType or OpenType.

windows-registry

enable

Effective only with Windows version. Specifies whether to get the information of EUDC from the Windows registry or not. If the value is "enable", it refers to the registry. If the value is "disable", it doesn't.

<font-folder>

child of <font-config>

path

Indicates the font folder using the "path" attribute.

<font-folder path="/home/user-name/fonts">
....
</font-folder>

This element can be specified as many times as necessary.

recursive

false

If true is specified, inside of the subfolder included in the folder specified by path will also be searched.

<font-entry>

child of <font-folder>

file

Associated attributes are given to the font file specified by the "file" attribute (base file name, without the wild card).

glyph-list

Specifies the glyph-list file of the font when the Type1 font is specified by the "file" attribute.
The glyph-list defines Unicode to glyph-name mapping rule for Type1 fonts.

skip-glyphname-mapping

true

Specifies whether to map Unicode to the glyph name or map Unicode to the character-code of the font when the Type1 font is specified by the "file" attribute. If "true" is specified, it maps. If "true" is specified, it doesn't.

font-exclude

false

Specifies whether to disregard the file specified by "File" attribute. If "true" is specified, it disregards. If "false" is specified, it doesn't. When "true" is specified, the font file is not processed.

unicode-range

Specifies the range of Unicode applied to the file specified by the "file" attribute. The setting can be done by the following format.
When unicode-range is not specified, it is considered as total range U+0-10FFFF.

<urange>{, <urange>}*

<urange> is a hexadecimal number with the preceding "U+" and one of the followings. Case insensitive.

U+4?? is equivalent to U+400-4FF. U+??? is equivalent to U+000-FFF. Unicode up to U+10FFFF is effective. Even if a range greater than U+10FFFF is specified, it is disregarded. When unicode-range is not specified, it is considered as total range U+0-10FFFF.

font-size-adjust

1

Adjusts the fontsize of the file specified by the "file" attribute. For instance, when specifying font-size-adjust="1.05", the output size is 1.05 times greater than the size specified in FO. It is also possible to specify it as "105%" using the % value.

baseline-adjust

0

Adjusts the baseline of the file specified by the "file" attribute. For instance, when specifying baseline-adjust="0.1", the value is added to the baseline specified in FO and adjusted to the added position. It is also possible to specify it as "10%" using the % value.

<font-alias>

child of <font-folder>

file

Indicates the alias name of the font family name. The source font file should be specified using the "file" and "entry" attributes. "file" attribute should specify font files (base file name, without the wild card). For Type1 fonts, specify the font files that have the .AFM or .PFM extensions.
For TrueType or OpenType fonts, you can specify the font files that have the .TTF or .TTC or .OTF extensions. The "entry" attributes should be the number of the fonts in the .TTC (TrueType Collection) file.
The number should be a numeric value of 1 or more. If the "entry" attribute is omitted, the value is considered as 1.
If the font is not .TTC, the value is ignored.

<font-alias file="simsun.ttc" entry="1">
....
</font-alias>

To define the alias names, enumerates the <alias> element within this element.
This element can be specified as many times as necessary.

entry

<alias>

child of <font-alias>

family-name

Indicates the actual alias name for the font described in the "font-alias" element. The alias information is specified using "family-name", "weight", "italic" attributes.
"family-name" attribute is the alias font family-name. Newly defined names should not match any other existing font-family names.
"weight" attribute is the alias font weight class. This attribute can be specified using a numeric value between "100" and "900" or the keyword "normal", "bold".
"italic" attribute indicates the font-style for italic. It should be specified using the keyword "true" or "false".
You can specify multiple alias definition for one font file.
This element can be specified as often as necessary.

It's possible to display the font file specified by <font-alias file> using the name and style specified here.

In the example above, font-family="MyArial" font-weight="normal"
should display "ARIALI.TTF", font-family="MyArial" font-weight="bold" should display "ARIALBI.TTF" differently.
Please note the following points.

When the italic font is originally specified, and even if font-style="normal" is specified, it doesn't become normal.

When the bold font is originally specified, and even if font-weight="normal" is specified, it doesn't become normal. Even if font-weight="bold" is specified, it doesn't become bolder.

When <alias> is specified, the file set in <font-alias file> is selected by the name and style and displayed. For instance, when font-style="italic" is specified and there is no <alias> with italic setting, normal is adopted.

weight

normal

italic

false

<eudc-processing>

child of <font-config>

mapping

enable

Specifies whether to process EUDC. If the "mapping" attribute is "enable", it processes EUDC. IF the "mapping" attribute is "disable", it doesn't.

<eudc-range>

child of <eudc-processing>

start

Specifies the range of EUDC by Unicode.

<eudc-range start="57344" end="63743"/>

Numeric value is specified. This sample indicates as 57344 = U+E000, 63743 = U+F8FF. If there is no numeric value specified, and the registry reference is effective with Windows version, it follows the instruction of the registry. If not, the PUA range is detected as (U+E000 to U+F8FF). When end is omitted, it is considered the same value as start. Multiple ranges can also be specified.

end

<eudc-system-default>

child of <eudc-processing>

file-path

Specifies the EUDC font file of the system default. It is adopted when there is no supported glyphs in the specified EUDC font. If there is no EUDC font file specified, and the registry reference is effective with Windows version, it follows the registry setting. At that time, the code page 932 is referred. If not, EUDC font of the system default is detected as nothing.

<eudc-map>

child of <eudc-processing>

family-name

Specifies the EUDC file by the "file-path" attribute, which is used when the character code of the EUDC range is specified to the font specified by the "family-name" attribute. If the registry reference is effective with Windows version, it is also taken into consideration. If there are the same "font-family" specified, the previous appearance takes precedence and the Font Configuration File takes precedence over the registry.
This element can be specified as often as necessary.

The current version of AH Formatter V6.5 does not support font outline files with .PFA (Printer Font ASCII) extension. Most Type1 font products are shipped in the .PFB format, which is supported by AH Formatter V6.5.

Type1 font metrics data which has the .MMM extension is not supported. This metrics file is used for the Multiple Master Type1 fonts.

Both.PFB and .PFM that maps to .PFB must exist in the same directory. Fonts may be installed in different directories by using ATM (Adobe Type Manager). Such fonts cannot be used for embedding with AH Formatter V6.5.

How to use Adobe Type1 fonts

If you want to use Adobe Type1 fonts, simply specify the font-family, font-weight and font-style property in the FO. The following FO example uses Helvetica for the fo:block.

<fo:block font-family="Helvetica" font-weight="bold" font-style="italic">
Helvetica (Bold-Italic) will be applied to this text.
</fo:block>

TrueType font, OpenType (TrueType outline) font

This section describes AH Formatter V6.5 implementation for TrueType and OpenType (TrueType outline) fonts. Tips on how to use these fonts in your environment are provided.

Font organization and necessary condition

TrueType fonts were originally developed by Apple Computer and have been used in the Windows environment. OpenType fonts were jointly developed by Adobe and Microsoft as cross-platform fonts. Due to the origin, OpenType fonts have two flavors/kinds. One has the TrueType outline. The other has the PostScript outline. OpenType font files that have the TrueType outline have the file extension .TTF or .TTC. OpenType font files that have the PostScript outline have the extension .OTF. This section treats original TrueType fonts and OpenType (TrueType outline) fonts together. From now on, we will use the term TrueType fonts as the contraction of TrueType font and OpenType (TrueType outline).

☞

Macintosh TrueType font data fork suitcase is also TrueType font and its extension is .dfont or .dfon. Although it's somehow different from .TTF, since the treatment of TrueType is almost the same, its description is omitted here.

TrueType fonts are composed of a single file which has the extension .TTF or .TTC. TTC is the abbreviation of the TrueType Collection. It contains plural TrueType fonts in a single file structure. It is sometimes used in the CJK fonts.

TrueType font requirements:

Font must have the cmap table which enables mapping the Unicode to glyph index. (Almost TrueType fonts have the cmap table available).

Some older TrueType fonts do not have Code Page information in the OS/2 table (ulCodePageRange1, 2) which can negatively influence AH Formatter V6.5's font selection algorithms. For this reason we recommend not using old TrueType fonts.

☞

Please visit the following sites to get more details about TrueType font (cmap table, etc)

How to use TrueType fonts

If you want to use TrueType fonts, locate the .TTF (.TTC) files in the directory specified in the <font-folder> element of the font configuration file. Then simply specify the font-family of the targeted font in FO.

<fo:block font-family="Arial" font-weight="bold" font-style="italic">
If you install arialbi.ttf file,
TrueType Arial (Bold-Italic) will be applied to this text.
</fo:block>

Embedding TrueType fonts

AH Formatter V6.5 supports embedding the TrueType font as well as the Type1 font into PDF. One big difference is the embedding license.
TrueType font has the license information in OS/2 tablefsType field. AH Formatter V6.5 respects this licensing information which will cause embedding errors when you specify font embedding against fonts with restrictions on embedding. In addition, only the used glyphs are embedded with the TrueType fonts.

☞

The "PDF Reference" says that TrueType fonts should be embedded to get predictable behavior across all viewer applications. If you don't embed TrueType fonts into the PDF file, Adobe Acrobat or Reader sometimes reports errors for particular Unicode character and font combinations.

OpenType (PostScript outline) font

This section describes how AH Formatter V6.5 implements OpenType (PostScript outline) fonts. Tips on how to use OpenType fonts more conveniently in your environment are provided.

Font organization and necessary condition

OpenType (PostScript outline) is one flavor of OpenType fonts as described in Font organization and necessary condition. OpenType (PostScript outline) font files have an extension .OTF and consists of only a single file. In addition, OpenType(PostScript outline) is classified into two categories. One is OpenType (PostScript) CID font and the other is OpenType (PostScript) non-CID font. The following table gives a brief description of these categories.

Type

Contents

Treatment in PDF

Non-CID font

Mainly contains Latin character glyphs. Glyphs are indexed using glyph name. It is the same as Type1 font.

Embedding OpenType (PostScript outline) fonts

Integrate the family name using the alias name

Some OpenType (PostScript outline) CID fonts have a family name defined per font file. Originally these fonts belonged to the same family and each font file has a different font-weight value.

Font file

Family-name

Weight

Italic

HeiseiKakuGoStd-W3.otf

"Heisei Kaku Gothic Std W3"

300

Normal

HeiseiKakuGoStd-W5.otf

"Heisei Kaku Gothic Std W5"

500

Normal

HeiseiKakuGoStd-W7.otf

"Heisei Kaku Gothic Std W7"

700

Normal

HeiseiKakuGoStd-W9.otf

"Heisei Kaku Gothic Std W9"

900

Normal

In the Windows environment it is not allowed to have more than three weight-values in the same family name. (Macintosh does allows such combinations). As a result, these fonts have different family name per font file. This makes it inconvenient to use these fonts using the different family name. To integrate the family names, the following alias descriptions to the font configuration file should be added.

EUDC

EUDC: End User Defined Character is available with AH Formatter V6.5.

Since the information on EUDC is acquired from the registry, it is not necessary to create EUDC information to the Font Configuration File with Windows version. However when EUDC information is described by the Font Configuration File, it is also taken into consideration. With non-Windows version, it is necessary to create EUDC information to the Font Configuration File in order to use EUDC.

A user does not need to be conscious of utilizing EUDC. AH Formatter V6.5 changes the font automatically by the character code.

Restrictions

There are V1 and V2 specifications for Indic OpenType Fonts. V2 is the specification published by Microsoft in 2008 and corresponds to the fonts included with Windows Vista or later. The main differences between V1 and V2 specifications are as follows.

The script tag was changed.

The way to divide text into syllables, which is the base of the text layout, was changed.

The treatment of ZWJ, ZWNJ and NBSP used for the selection of the typeface was clearly defined.

The behavior of consonant conjuncts or above-base vowel marks became font dependence.

Features to be applied for GSUB and GPOS were added.

The applying order of GSUB and GPOS features was changed.

AH Formatter V6.5 integrates fonts based on the V1 specification.
Many of fonts corresponding to the V2 specification are also included in the features of V1 specification.
Fonts that only have the V2 compliant are not supported.

There are some known problems in the Indic fonts implementation with AH Formatter V6.5.

With Kokila V5.* included with Windows Vista or later, the processing of Vattu is not correct. For example, a sequence of U+0915 U+094D U+0930 will be rendered as shown in the image on the right, although it should be rendered as shown on the left.

It seems that the processing of the V1-compliant font itself is not correct. Please use V1.00, etc.

Kokila V5.* included with Windows Vista or later only includes the features of the V2 specification. AH Formatter V6.5 conforms to the V1 specification, so this font cannot be handled correctly. We recommend to use the free Lohit font (Oriya). Lohit fonts are downloadable from the following site:

The following is not the problem of AH Formatter V6.5, hope you find it informative.

The typeface of Kokila V5.* included with Windows Vista or later is designed to be very small. Therefore, the balance is not very good when European languages etc. are mixed. We recommend to use the free KhmerOS font. KhmerOS fonts are downloadable from the following site: