<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>libcaca documentation</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head> <body> <!-- $Id$ --> <!-- Generated by Doxygen 1.5.9 --> <div class="contents"> <h1><a class="anchor" name="libcaca-font">The libcaca font format (version 1) </a></h1>All types are big endian.<p> <div class="fragment"><pre class="fragment"><span class="keyword">struct</span> { magic: uint8_t caca_header[2]; <span class="comment">// "\xCA\xCA"</span> uint8_t caca_file_type[2]; <span class="comment">// "FT"</span> font_header: uint32_t control_size; <span class="comment">// Control size (font_data - font_header)</span> uint32_t data_size; <span class="comment">// Data size (EOF - font_data)</span> uint16_t version; <span class="comment">// Font format version</span> <span class="comment">// bit 0: set to 1 if font is compatible</span> <span class="comment">// with version 1 of the format</span> <span class="comment">// bits 1-15: unused yet, must be 0</span> uint16_t blocks; <span class="comment">// Number of blocks in the font</span> uint32_t glyphs; <span class="comment">// Total number of glyphs in the font</span> uint16_t bpp; <span class="comment">// Bits per pixel for glyph data (valid</span> <span class="comment">// Values are 1, 2, 4 and 8)</span> uint16_t width; <span class="comment">// Standard glyph width</span> uint16_t height; <span class="comment">// Standard glyph height</span> uint16_t maxwidth; <span class="comment">// Maximum glyph width</span> uint16_t maxheight; <span class="comment">// Maximum glyph height</span> uint16_t flags; <span class="comment">// Feature flags</span> <span class="comment">// bit 0: set to 1 if font is fixed width</span> <span class="comment">// bits 1-15: unused yet, must be 0</span> block_info: <span class="keyword">struct</span> { uint32_t start; <span class="comment">// Unicode index of the first glyph</span> uint32_t stop; <span class="comment">// Unicode index of the last glyph + 1</span> uint32_t index; <span class="comment">// Glyph info index of the first glyph</span> } block_list[blocks]; glyph_info: <span class="keyword">struct</span> { uint16_t width; <span class="comment">// Glyph width in pixels</span> uint16_t height; <span class="comment">// Glyph height in pixels</span> uint32_t data_offset; <span class="comment">// Offset (starting from data) to the data</span> <span class="comment">// for the first character</span> } glyph_list[glyphs]; control_extension_1: control_extension_2: ... control_extension_N: ... <span class="comment">// reserved for future use</span> font_data: uint8_t data[data_size]; <span class="comment">// glyph data</span> data_extension_1: data_extension_2: ... data_extension_N: ... <span class="comment">// reserved for future use</span> }; </pre></div> </div> <!-- $Id$ --> </body> </html>