1libcaca-font(3caca) libcaca libcaca-font(3caca)
2
3
4
6 libcaca-font - The libcaca font format (version 1) All types are big
7 endian.
8
9 struct
10 {
11 magic:
12 uint8_t caca_header[2]; // ""
13 uint8_t caca_file_type[2]; // "FT"
14
15 font_header:
16 uint32_t control_size; // Control size (font_data - font_header)
17 uint32_t data_size; // Data size (EOF - font_data)
18
19 uint16_t version; // Font format version
20 // bit 0: set to 1 if font is compatible
21 // with version 1 of the format
22 // bits 1-15: unused yet, must be 0
23
24 uint16_t blocks; // Number of blocks in the font
25 uint32_t glyphs; // Total number of glyphs in the font
26
27 uint16_t bpp; // Bits per pixel for glyph data (valid
28 // Values are 1, 2, 4 and 8)
29 uint16_t width; // Standard glyph width
30 uint16_t height; // Standard glyph height
31 uint16_t maxwidth; // Maximum glyph width
32 uint16_t maxheight; // Maximum glyph height
33
34 uint16_t flags; // Feature flags
35 // bit 0: set to 1 if font is fixed width
36 // bits 1-15: unused yet, must be 0
37
38 block_info:
39 struct
40 {
41 uint32_t start; // Unicode index of the first glyph
42 uint32_t stop; // Unicode index of the last glyph + 1
43 uint32_t index; // Glyph info index of the first glyph
44 }
45 block_list[blocks];
46
47 glyph_info:
48 struct
49 {
50 uint16_t width; // Glyph width in pixels
51 uint16_t height; // Glyph height in pixels
52 uint32_t data_offset; // Offset (starting from data) to the data
53 // for the first character
54 }
55 glyph_list[glyphs];
56
57 control_extension_1:
58 control_extension_2:
59 ...
60 control_extension_N:
61 ... // reserved for future use
62
63 font_data:
64 uint8_t data[data_size]; // glyph data
65
66 data_extension_1:
67 data_extension_2:
68 ...
69 data_extension_N:
70 ... // reserved for future use
71 };
72
73Version 0.99.beta19 Thu Jul 22 2021 libcaca-font(3caca)