diff options
author | James Bursa <james@netsurf-browser.org> | 2005-02-27 22:23:24 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2005-02-27 22:23:24 +0000 |
commit | 058f82d652c57f0ef86ae01b615003226813f847 (patch) | |
tree | 5eae04c9fa2c9bb4120ea6119dcf9add445b98ab /rufl_internal.h | |
parent | 9119e81b1421631d1a6b3dadb89ca33754438cfb (diff) | |
download | librufl-058f82d652c57f0ef86ae01b615003226813f847.tar.gz librufl-058f82d652c57f0ef86ae01b615003226813f847.tar.bz2 |
[project @ 2005-02-27 22:23:24 by bursa]
Trade memory for speed to reduce substitution table construction time.
svn path=/import/rufl/; revision=2454
Diffstat (limited to 'rufl_internal.h')
-rw-r--r-- | rufl_internal.h | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/rufl_internal.h b/rufl_internal.h index 490554a..021694b 100644 --- a/rufl_internal.h +++ b/rufl_internal.h @@ -76,26 +76,10 @@ extern unsigned int rufl_font_list_entries; extern unsigned int *rufl_family_map; -/** Map from characters to a font which includes them. A typical machine might - * have characters from 30 blocks, giving 15616 bytes. */ -struct rufl_substitution_table { - /** Index table. Each entry represents a block of 256 characters, so - * i[k] refers to characters [256*k, 256*(k+1)). The value is either - * BLOCK_NONE_AVAILABLE or an offset into the block table. */ - unsigned char index[256]; - /** None of the characters in the block are available in any font. */ -# define BLOCK_NONE_AVAILABLE 255 - - /** Block table. Each entry is a map from the characters in the block - * to a font number which includes it, or NOT_AVAILABLE. */ - unsigned short block[255][256]; - /** No font contains this character. */ -# define NOT_AVAILABLE 65535 -}; - - +/** No font contains this character. */ +#define NOT_AVAILABLE 65535 /** Font substitution table. */ -extern struct rufl_substitution_table *rufl_substitution_table; +extern unsigned short *rufl_substitution_table; /** Number of slots in recent-use cache. This is the maximum number of RISC OS @@ -128,7 +112,6 @@ extern bool rufl_old_font_manager; bool rufl_character_set_test(struct rufl_character_set *charset, unsigned int c); -unsigned int rufl_substitution_lookup(unsigned int c); #define rufl_utf8_read(s, l, u) \ |