diff options
author | John-Mark Bell <jmb@netsurf-browser.org> | 2021-08-15 03:47:10 +0100 |
---|---|---|
committer | John-Mark Bell <jmb@netsurf-browser.org> | 2021-08-15 03:47:10 +0100 |
commit | 421bacf56744d00db7ccef93daa119ab8ea4ac55 (patch) | |
tree | 7bd9dadd15bb9761ab1229d5c62215841cf9846e | |
parent | d59f17a6fb3d4f20a931ab45bf60ff910685b241 (diff) | |
download | librufl-421bacf56744d00db7ccef93daa119ab8ea4ac55.tar.gz librufl-421bacf56744d00db7ccef93daa119ab8ea4ac55.tar.bz2 |
Make dump of unicode maps optional
Add a verbose flag to rufl_dump_state() and use it to control
whether to dump the individual unicode maps generated when using
a non-UCS Font Manager.
Change rufl_test to not dump this state (ordinarily, anyway) as
it is generally uninteresting and highly verbose.
-rw-r--r-- | include/rufl.h | 2 | ||||
-rw-r--r-- | src/rufl_dump_state.c | 4 | ||||
-rw-r--r-- | test/rufl_test.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/include/rufl.h b/include/rufl.h index 0164df8..15e889e 100644 --- a/include/rufl.h +++ b/include/rufl.h @@ -185,7 +185,7 @@ rufl_code rufl_font_bbox(const char *font_family, rufl_style font_style, * Dump the internal library state to stdout. */ -void rufl_dump_state(void); +void rufl_dump_state(bool verbose); /** diff --git a/src/rufl_dump_state.c b/src/rufl_dump_state.c index 860d57e..f466333 100644 --- a/src/rufl_dump_state.c +++ b/src/rufl_dump_state.c @@ -18,7 +18,7 @@ static void rufl_dump_unicode_map(struct rufl_unicode_map *umap); * Dump the internal library state to stdout. */ -void rufl_dump_state(void) +void rufl_dump_state(bool verbose) { unsigned int i, j; @@ -32,7 +32,7 @@ void rufl_dump_state(void) } else { printf(" (no charset table)\n"); } - if (rufl_font_list[i].umap) { + if (verbose && rufl_font_list[i].umap) { for (j = 0; j < rufl_font_list[i].num_umaps; j++) { struct rufl_unicode_map *map = rufl_font_list[i].umap + j; diff --git a/test/rufl_test.c b/test/rufl_test.c index d939467..5b76f81 100644 --- a/test/rufl_test.c +++ b/test/rufl_test.c @@ -35,7 +35,7 @@ int main(void) int bbox[4]; try(rufl_init(), "rufl_init"); - rufl_dump_state(); + rufl_dump_state(false); try(rufl_paint("NewHall", rufl_WEIGHT_400, 240, utf8_test, sizeof utf8_test - 1, 1200, 1000, 0), "rufl_paint"); |