source: libcaca/trunk/doc/font.dox @ 4333

Last change on this file since 4333 was 4333, checked in by Sam Hocevar, 10 years ago

Large source code cleanup, getting rid of spaces, tabs, and svn keywords.

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