diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-08-31 03:13:23 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-08-31 03:13:23 +0200 |
| commit | cf63fa9e34bcca6e4d2252f49d8331ef643f2bec (patch) | |
| tree | 0eb9a5a8d8fd761cac5fe2642e9aad9fa57c4e18 /tests/text.c | |
| parent | 93dc4d861ed1e4ed15e91307158c11b7db5f1f5f (diff) | |
debug font cache
Diffstat (limited to 'tests/text.c')
| -rw-r--r-- | tests/text.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/tests/text.c b/tests/text.c index 65165bc..da4ee14 100644 --- a/tests/text.c +++ b/tests/text.c @@ -152,23 +152,29 @@ void test(){ vkvg_destroy(ctx); } - -void test_mono () { +void random_text () { VkvgContext ctx = vkvg_create(surf); - vkvg_set_source_rgb(ctx,1,1,1); + vkvg_clear(ctx); vkvg_select_font_face(ctx,"mono"); - vkvg_set_font_size(ctx, 20); - vkvg_move_to(ctx,100,100); - vkvg_show_text(ctx,"This is a test string!"); + for (uint32_t i=0; i<test_size; i++) { + randomize_color(ctx); + float x = (float)rand()/RAND_MAX * test_width; + float y = (float)rand()/RAND_MAX * test_height; + uint32_t c = (uint32_t)((float)rand()/RAND_MAX * 80)+1; + + vkvg_set_font_size(ctx, c); + vkvg_move_to(ctx,x,y); + vkvg_show_text(ctx,"This is a test string!"); + } vkvg_destroy(ctx); } - int main(int argc, char *argv[]) { - PERFORM_TEST (test_mono, argc, argv); - /*PERFORM_TEST (test, argc, argv); + //vkvg_log_level = VKVG_LOG_INFO; + PERFORM_TEST (random_text, argc, argv); + PERFORM_TEST (test, argc, argv); PERFORM_TEST (test1, argc, argv); - PERFORM_TEST (test2, argc, argv);*/ + PERFORM_TEST (test2, argc, argv); return 0; } |