11 /** Maximum allowed number of glyphs in AAF file */
12 #define AAF_GLYPH_MAX 256
15 * Structure containing information about given glyph
20 * The width (in pixels) of the glyph corresponding to its ascii
26 * The height (in pixels) of the glyph corresponding to its ascii
32 * The width (in pixels) of the glyph corresponding to its ascii
38 * Structure containing informations about AAF file
42 * Signature used to identify file type.
43 * Should be equal to: "AAFF"
48 * Maximum glyph Height.
49 * This is the maximum height of the glyph, including ascenders and
56 * Gap size (in pixels) between adjacent glyphs.
62 * The width of the space character.
68 * The number of pixels between two lines of glyphs.
72 struct aaf_glyph glyphs[AAF_GLYPH_MAX];
76 * Structure containing informations about glyph display
78 struct aaf_glyph_data {
80 * Variable size array containing values 0-9
82 * Array size can be calculated using: aaf_glyph::w * aaf_glyph::h
84 * 0 means that the pixel is transparent.
86 * The values 1 to 9 represent the relative brightness of that pixel,
87 * with 9 being the brightest. There does not appear to be a linear
88 * increase in brightness from values 1 to 9.
94 * Reads AAF informations about font
96 * @param in opened stream for reading
97 * @param _aaf reference to structure where read informations will be stored
99 * @return when succesful function returns 0, otherwise non-zero value
101 int aaf_read(FILE * in, struct aaf * _aaf);
104 * Reads AAF glyph data from input stream
105 * Returned structure is an array with number of elements equal to AAF_GLYPH_MAX.
106 * Every X element of array relates to _aaf->glyphs[X].
107 * Structure should be freed using aaf_free_glyph_data function.
109 * @param in opened input stream
110 * @param _aaf pointer to AAF header information
112 * @return when succesful returns pointer to newly allocated array of struct
113 * aaf_glyph_data. On error NULL is returned.
115 struct aaf_glyph_data ** aaf_read_glyph_data(FILE * in, struct aaf * _aaf);
118 * Function used to free memory allocated using aaf_read_glyph_data.
120 * @param data pointer to array of glyph data
122 void aaf_free_glyph_data(struct aaf_glyph_data ** data);
125 * Writes AAF glyph as PGM image
127 * @param out opened output stream for writting
128 * @param glyph glyph description
129 * @param data glyph data
130 * @return 0 if data was written succesfully, non-zero value when error occured
132 int aaf_write_glyph_as_pgm(FILE * out, const struct aaf_glyph * glyph, const struct aaf_glyph_data * data);