A couple of years ago I updated Crispy's tool to the D and SDL2 that was new back then. Since the SU makes it possible to use standard T3 fonts rendered on large textures without having to change anything but the .dds and .cel files, I had hope to provide updated textures with the SU. In practice I never managed to produce something that looked better everywhere... But since (
) here it is.
Code:
>fonttaff -h
FontTaffer v0.7.0 by Crispy (updates by snobel)
Usage: fonttaff [options] truetype.ttf
fonttaff [options] raster.fon
-h, --help Displays this message
-o, --output=FILENAME Output filename (optional)
-s, --size=FONTSIZE Font size to use (default 36)
-t, --texture-size=PIXELS Size of output texture (default 512)
-l, --line-spacing=FACTOR Line spacing (default 1.0)
-d, --boldish Render the font in pseudo-bold. Experimental, may
work better than bold for thin horizontal lines
-b, --bold Render the font in bold type
-i, --italic Render the font in italics
-x, --index=FONTINDEX Font index (default 0). You will
usually not have to change this
-r, --render-negx Render the full glyphs, including parts that
would normally 'go backwards' on the line
-u, --offset-left=PIXELS Shift all glyphs PIXELS pixels to the right
(default 0). See note below
-v, --offset-top=PIXELS Shift all glyphs PIXELS pixels downwards
(default 0). See note below
-w, --add-width=PIXELS Add PIXELS pixels on the right side of each glyph
(default 0). See note below
-e, --add-height=PIXELS Add PIXELS pixels on the bottom of each glyph
(default 0). See note below
-a, --adj-file=FILENAME File containing individual glyph adjustments.
See note below
-c, --oldcel-file=FILENAME Use padding, line height and character widths
from an existing .cel file instead of calculating
-p, --padding=PIXELS Number of blank pixels above each row and
before each glyph (default 1)
-g, --outline-glyphs Render the glyphs on a red background, to better
show the size of each. Implies --padding
--solid Render using the 'solid' mode (no anti-aliasing)
--shaded Render using the 'shaded' mode (not recommended)
--keep-low Include characters 0-31
--keep-high Include characters 127-159
--first=NUM Start at this character (default 0)
--last=NUM Stop at this character (default 255)
Note: No wildcards are allowed in filenames.
Note: Use the --offset-left and --offset-right options to adjust the placement
of the glyphs. Use the --add-width and --add-height options to adjust
the size of the glyphs. This will change the spacing, not the size of
the rendered characters. Negative values are allowed for all 4 options.
In addition to these adjustments which affect all characters, some may
need individual tuning. Use the --adj-file option to specify a file
containing lines of the following format:
<code> <offset-left> <offset-top> <add-width> [<comment>]
The <code> field can be decimal, hex (e.g. 0xA0) or a character (except
space) in single quotes. The values will be applied on top of the global
values for the specified character codes. Example: "32 0 0 6 ; SPC" will
widen SPACE by 6 pixels.
In all cases only small values make sense but adjustments for one glyph
will not affect the rendering of neighbouring glyphs. To get an idea of
how the characters will look, use the --outline-glyphs option.
Thanks to New Horizon and everyone else at TTLG!
This program is based in part on the work of the FreeType team
(http://www.freetype.org)
As an example, here's what a 1024-pixel papyrus texture may look like. (The optional red outline is helpful while matching replacement glyphs to the old fonts. It should be removed before generating the final texture because it does show up in certain texts in the game). Note that some characters, like "Q", have received special treatment by use of the --adj-file argument. (See the example files in the Test subfolder.)