From cca0ed9bcd91fbdb4611cfba51ebf068d50081ed Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 11 Jan 2023 06:44:25 -0500 Subject: [PATCH] test-paint: Add variable font tests These needs freetype master to work. --- .../test_glyphs-glyf_colr_1_variable.ttf | Bin 0 -> 70336 bytes test/api/results/testvf-10 | 22 ++++++++ test/api/results/testvf-106 | 30 +++++++++++ test/api/results/testvf-116 | 26 +++++++++ test/api/results/testvf-123 | 47 ++++++++++++++++ test/api/results/testvf-154 | 30 +++++++++++ test/api/results/testvf-165 | 22 ++++++++ test/api/results/testvf-175 | 36 +++++++++++++ test/api/results/testvf-6 | 21 ++++++++ test/api/results/testvf-92 | 21 ++++++++ test/api/test-paint.c | 51 ++++++++++++++---- 11 files changed, 296 insertions(+), 10 deletions(-) create mode 100644 test/api/fonts/test_glyphs-glyf_colr_1_variable.ttf create mode 100644 test/api/results/testvf-10 create mode 100644 test/api/results/testvf-106 create mode 100644 test/api/results/testvf-116 create mode 100644 test/api/results/testvf-123 create mode 100644 test/api/results/testvf-154 create mode 100644 test/api/results/testvf-165 create mode 100644 test/api/results/testvf-175 create mode 100644 test/api/results/testvf-6 create mode 100644 test/api/results/testvf-92 diff --git a/test/api/fonts/test_glyphs-glyf_colr_1_variable.ttf b/test/api/fonts/test_glyphs-glyf_colr_1_variable.ttf new file mode 100644 index 0000000000000000000000000000000000000000..9cc723015fccb1b28c961b57ab64dd8383c61571 GIT binary patch literal 70336 zcmeHw4SZEamglMazViJN@wvZzuHz&ThV5^9oy+<+WeT_Y1Y>g;cKe^WQ9Q>RXys$2J8r_Q~%?!EPh5m73Llc=V#q3OgYC$1)1*+SI6vSved z!^snWx`XJY{m}Zm`c2hMyEA?{gXsHRM4Mi3Y+f3ueQMoSA_g7W+T2pz(%*6HRbuWk z$OhYYhWgoOCw_>^A41x>eOD-aMdWuoh^vgm4l=kD8_GCdiMVl`|DEW3lIuNDlbL7IXNBYl<#3#_ zsghncJ_PV)#h`jJgUJuvl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KiV*2GVJ4#-9ll{zTHA&&%S*lLa-MxKg_)}qWALuCSnF1rMQtXcKYv;7*&=0AE>)Z J)je(u{ck;k-y;A3 literal 0 HcmV?d00001 diff --git a/test/api/results/testvf-10 b/test/api/results/testvf-10 new file mode 100644 index 000000000..9b399db29 --- /dev/null +++ b/test/api/results/testvf-10 @@ -0,0 +1,22 @@ +# random seed: R02S4cc6a292019f2eefbbaf24127cc6b053 +# Start of hb tests +# Start of paint tests +# Start of ot tests +start clip rectangle 0 0 1e+03 1e+03 + start transform 1 0 0 1 0 0 + start transform 1 0 -0 1 0 0 + start clip glyph 174 + start transform 1 0 0 1 0 0 + sweep gradient + center 500 600 + angles 0 6.28 + colors 0 + 0.25 250 240 230 255 + 0.417 0 0 255 255 + 0.583 255 0 0 255 + 0.75 47 79 79 255 + end transform + end clip + end transform + end transform +end clip diff --git a/test/api/results/testvf-106 b/test/api/results/testvf-106 new file mode 100644 index 000000000..58f65f897 --- /dev/null +++ b/test/api/results/testvf-106 @@ -0,0 +1,30 @@ +# random seed: R02Sa8358a35595768d4b3f0424c492c70f9 +# Start of hb tests +# Start of paint tests +# Start of ot tests +start clip rectangle 250 250 882 1.02e+03 + start transform 1 0 0 1 0 0 + start transform 1 0 -0 1 0 0 + start clip glyph 3 + start transform 1 0 0 1 0 0 + solid 0 0 255 127 + end transform + end clip + end transform + push group + start transform 1 0 0 1 1e+03 1e+03 + start transform 1 -0.364 -0.176 1 0 0 + start transform 1 0 0 1 -1e+03 -1e+03 + start transform 1 0 -0 1 0 0 + start clip glyph 3 + start transform 1 0 0 1 0 0 + solid 255 165 0 178 + end transform + end clip + end transform + end transform + end transform + end transform + pop group mode 4 + end transform +end clip diff --git a/test/api/results/testvf-116 b/test/api/results/testvf-116 new file mode 100644 index 000000000..9ac2926bf --- /dev/null +++ b/test/api/results/testvf-116 @@ -0,0 +1,26 @@ +# random seed: R02S5710187ea075c431f16412c38d1f7407 +# Start of hb tests +# Start of paint tests +# Start of ot tests +start clip rectangle 250 250 950 950 + start transform 1 0 0 1 0 0 + start transform 1 0 -0 1 0 0 + start clip glyph 3 + start transform 1 0 0 1 0 0 + solid 0 0 255 127 + end transform + end clip + end transform + push group + start transform 1 0 0 1 200 200 + start transform 1 0 -0 1 0 0 + start clip glyph 3 + start transform 1 0 0 1 0 0 + solid 255 165 0 178 + end transform + end clip + end transform + end transform + pop group mode 4 + end transform +end clip diff --git a/test/api/results/testvf-123 b/test/api/results/testvf-123 new file mode 100644 index 000000000..d2d8b6747 --- /dev/null +++ b/test/api/results/testvf-123 @@ -0,0 +1,47 @@ +# random seed: R02S486e6425a6369f1d079b0c273210d642 +# Start of hb tests +# Start of paint tests +# Start of ot tests +start clip rectangle 0 0 1e+03 1e+03 + start transform 1 0 0 1 0 0 + push group + start transform 1 0 -0 1 0 0 + start clip glyph 3 + start transform 1 0 0 1 0 0 + solid 0 0 0 255 + end transform + end clip + end transform + pop group mode 3 + push group + start transform 1 0 0 1 333 667 + start transform 0.5 0 0 0.5 0 0 + start transform 1 0 0 1 -333 -667 + start transform 1 0 -0 1 0 0 + start clip glyph 2 + start transform 1 0 0 1 0 0 + solid 255 220 1 255 + end transform + end clip + end transform + end transform + end transform + end transform + push group + start transform 1 0 0 1 667 333 + start transform 0.5 0 0 0.5 0 0 + start transform 1 0 0 1 -667 -333 + start transform 1 0 -0 1 0 0 + start clip glyph 2 + start transform 1 0 0 1 0 0 + solid 104 199 232 255 + end transform + end clip + end transform + end transform + end transform + end transform + pop group mode 5 + pop group mode 3 + end transform +end clip diff --git a/test/api/results/testvf-154 b/test/api/results/testvf-154 new file mode 100644 index 000000000..03eb4bcd9 --- /dev/null +++ b/test/api/results/testvf-154 @@ -0,0 +1,30 @@ +# random seed: R02S3997a362a4af7aea0e7c6f803c91771c +# Start of hb tests +# Start of paint tests +# Start of ot tests +start clip rectangle 0 500 500 1e+03 + start transform 1 0 0 1 0 0 + start transform 1 0 -0 1 0 0 + start clip glyph 2 + start transform 1 0 0 1 0 0 + radial gradient + p0 166 768 radius 0 + p1 166 768 radius 256 + colors 2 + 0 0 128 0 255 + 0.5 255 255 255 255 + 1 255 0 0 255 + end transform + end clip + end transform + push group + start transform 1 0 -0 1 0 0 + start clip glyph 159 + start transform 1 0 0 1 0 0 + solid 128 128 128 102 + end transform + end clip + end transform + pop group mode 3 + end transform +end clip diff --git a/test/api/results/testvf-165 b/test/api/results/testvf-165 new file mode 100644 index 000000000..94de0b720 --- /dev/null +++ b/test/api/results/testvf-165 @@ -0,0 +1,22 @@ +# random seed: R02S4f2af10d205b3b3052f5a575490a2686 +# Start of hb tests +# Start of paint tests +# Start of ot tests +start clip rectangle 100 250 1.2e+03 950 + start transform 1 0 0 1 0 0 + start transform 1 0 -0 1 0 0 + start clip glyph 165 + start transform 1 0 0 1 0 0 + linear gradient + p0 100 950 + p1 2.3e+03 950 + p2 -1e+03 250 + colors 0 + 0 255 0 0 255 + 0.5 0 0 255 255 + 1 255 255 0 255 + end transform + end clip + end transform + end transform +end clip diff --git a/test/api/results/testvf-175 b/test/api/results/testvf-175 new file mode 100644 index 000000000..f0b6e9acb --- /dev/null +++ b/test/api/results/testvf-175 @@ -0,0 +1,36 @@ +# random seed: R02S4c022e014005a52e2898416210be4ddf +# Start of hb tests +# Start of paint tests +# Start of ot tests +start clip rectangle 0 0 1e+03 1e+03 + start transform 1 0 0 1 0 0 + push group + start transform 1 0 0 1 150 0 + start transform 1 0 -0 1 0 0 + start clip glyph 174 + start transform 1 0 0 1 0 0 + solid 0 128 0 255 + end transform + end clip + end transform + end transform + pop group mode 3 + push group + start transform 1 0 0 1 -150 0 + start transform 1 0 -0 1 0 0 + start clip glyph 174 + start transform 1 0 0 1 0 0 + linear gradient + p0 500 250 + p1 500 950 + p2 600 250 + colors 1 + 0 255 0 0 255 + 1 0 0 255 255 + end transform + end clip + end transform + end transform + pop group mode 3 + end transform +end clip diff --git a/test/api/results/testvf-6 b/test/api/results/testvf-6 new file mode 100644 index 000000000..73c70edf6 --- /dev/null +++ b/test/api/results/testvf-6 @@ -0,0 +1,21 @@ +# random seed: R02Sc96e8c0cb2d824e493d9a1088730d188 +# Start of hb tests +# Start of paint tests +# Start of ot tests +start clip rectangle 100 250 900 950 + start transform 1 0 0 1 0 0 + start transform 1 0 -0 1 0 0 + start clip glyph 6 + start transform 1 0 0 1 0 0 + linear gradient + p0 100 250 + p1 900 250 + p2 100 300 + colors 1 + 0 255 0 0 255 + 1 0 0 255 255 + end transform + end clip + end transform + end transform +end clip diff --git a/test/api/results/testvf-92 b/test/api/results/testvf-92 new file mode 100644 index 000000000..382d1ac77 --- /dev/null +++ b/test/api/results/testvf-92 @@ -0,0 +1,21 @@ +# random seed: R02See3981a17ce77670e1392178e6b57952 +# Start of hb tests +# Start of paint tests +# Start of ot tests +start clip rectangle 0 0 1e+03 1e+03 + start transform 1 0 0 1 0 0 + start transform 1 0 -0 1 0 0 + start clip glyph 2 + start transform 1 0 0 1 0 0 + radial gradient + p0 166 768 radius 0 + p1 166 768 radius 256 + colors 1 + 0 0 128 0 255 + 0.5 255 255 255 255 + 1 255 0 0 255 + end transform + end clip + end transform + end transform +end clip diff --git a/test/api/test-paint.c b/test/api/test-paint.c index d147027f8..93480f7b0 100644 --- a/test/api/test-paint.c +++ b/test/api/test-paint.c @@ -304,12 +304,13 @@ typedef struct { #define NOTO_HAND "fonts/noto_handwriting-cff2_colr_1.otf" #define TEST_GLYPHS "fonts/test_glyphs-glyf_colr_1.ttf" +#define TEST_GLYPHS_VF "fonts/test_glyphs-glyf_colr_1_variable.ttf" #define BAD_COLRV1 "fonts/bad_colrv1.ttf" #define ROCHER_ABC "fonts/RocherColorGX.abc.ttf" /* To verify the rendering visually, use * - * hb-view --font-size SCALE --font-slant SLANT --font-palette PALETTE FONT --glyphs [gidGID=0+1000] + * hb-view --font-slant SLANT --font-palette PALETTE FONT --glyphs [gidGID=0+1000] * * where GID is the glyph value of the test. */ @@ -317,6 +318,7 @@ static paint_test_t paint_tests[] = { /* COLRv1 */ { NOTO_HAND, 0., 10, 0, "hand-10" }, { NOTO_HAND, 0.2, 10, 0, "hand-10.2" }, + { TEST_GLYPHS, 0, 6, 0, "test-6" }, // linear gradient { TEST_GLYPHS, 0, 10, 0, "test-10" }, // sweep gradient { TEST_GLYPHS, 0, 92, 0, "test-92" }, // radial gradient @@ -326,7 +328,19 @@ static paint_test_t paint_tests[] = { { TEST_GLYPHS, 0, 154, 0, "test-154" }, { TEST_GLYPHS, 0, 165, 0, "test-165" }, // linear gradient { TEST_GLYPHS, 0, 175, 0, "test-175" }, // layers + + { TEST_GLYPHS_VF, 0, 6, 0, "testvf-6" }, + { TEST_GLYPHS_VF, 0, 10, 0, "testvf-10" }, + { TEST_GLYPHS_VF, 0, 92, 0, "testvf-92" }, + { TEST_GLYPHS_VF, 0, 106, 0, "testvf-106" }, + { TEST_GLYPHS_VF, 0, 116, 0, "testvf-116" }, + { TEST_GLYPHS_VF, 0, 123, 0, "testvf-123" }, + { TEST_GLYPHS_VF, 0, 154, 0, "testvf-154" }, + { TEST_GLYPHS_VF, 0, 165, 0, "testvf-165" }, + { TEST_GLYPHS_VF, 0, 175, 0, "testvf-175" }, + { BAD_COLRV1, 0, 154, 0, "bad-154" }, // recursion + /* COLRv0 */ { ROCHER_ABC, 0.3, 1, 0, "rocher-1" }, { ROCHER_ABC, 0.3, 2, 2, "rocher-2" }, @@ -443,21 +457,15 @@ test_hb_paint (gconstpointer d, } static void -test_compare_ot_ft (gconstpointer d) +test_compare_ot_ft (const char *file, hb_codepoint_t glyph) { - hb_codepoint_t glyph = GPOINTER_TO_UINT (d); hb_face_t *face; hb_font_t *font; hb_paint_funcs_t *funcs; GString *ot_str; paint_data_t data; -#ifndef HAVE_FT_COLRv1 - g_test_skip ("FreeType COLRv1 support not present"); - return; -#endif - - face = hb_test_open_font_file (TEST_GLYPHS); + face = hb_test_open_font_file (file); font = hb_font_create (face); funcs = get_test_paint_funcs (); @@ -471,7 +479,9 @@ test_compare_ot_ft (gconstpointer d) ot_str = data.string; +#ifdef HAVE_FT_COLRv1 hb_ft_font_set_funcs (font); +#endif data.string = g_string_new (""); data.level = 0; @@ -505,6 +515,26 @@ test_hb_paint_ft (gconstpointer data) #endif } +static void +test_compare_ot_ft_novf (gconstpointer d) +{ +#ifdef HAVE_FT_COLRv1 + test_compare_ot_ft (TEST_GLYPHS, GPOINTER_TO_UINT (d)); +#else + g_test_skip ("FreeType COLRv1 support not present"); +#endif +} + +static void +test_compare_ot_ft_vf (gconstpointer d) +{ +#ifdef HAVE_FT_COLRv1 + test_compare_ot_ft (TEST_GLYPHS_VF, GPOINTER_TO_UINT (d)); +#else + g_test_skip ("FreeType COLRv1 support not present"); +#endif +} + static void scrutinize_linear_gradient (hb_paint_funcs_t *funcs, void *paint_data, @@ -617,7 +647,8 @@ main (int argc, char **argv) { char buf[20]; snprintf (buf, 20, "test-%u", i); - hb_test_add_data_flavor (GUINT_TO_POINTER (i), buf, test_compare_ot_ft); + hb_test_add_data_flavor (GUINT_TO_POINTER (i), buf, test_compare_ot_ft_novf); + hb_test_add_data_flavor (GUINT_TO_POINTER (i), buf, test_compare_ot_ft_vf); } hb_face_destroy (face);