diff options
author | James Bursa <james@netsurf-browser.org> | 2006-01-29 12:20:25 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2006-01-29 12:20:25 +0000 |
commit | 87d2b7aa8e9b6e2209776a73da67398c795cbcb3 (patch) | |
tree | fac5f022fcebbfe684643055813f8489138819af /rufl_internal.h | |
parent | 4581f7a89f79a828d161191f336a4444c8d2f9e8 (diff) | |
download | librufl-87d2b7aa8e9b6e2209776a73da67398c795cbcb3.tar.gz librufl-87d2b7aa8e9b6e2209776a73da67398c795cbcb3.tar.bz2 |
[project @ 2006-01-29 12:20:25 by bursa]
Improve handling of font weights. Now detects available weights better and supports up to 9 weights. Ignore control characters and spaces that are not spaces when scanning available characters.
svn path=/import/rufl/; revision=2470
Diffstat (limited to 'rufl_internal.h')
-rw-r--r-- | rufl_internal.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/rufl_internal.h b/rufl_internal.h index 8cd1759..670fcb2 100644 --- a/rufl_internal.h +++ b/rufl_internal.h @@ -2,7 +2,7 @@ * This file is part of RUfl * Licensed under the MIT License, * http://www.opensource.org/licenses/mit-license - * Copyright 2005 James Bursa <james@semichrome.net> + * Copyright 2006 James Bursa <james@semichrome.net> */ #include <limits.h> @@ -66,6 +66,13 @@ struct rufl_font_list_entry { struct rufl_character_set *charset; /** Mapping from Unicode to character code. */ struct rufl_unicode_map *umap; + /** Family that this font belongs to (index in rufl_family_list and + * rufl_family_map). */ + unsigned int family; + /** Font weight (0 to 8). */ + unsigned int weight; + /** Font slant (0 or 1). */ + unsigned int slant; }; /** List of all available fonts. */ extern struct rufl_font_list_entry *rufl_font_list; @@ -73,10 +80,15 @@ extern struct rufl_font_list_entry *rufl_font_list; extern unsigned int rufl_font_list_entries; -#define rufl_STYLES 4 - -/** Map from font family to fonts. rufl_STYLES entries per family. */ -extern unsigned int *rufl_family_map; +/** An entry in rufl_family_map. */ +struct rufl_family_map_entry { + /** This style does not exist in this family. */ +# define NO_FONT UINT_MAX + /** Map from weight and slant to index in rufl_font_list, or NO_FONT. */ + unsigned int font[9][2]; +}; +/** Map from font family to fonts, rufl_family_list_entries entries. */ +extern struct rufl_family_map_entry *rufl_family_map; /** No font contains this character. */ |