This document describes the structure of the font definition file, including the typeface and font store file definitions.
Unicode characters can be used in font name strings. Details are given below.
A font definition file consists of a statement list, which defines typefaces and font store files.
<whole-file>
::=
<statement-list>
<statement>
::=
<typeface-statement>
|
<font-store-file-statement>
<typeface-statement>
::=
<font-store-file-statement>
::=
Note that in all cases a string must be enclosed in quotes,
e.g. "mystring"
.
To use an arbitrary Unicode character in a font name string,
insert a #
(hash) followed by exactly 4 hex digits for the Unicode
value of the character at the appropriate point in the string. For example, to
replace the second "a" in "Arial" with an "a-with-acute-accent" change the
string to read "Ari#00E1l"
.
Comments can be included in font definition files by using the
!
characterany text appearing after a !
on a
particular line is taken to be a comment.
Typeface
typeface-label
Name
typeface-name
[Symbol
] [Proportional
] [Serif
]
FontBitmaps
font-bitmap-reference-list
EndFontBitmaps
EndTypeface
The Typeface
statement defines a typeface and gives it
a label, typeface-label
.
The typeface also has a full name
typeface-name
.
The typeface may be a symbol typeface Symbol
and/or
proportional Proportional
and/or serif Serif
. If
Symbol
is not stated then the typeface is normal. If
Proportional
is not stated then the typeface is monospaced. If
Serif
is not stated then the typeface is sans-serif.
A typeface contains several font bitmaps, each defined by a reference:
<font-bitmap-reference>
::=
<font-bitmap-label>
|
<uid>
["WidthFactor
"
<width>
] ["HeightFactor
"
<height>
]
The font-bitmap-label
refers to the name of the font,
as specified by the FONT
statement in a BDF-format file.
Alternatively, you can specify the font by UID, which must correspond to the
UID of a font, as specified by the Uid
keyword in the BDF file's
properties section.
The font bitmap may be algorithmically enlarged by n-tupling the
width using WidthFactor
width
, and/or n-tupling the
height using HeightFactor
height
. This avoids the
need for too many font bitmap definitions. The example below shows a normal and
WidthFactor 2
character, (font: Times New Roman, 20 pixel, Bold
Italic Proportional):
FontStoreFile
CollectionUid
uid
KPixelAspectRatio
aspect-ratio
CopyrightInfo
copyright-info
EndCopyrightInfo
Typefaces
typeface-label-list
EndTypefaces
EndFontStoreFile
The FontStoreFile
statement defines a destination font
store file. The font store file is identified by its collection UID
uid. The UID must be specified in
decimal.
A font store file contains several typefaces, each defined by a
typeface-label
. The typeface-label
refers to a
previously defined typeface, in this compilation unit.
Copyright information is specified in the copyright clause
any number of lines of text, each of which must be surrounded by quotes
("
), between the CopyrightInfo
and
EndCopyrightInfo
keywords.
The aspect-ratio identifier gives the aspect
ratio of the device for which the font is designed
(1000*PixelHeightInTwips/PixelWidthInTwips
).