1.1 --- a/include/font.h Tue Nov 13 00:34:10 2018 +0100
1.2 +++ b/include/font.h Tue Nov 13 12:57:52 2018 +0100
1.3 @@ -34,23 +34,36 @@
1.4
1.5 } char_definition_t;
1.6
1.7 +typedef struct
1.8 +{
1.9 + uint32_t base;
1.10 + uint32_t limit;
1.11 + uint32_t table[];
1.12 +
1.13 +} font_range_t;
1.14 +
1.15 /* Font configuration type. */
1.16
1.17 typedef struct
1.18 {
1.19 char_definition_t *chars;
1.20 - uint32_t *table;
1.21 - uint32_t base;
1.22 - uint32_t limit;
1.23 + font_range_t *range;
1.24
1.25 } font_config_t;
1.26
1.27
1.28
1.29 -/* Access functions. */
1.30 +/* Initialise a font.
1.31 +
1.32 + Font(<name>, uint8_t *chars, font_range_t *range)
1.33 +*/
1.34
1.35 -void init_font(font_config_t *cfg, uint8_t *chars, uint32_t *table,
1.36 - uint32_t base, uint32_t limit);
1.37 +#define Font(NAME, CHARS, RANGE) \
1.38 + font_config_t NAME = { \
1.39 + .chars = (char_definition_t *) (CHARS), \
1.40 + .range = RANGE};
1.41 +
1.42 +/* Access functions. */
1.43
1.44 char_definition_t *get_char_definition(font_config_t *cfg, char c);
1.45