From 12989d4e6ad56d22893b636eccbf3d21f049e854 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 26 Feb 2026 16:54:28 -0300 Subject: [PATCH] [util] Align vector/raster defaults with view and update vector baselines --- test/vector/data/expected/basic/cff1.svg | 6 +++--- test/vector/data/expected/basic/cff2-var-cntr.svg | 6 +++--- test/vector/data/expected/basic/cff2-var-wght900.svg | 6 +++--- test/vector/data/expected/basic/default.svg | 2 +- test/vector/data/expected/basic/flat-cff1.svg | 6 +++--- test/vector/data/expected/basic/flat-precision-0.svg | 2 +- test/vector/data/expected/basic/flat-precision-4.svg | 2 +- test/vector/data/expected/basic/flat.svg | 2 +- test/vector/data/expected/basic/glyf-var-wght900.svg | 2 +- test/vector/data/expected/basic/glyf-vvar-ttb-wght900.svg | 8 ++++---- test/vector/data/expected/basic/multiline.svg | 2 +- test/vector/data/expected/basic/ttb.svg | 2 +- test/vector/data/expected/basic/upem-default.svg | 2 +- test/vector/data/expected/varc/conditional-default.svg | 2 +- test/vector/data/expected/varc/conditional-wght840p3.svg | 2 +- test/vector/data/expected/varc/default.svg | 4 ++-- test/vector/data/expected/varc/wght840p3.svg | 4 ++-- util/hb-raster.cc | 2 +- util/hb-vector.cc | 2 +- util/vector-output.hh | 5 ----- 20 files changed, 32 insertions(+), 37 deletions(-) diff --git a/test/vector/data/expected/basic/cff1.svg b/test/vector/data/expected/basic/cff1.svg index 059070e59..3cfaea262 100644 --- a/test/vector/data/expected/basic/cff1.svg +++ b/test/vector/data/expected/basic/cff1.svg @@ -1,4 +1,4 @@ - + @@ -7,6 +7,6 @@ - - + + diff --git a/test/vector/data/expected/basic/cff2-var-cntr.svg b/test/vector/data/expected/basic/cff2-var-cntr.svg index 8b9fabcd3..0079c1e47 100644 --- a/test/vector/data/expected/basic/cff2-var-cntr.svg +++ b/test/vector/data/expected/basic/cff2-var-cntr.svg @@ -1,4 +1,4 @@ - + @@ -7,6 +7,6 @@ - - + + diff --git a/test/vector/data/expected/basic/cff2-var-wght900.svg b/test/vector/data/expected/basic/cff2-var-wght900.svg index 8d24be661..d0b58f275 100644 --- a/test/vector/data/expected/basic/cff2-var-wght900.svg +++ b/test/vector/data/expected/basic/cff2-var-wght900.svg @@ -1,10 +1,10 @@ - + - - + + diff --git a/test/vector/data/expected/basic/default.svg b/test/vector/data/expected/basic/default.svg index a80b2ce85..b77a87de2 100644 --- a/test/vector/data/expected/basic/default.svg +++ b/test/vector/data/expected/basic/default.svg @@ -1,4 +1,4 @@ - + diff --git a/test/vector/data/expected/basic/flat-cff1.svg b/test/vector/data/expected/basic/flat-cff1.svg index 209abd225..9b6f42888 100644 --- a/test/vector/data/expected/basic/flat-cff1.svg +++ b/test/vector/data/expected/basic/flat-cff1.svg @@ -1,6 +1,6 @@ - + - - + + diff --git a/test/vector/data/expected/basic/flat-precision-0.svg b/test/vector/data/expected/basic/flat-precision-0.svg index 7c52efcc9..eabb07d73 100644 --- a/test/vector/data/expected/basic/flat-precision-0.svg +++ b/test/vector/data/expected/basic/flat-precision-0.svg @@ -1,4 +1,4 @@ - + diff --git a/test/vector/data/expected/basic/flat-precision-4.svg b/test/vector/data/expected/basic/flat-precision-4.svg index 66e057540..7cc0510a0 100644 --- a/test/vector/data/expected/basic/flat-precision-4.svg +++ b/test/vector/data/expected/basic/flat-precision-4.svg @@ -1,4 +1,4 @@ - + diff --git a/test/vector/data/expected/basic/flat.svg b/test/vector/data/expected/basic/flat.svg index 66e057540..7cc0510a0 100644 --- a/test/vector/data/expected/basic/flat.svg +++ b/test/vector/data/expected/basic/flat.svg @@ -1,4 +1,4 @@ - + diff --git a/test/vector/data/expected/basic/glyf-var-wght900.svg b/test/vector/data/expected/basic/glyf-var-wght900.svg index 43588876d..b0f36f456 100644 --- a/test/vector/data/expected/basic/glyf-var-wght900.svg +++ b/test/vector/data/expected/basic/glyf-var-wght900.svg @@ -1,4 +1,4 @@ - + diff --git a/test/vector/data/expected/basic/glyf-vvar-ttb-wght900.svg b/test/vector/data/expected/basic/glyf-vvar-ttb-wght900.svg index b55c4257c..8aa652089 100644 --- a/test/vector/data/expected/basic/glyf-vvar-ttb-wght900.svg +++ b/test/vector/data/expected/basic/glyf-vvar-ttb-wght900.svg @@ -1,4 +1,4 @@ - + @@ -6,7 +6,7 @@ - - - + + + diff --git a/test/vector/data/expected/basic/multiline.svg b/test/vector/data/expected/basic/multiline.svg index 4e0ce6c52..f58695d27 100644 --- a/test/vector/data/expected/basic/multiline.svg +++ b/test/vector/data/expected/basic/multiline.svg @@ -1,4 +1,4 @@ - + diff --git a/test/vector/data/expected/basic/ttb.svg b/test/vector/data/expected/basic/ttb.svg index 094bf6e4d..4b18afc2f 100644 --- a/test/vector/data/expected/basic/ttb.svg +++ b/test/vector/data/expected/basic/ttb.svg @@ -1,4 +1,4 @@ - + diff --git a/test/vector/data/expected/basic/upem-default.svg b/test/vector/data/expected/basic/upem-default.svg index a80b2ce85..b77a87de2 100644 --- a/test/vector/data/expected/basic/upem-default.svg +++ b/test/vector/data/expected/basic/upem-default.svg @@ -1,4 +1,4 @@ - + diff --git a/test/vector/data/expected/varc/conditional-default.svg b/test/vector/data/expected/varc/conditional-default.svg index 515a25554..0dba2a6c2 100644 --- a/test/vector/data/expected/varc/conditional-default.svg +++ b/test/vector/data/expected/varc/conditional-default.svg @@ -1,4 +1,4 @@ - + diff --git a/test/vector/data/expected/varc/conditional-wght840p3.svg b/test/vector/data/expected/varc/conditional-wght840p3.svg index 11b23332d..d9b86f1a8 100644 --- a/test/vector/data/expected/varc/conditional-wght840p3.svg +++ b/test/vector/data/expected/varc/conditional-wght840p3.svg @@ -1,4 +1,4 @@ - + diff --git a/test/vector/data/expected/varc/default.svg b/test/vector/data/expected/varc/default.svg index 61f69a399..7f7bc048c 100644 --- a/test/vector/data/expected/varc/default.svg +++ b/test/vector/data/expected/varc/default.svg @@ -1,4 +1,4 @@ - + @@ -6,5 +6,5 @@ - + diff --git a/test/vector/data/expected/varc/wght840p3.svg b/test/vector/data/expected/varc/wght840p3.svg index 63c11f933..8aecd4e38 100644 --- a/test/vector/data/expected/varc/wght840p3.svg +++ b/test/vector/data/expected/varc/wght840p3.svg @@ -1,4 +1,4 @@ - + @@ -6,5 +6,5 @@ - + diff --git a/util/hb-raster.cc b/util/hb-raster.cc index 5973fd918..7d70594a9 100644 --- a/util/hb-raster.cc +++ b/util/hb-raster.cc @@ -31,7 +31,7 @@ #include "shape-consumer.hh" #include "text-options.hh" -const unsigned DEFAULT_FONT_SIZE = FONT_SIZE_UPEM; +const unsigned DEFAULT_FONT_SIZE = 256; const unsigned SUBPIXEL_BITS = 6; int diff --git a/util/hb-vector.cc b/util/hb-vector.cc index a042ebc92..059e89c8d 100644 --- a/util/hb-vector.cc +++ b/util/hb-vector.cc @@ -29,7 +29,7 @@ #include "shape-consumer.hh" #include "text-options.hh" -const unsigned DEFAULT_FONT_SIZE = FONT_SIZE_UPEM; +const unsigned DEFAULT_FONT_SIZE = 256; const unsigned SUBPIXEL_BITS = 6; int diff --git a/util/vector-output.hh b/util/vector-output.hh index 91064281f..a18f0f17b 100644 --- a/util/vector-output.hh +++ b/util/vector-output.hh @@ -39,11 +39,6 @@ struct vector_output_t : output_options_t<>, view_options_t { static const bool repeat_shape = false; - vector_output_t () - { - margin = {0., 0., 0., 0.}; - } - ~vector_output_t () { hb_font_destroy (font);