7 #define AAF_GLYPH_MAX 256
22 struct aaf_glyph glyphs[AAF_GLYPH_MAX];
25 struct aaf_glyph_data {
26 /* variable size array of values 0-9 */
31 * Reads AAF informations about font
33 * @param in opened stream for reading
34 * @param _aaf reference to structure where read informations will be stored
36 * @return when succesful function returns 0, otherwise non-zero value
38 int read_aaf(FILE * in, struct aaf * _aaf);
41 * Reads AAF glyph data from input stream
42 * Returned structure is an array with number of elements equal to AAF_GLYPH_MAX.
43 * Every X element of array relates to _aaf->glyphs[X].
44 * Structure should be freed using free_aaf_glyph_data function.
46 * @param in opened input stream
47 * @param _aaf pointer to AAF header information
49 * @return when succesful returns pointer to newly allocated array of struct
50 * aaf_glyph_data. On error NULL is returned.
52 struct aaf_glyph_data ** read_aaf_glyph_data(FILE * in, struct aaf * _aaf);
55 * Function used to free data allocated using read_aaf_glyph_data.
57 * @param data pointer to array of glyph data
59 void free_aaf_glyph_data(struct aaf_glyph_data ** data);
62 * Writes AAF glyph as PGM image
64 * @param out opened output stream for writting
65 * @param glyph glyph description
66 * @param data glyph data
67 * @return 0 if data was written succesfully, negative value when error occured
69 int write_aaf_glyph_as_pgm(FILE * out, const struct aaf_glyph * glyph, const struct aaf_glyph_data * data);