BPLtoBZR translates a human-readable (and -editable) text file in BPL format (see below) to the binary BZR (Bezier) font format.
Of the two, only BZR files can be changed into font formats which typesetting programs can use. So after editing a BPL file, you need to run this program. BZRedit likewise invokes it when necessary (see section BZRedit).
Bezier property list (BPL) files are free-format text files which describe an outline font. They are a transliteration of the binary BZR font format (see section BZR files).
A BPL file is a sequence of entries of the form
(property-name value1 value2 ...)
The property-name is one of a small set of keywords understood by BPLtoBZR. The values vary depending on the property being defined. BPL files have four types of values: unsigned integers, reals, strings (enclosed in typewriter double-quote `"' marks), and real strings (realstr for short)---a real number in quotes. See section Editing BPL files, for an explanation of why realstrs are necessary.
A property-name of comment
introduces a comment, which
continues through the next right parenthesis. This implies nested
comments are not allowed: `(comment (wrong!))' will get an
error at the second `)'.
BPL files have three parts: a preamble, character definitions, and a postamble. They must appear in that order. In many cases, the order in which you give the properties within a part is also significant.
The preamble of a BPL file consists of the following three properties:
(fontfile string)
. This merely documents the filename of
the BZR font from which BZRto made this BPL file. It is ignored.
(fontcomment string)
. This is an arbitrary string written
as the "comment" in the BZR file. BZR-reading programs ignore this
comment. It typically identifies the source and time of
creation. If string is longer than 255 characters, it is
truncated (due to limitations of the BZR format).
(designsize real)
. The design size of the font, in
printer's points.
A BPL file must have one or more character definitions. These have the following form:
(char unsigned width bounding-box outline1 outline2 ... )
The unsigned number directly after the char
command
specifies the character code. If it is larger than 255 (the maximum
character code in BZR files, and all other font formats the font
utilities deal with) then BPLtoBZR issues a warning and uses its value
modulo 256.
The other pieces are specified as properties:
(width realstr)
. The set width of the character in
printer's points.
(bb llx lly urx ury)
. The bounding box
of the character in printer's points, defined by the lower-left @math{x}
coordinate and the upper-right @math{y} coordinate. Each value is a
realstr. The left side bearing is defined by llx, and the right
side bearing is defined by the difference between the set width and
urx.
Each outline specifies a geometrical outline, i.e., a closed curve. For example, an `o' would have two outlines. If the character is entirely blank, the BPL file has no outlines at all.
The outline property is somewhat more complex than the rest, so we describe it below.
You specify an outline in a BPL file as a sequence of straight lines and cubic splines, in any order:
(outline start-x start-y piece1 piece2 ... )
start-x and start-y are realstrs which specify the initial position for drawing this outline. Each successive piece of the outline is relative to a current point, and also updates the current point.
At least one piece must be present. Each piece can be one of the following two properties:
line @math{x
@math{y}}. Draw a straight line from the current
point to @math{(x,y)}. Then set the current point to @math{(x,y)}.
@math{x} and @math{y} are realstrs.
spline c1x c1y c2x c2y ex ey
.
Draw the Bezier cubic using the current point as the starting point,
@math{(c1x,c1y)} and @math{(c2x,c2y)} as the control
points, and @math{(ex,ey)} as the endpoint. Then set the
current point to the endpoint. All coordinates are realstrs.
If the last point the last piece of the outline
is not the same
as the starting point, the result is undefined.
The final piece of a BPL file is the postamble. It has two components:
(fontbb llx lly urx ury)
. Defines the
bounding box for the entire font in the same way as the bb
property defines the bounding box for a character. See section BPL characters.
(nchars unsigned)
. The number of characters in the BPL
file. This is purely for informational purposes; BPLtoBZR ignores it.
This section describes the options that BPLtoBZR accepts. See section Command-line options, for general option syntax.