1CUBE2FONT(1) cube2font Manual CUBE2FONT(1)
2
3
4
6 cube2font - Utility program designed to create font bitmaps for Cube
7 Engine games
8
10 cube2font infile outfile outborder[:inborder] pad offset advance
11 charwidth charheight texwidth texheight [spacewidth spaceheight texdir]
12
14 cube2font is a utility program designed to create font bitmaps for Cube
15 Engine games, it works by taking a Truetype font and building it into a
16 set of coordinates in an image. cube2font is an improved version of the
17 previous TTF2Font, supporting a much larger range of characters.
18
19 The program outputs one or more PNG images containing a grid of charac‐
20 ters, so-called "texes", and an accompanying config file in plaintext,
21 which lists the character coordinates in the images.
22
24 infile
25 Path to input file in truetype format.
26
27 outfile
28 Sets the font name in the config file, and is also used as an
29 output filename template: A number and the .png extension will
30 be appended to the texes, and a .cfg extension to the coordinate
31 file.
32
33 outborder
34 Size of black outside border around each character on the texes.
35
36 inborder
37 Size of black border between the elements inside each character.
38
39 pad
40 Added padding around characters on the texes, to prevent them
41 "bleeding" into neighbouring characters.
42
43 offset
44 Added spacing to the left of each character when they are ren‐
45 dered ingame. If exaggerated it would look something like this:
46
47 | A| B|
48
49 advance
50 Added spacing to the right of each character when they are ren‐
51 dered ingame. If exaggerated it would look something like this:
52
53 |A |B |
54
55 charwidth
56 Width of generated characters on the texes.
57
58 charheight
59 Height of generated characters on the texes.
60
61 texwidth
62 Width of generated texes.
63
64 texheight
65 Height of generated texes.
66
67 spacewidth
68 Width of the standard space character size when rendered ingame,
69 defaults to a third of spaceheight if omitted or set to 0.
70
71 spaceheight
72 Height of the vertical character separation when rendered
73 ingame, defaults to the maximum vertical character range if
74 omitted or set to 0. This value is normally larger than
75 charheight, since it takes into account characters extending
76 outside the 'em' box. This value will make the rendered charac‐
77 ters scale to fit.
78
79 texdir
80 Sets the font directory path in the config file.
81
83 cube2font Play-Bold.ttf play 4 15 1 1 54 54 512 512 0 0 fonts/
84 Generates a font named play with a 4 pixel black border, an addi‐
85 tional 15 pixels of space around characters, one pixel of extra
86 spacing at both sides when displayed ingame, a character size of
87 54x54 pixels, a tex size of 512x512 pixels, a 23 pixels wide stan‐
88 dard space character, a 71 pixels high standard vertical line sepa‐
89 ration, and the font path set as fonts/
90
91 This would normally generate the files
92 play.cfg
93 play0.png
94 play1.png
95 play2.png
96
97 The above values are used for the base font.
98
99 cube2font default.ttf default 3 19 1 1 49 49 512 512 32 64 packages/fonts/
100 This generates the default font for the cube2 game Sauerbraten.
101
103 cube2font was created by Lee "eihrul" Salzman.
104
105 This manual page was written by Martin Erik Werner
106 <martinerikwerner@gmail.com>
107
108
109
110cube2font 1.3 2012-07-16 CUBE2FONT(1)