From de3011962e62d4d60dc2bcc192c2e1691f336f46 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 22 Oct 2026 07:01:35 -0600 Subject: [PATCH] [subset] Round CFF2 instances on absolute coordinates (#6427) Rounding relative charstring operands independently accumulates errors, opening contours and displacing stem hints after instancing. Track absolute outline coordinates and stem edges, round their defaults and surviving variation deltas, then emit relative operands again. Preserve compact path operators. Conservatively retain relative rounding for every glyph containing flex1, avoiding variation-dependent direction analysis. Leave charstrings without blends unchanged. Add a generated regression font covering closed contours, compact curves, flexes, masks, and fractional static operands. Check full and partial instances, contour closure, point accuracy, and the flex1 fallback. Refresh the existing serialized CFF expectations. Testing: the complete Meson suite passes (294 passed, one skipped), as do the CFF2 API tests under ASan and UBSan. See-also: https://github.com/fonttools/fonttools/pull/4338 Assisted-by: OpenAI Codex --- CMakeLists.txt | 1 + src/hb-cff2-interp-cs.hh | 8 +- src/hb-subset-cff-common.hh | 2 + src/hb-subset-cff2-round.hh | 161 +++++++++++++ src/hb-subset-cff2.cc | 215 ++++++++++++------ src/meson.build | 1 + .../api/fonts/AdobeVFPrototype.abc.static.otf | Bin 2576 -> 1772 bytes test/api/fonts/cff2-rounding.otf | Bin 0 -> 6932 bytes test/api/generate-cff2-rounding-font.py | 130 +++++++++++ test/api/test-instance-cff2.c | 151 ++++++++++++ ...,6F,20,57,6F,72,6C,64.wght=650,opsz=48.otf | Bin 2916 -> 2912 bytes ....downgrade-cff2-iftb.41,42,43.wght=650.otf | Bin 1528 -> 1528 bytes ...Prototype.default.all.wght=650,CNTR=50.otf | Bin 41760 -> 41760 bytes ...VFPrototype.default.41,42,43.CNTR=drop.otf | Bin 3548 -> 3536 bytes ...t.41,42,43.wght=300-500-700,CNTR=25-75.otf | Bin 4360 -> 4348 bytes ...rototype.default.41,42,43.wght=300-600.otf | Bin 4080 -> 4072 bytes ...e.default.41,42,43.wght=500,CNTR=0-100.otf | Bin 2384 -> 2288 bytes ...AdobeVFPrototype.default.all.CNTR=drop.otf | Bin 96984 -> 96868 bytes ...efault.all.wght=300-500-700,CNTR=25-75.otf | Bin 174384 -> 173180 bytes ...beVFPrototype.default.all.wght=300-600.otf | Bin 142044 -> 140996 bytes ...totype.default.all.wght=500,CNTR=0-100.otf | Bin 66448 -> 57468 bytes ...ype_vsindex.default.41,42,43.CNTR=drop.otf | Bin 3136 -> 3124 bytes ...t.41,42,43.wght=300-500-700,CNTR=25-75.otf | Bin 3856 -> 3856 bytes ..._vsindex.default.41,42,43.wght=300-600.otf | Bin 3548 -> 3548 bytes ...x.default.41,42,43.wght=500,CNTR=0-100.otf | Bin 2200 -> 2132 bytes ...rototype_vsindex.default.all.CNTR=drop.otf | Bin 3136 -> 3124 bytes ...efault.all.wght=300-500-700,CNTR=25-75.otf | Bin 3856 -> 3856 bytes ...otype_vsindex.default.all.wght=300-600.otf | Bin 3548 -> 3548 bytes ...sindex.default.all.wght=500,CNTR=0-100.otf | Bin 2200 -> 2132 bytes ...t.default.5005,5006,5009,500D.wght=300.otf | Bin 2124 -> 2124 bytes 30 files changed, 602 insertions(+), 67 deletions(-) create mode 100644 src/hb-subset-cff2-round.hh create mode 100644 test/api/fonts/cff2-rounding.otf create mode 100644 test/api/generate-cff2-rounding-font.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d5bba246..ce9e8814b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,6 +199,7 @@ set (subset_project_sources ${PROJECT_SOURCE_DIR}/src/hb-subset-cff-common.hh ${PROJECT_SOURCE_DIR}/src/hb-subset-cff1.cc ${PROJECT_SOURCE_DIR}/src/hb-subset-cff2.cc + ${PROJECT_SOURCE_DIR}/src/hb-subset-cff2-round.hh ${PROJECT_SOURCE_DIR}/src/hb-subset-input.cc ${PROJECT_SOURCE_DIR}/src/hb-subset-input.hh ${PROJECT_SOURCE_DIR}/src/hb-subset-instancer-iup.hh diff --git a/src/hb-cff2-interp-cs.hh b/src/hb-cff2-interp-cs.hh index af810c362..2b705d49f 100644 --- a/src/hb-cff2-interp-cs.hh +++ b/src/hb-cff2-interp-cs.hh @@ -201,6 +201,9 @@ struct cff2_cs_interp_env_t : cs_interp_env_t bool have_coords () const { return num_coords; } + /* Subsetter instancing can defer rounding until absolute points are known. */ + bool round_blends = true; + protected: const int *coords; unsigned int num_coords; @@ -263,7 +266,10 @@ struct cff2_cs_opset_t : cs_opset_t, PAR unsigned n, unsigned i) { if (env.have_coords ()) - arg.set_int (round (arg.to_real () + env.blend_deltas (blends))); + { + double v = arg.to_real () + env.blend_deltas (blends); + arg.set_real (env.round_blends ? round (v) : v); + } else if (unlikely (arg.blending ())) { /* A blend result used as an operand of a later blend: the value is diff --git a/src/hb-subset-cff-common.hh b/src/hb-subset-cff-common.hh index 7ae3e3ea1..ec5afd810 100644 --- a/src/hb-subset-cff-common.hh +++ b/src/hb-subset-cff-common.hh @@ -345,6 +345,7 @@ struct cs_command_t typedef hb_vector_t *cs_command_vec_t; struct cff2_instancing_plan_t; +struct cff2_cs_rounding_t; struct flatten_param_t { @@ -362,6 +363,7 @@ struct flatten_param_t /* CFF2 partial instancing: when set, blends are rewritten against the * instanced variation store instead of being copied or flattened. */ const cff2_instancing_plan_t *instancer = nullptr; + cff2_cs_rounding_t *rounding = nullptr; bool emitted_blend = false; }; diff --git a/src/hb-subset-cff2-round.hh b/src/hb-subset-cff2-round.hh new file mode 100644 index 000000000..a2f0d1997 --- /dev/null +++ b/src/hb-subset-cff2-round.hh @@ -0,0 +1,161 @@ +/* + * CFF2 instancing: round absolute outline points and stem edges before + * converting them back to relative operands (fonttools/fonttools#4338). + */ + +#ifndef HB_SUBSET_CFF2_ROUND_HH +#define HB_SUBSET_CFF2_ROUND_HH + +#include "hb-cff2-interp-cs.hh" + +namespace CFF { + +struct cff2_cs_rounding_t +{ + struct coordinate_t + { + double value = 0.; + hb_vector_t deltas; + + bool round (blend_arg_t &arg, unsigned k) + { + if (unlikely (!deltas.resize (k) || !arg.deltas.resize (k))) + return false; + + double previous = value; + value += arg.to_real (); + /* OpenType rounding, including negative half-integers. */ + arg.number_t::set_real (floor (value + .5) - floor (previous + .5)); + bool variable = false; + for (unsigned r = 0; r < k; r++) + { + previous = deltas.arrayZ[r]; + deltas.arrayZ[r] += arg.deltas.arrayZ[r].to_real (); + double d = floor (deltas.arrayZ[r] + .5) - floor (previous + .5); + arg.deltas.arrayZ[r].set_real (d); + variable |= d != 0.; + } + if (!variable) arg.deltas.clear (); + return true; + } + }; + + bool round (op_code_t op, hb_array_t args, unsigned k) + { + unsigned n = args.length; + switch (op) + { + case OpCode_rmoveto: + return n == 2 && alternating (args, k); + case OpCode_hmoveto: + case OpCode_vmoveto: + return n == 1 && point[op == OpCode_vmoveto].round (args[0], k); + case OpCode_rlineto: + return n && !(n % 2) && alternating (args, k); + case OpCode_rrcurveto: + return n && !(n % 6) && alternating (args, k); + case OpCode_rcurveline: + return n >= 8 && !((n - 2) % 6) && alternating (args, k); + case OpCode_rlinecurve: + return n >= 8 && !(n % 2) && alternating (args, k); + case OpCode_hlineto: + case OpCode_vlineto: + return n && alternating (args, k, op == OpCode_vlineto); + + case OpCode_hhcurveto: + case OpCode_vvcurveto: + { + if (unlikely (n < 4 || (n % 4) > 1)) return false; + unsigned axis = op == OpCode_vvcurveto; + unsigned i = 0; + if (n & 1) + if (!point[!axis].round (args[i++], k)) return false; + for (; i < n; i += 4) + { + if (!point[axis].round (args[i], k) || + !point[0].round (args[i + 1], k) || + !point[1].round (args[i + 2], k) || + !point[axis].round (args[i + 3], k)) return false; + } + return true; + } + + case OpCode_hvcurveto: + case OpCode_vhcurveto: + { + if (unlikely (n < 4 || (n % 4) > 1)) return false; + unsigned axis = op == OpCode_vhcurveto; + unsigned i = 0; + for (; i + 4 <= n; i += 4, axis = !axis) + { + if (!point[axis].round (args[i], k) || + !point[0].round (args[i + 1], k) || + !point[1].round (args[i + 2], k) || + !point[!axis].round (args[i + 3], k)) return false; + if (i + 5 == n) + return point[axis].round (args[i + 4], k); + } + return true; + } + + case OpCode_flex: + if (unlikely (n != 13 || !alternating (args.sub_array (0, 12), k))) + return false; + args[12].number_t::set_real (floor (args[12].to_real () + .5)); + for (auto &d : args[12].deltas) d.set_real (floor (d.to_real () + .5)); + return true; + + case OpCode_hflex: + case OpCode_hflex1: + { + if (unlikely (n != (op == OpCode_hflex ? 7u : 9u))) return false; + /* These operators implicitly return to the initial y coordinate. */ + coordinate_t y = point[1]; + if (unlikely (y.deltas.in_error ())) return false; + for (unsigned i = 0; i < n; i++) + { + unsigned axis = op == OpCode_hflex ? i == 2 : i == 1 || i == 3 || i == 7; + if (!point[axis].round (args[i], k)) return false; + } + point[1] = std::move (y); + return true; + } + + case OpCode_hstem: + case OpCode_hstemhm: + case OpCode_vstem: + case OpCode_vstemhm: + case OpCode_hintmask: + case OpCode_cntrmask: + { + /* Stem operands are successive edges, relative to zero per operator. + * A mask's operands declare implicit vertical stems. */ + coordinate_t stem; + if (unlikely (n % 2)) return false; + for (auto &arg : args) + if (!stem.round (arg, k)) return false; + return true; + } + + default: + return true; + } + } + + private: + bool alternating (hb_array_t args, unsigned k, unsigned axis = 0) + { + for (auto &arg : args) + { + if (!point[axis].round (arg, k)) return false; + axis = !axis; + } + return true; + } + + coordinate_t point[2]; +}; + +} /* namespace CFF */ + +#endif /* HB_SUBSET_CFF2_ROUND_HH */ diff --git a/src/hb-subset-cff2.cc b/src/hb-subset-cff2.cc index 78b4abb45..3e3f7f913 100644 --- a/src/hb-subset-cff2.cc +++ b/src/hb-subset-cff2.cc @@ -35,6 +35,7 @@ #include "hb-subset-plan.hh" #include "hb-subset-cff-common.hh" #include "hb-cff2-interp-cs.hh" +#include "hb-subset-cff2-round.hh" #include "hb-subset-cff2-to-cff1.hh" using namespace CFF; @@ -321,6 +322,8 @@ struct cff2_usage_param_t cff2_instancing_plan_t *instancing = nullptr; bool drop_hints = false; + bool has_blend = false; + bool has_flex1 = false; unsigned ivs = 0; /* dict-side current vsindex */ }; @@ -328,6 +331,7 @@ struct cff2_cs_opset_usage_t : cff2_cs_opset_t &env, cff2_usage_param_t& param) { + param.has_flex1 |= op == OpCode_flex1; bool counts = true; switch (op) { @@ -354,7 +358,8 @@ struct cff2_cs_opset_usage_t : cff2_cs_opset_tnote_use (env.get_ivs ()); + param.has_blend = true; + if (param.instancing) param.instancing->note_use (env.get_ivs ()); break; } @@ -423,54 +428,52 @@ struct cff2_cs_opset_flatten_t : cff2_cs_opset_t &env, flatten_param_t& param) { - /* Optionally capture command for specialization (before flushing, to preserve args) */ - if (param.commands) + bool skip_command = false; + switch (op) { - bool skip_command = false; + case OpCode_return: + case OpCode_endchar: + skip_command = true; + break; - switch (op) + case OpCode_hstem: + case OpCode_hstemhm: + case OpCode_vstem: + case OpCode_vstemhm: + case OpCode_hintmask: + case OpCode_cntrmask: + skip_command = param.drop_hints; + break; + + default: + break; + } + + if (!skip_command && param.rounding && unlikely (!round_args (op, env, param))) + { + env.set_error (); + return; + } + + /* Capture resolved commands for CFF2-to-CFF1 specialization. */ + if (param.commands && !skip_command) + { + cs_command_t cmd (op); + for (unsigned int i = 0; i < env.argStack.get_count ();) { - case OpCode_return: - case OpCode_endchar: - skip_command = true; - break; - - case OpCode_hstem: - case OpCode_hstemhm: - case OpCode_vstem: - case OpCode_vstemhm: - case OpCode_hintmask: - case OpCode_cntrmask: - if (param.drop_hints) - skip_command = true; - break; - - default: - break; - } - - if (!skip_command) - { - cs_command_t cmd (op); - /* Capture resolved blend values */ - for (unsigned int i = 0; i < env.argStack.get_count ();) + const blend_arg_t &arg = env.argStack[i]; + if (arg.blending ()) { - const blend_arg_t &arg = env.argStack[i]; - if (arg.blending ()) - { - /* For blend args, capture only the resolved default value */ - cmd.args.push (arg); - /* Skip over the multiple blend values */ - i += arg.numValues; - } - else - { - cmd.args.push (arg); - i++; - } + cmd.args.push (arg); + i += arg.numValues; + } + else + { + cmd.args.push (arg); + i++; } - param.commands->push (cmd); } + param.commands->push (cmd); } switch (op) @@ -503,6 +506,12 @@ struct cff2_cs_opset_flatten_t : cff2_cs_opset_t &env, flatten_param_t& param) { + if (param.rounding) + { + encode_rounded_args (env, param); + SUPER::flush_args (env, param); + return; + } for (unsigned int i = 0; i < env.argStack.get_count ();) { const blend_arg_t &arg = env.argStack[i]; @@ -529,6 +538,65 @@ struct cff2_cs_opset_flatten_t : cff2_cs_opset_t &env, flatten_param_t& param) + { + unsigned k = 0; + if (param.instancer) + { + unsigned ivs = env.get_ivs (); + const auto *t = param.instancer->get_transform (ivs); + k = t && t->alive () ? t->matrix.length : 0; + for (unsigned i = 0; i < env.argStack.get_count (); i++) + { + auto &arg = env.argStack[i]; + if (!arg.blending ()) continue; + if (unlikely (!t || arg.deltas.length != t->gains.length)) return false; + double value = arg.to_real () + param.instancer->fold_deltas (ivs, arg.deltas.as_array ()); + hb_vector_t deltas = std::move (arg.deltas); + arg.set_real (value); + if (unlikely (!arg.deltas.resize (k))) return false; + for (unsigned r = 0; r < k; r++) + arg.deltas.arrayZ[r].set_real (t->transform_delta (r, deltas.as_array ())); + } + } + return param.rounding->round (op, hb_array (env.argStack.arrayZ, env.argStack.get_count ()), k); + } + + static void encode_rounded_args (cff2_cs_interp_env_t &env, flatten_param_t& param) + { + str_encoder_t encoder (param.flatStr); + unsigned count = env.argStack.get_count (); + for (unsigned i = 0; i < count;) + { + const auto &arg = env.argStack[i]; + if (!arg.blending ()) + { + encoder.encode_num_cs (arg); + i++; + continue; + } + unsigned k = arg.deltas.length; + unsigned n = 1; + while (i + n < count && env.argStack[i + n].deltas.length == k) n++; + /* Previously emitted operands remain on the stack during each blend. */ + unsigned chunk = hb_min (n, (512 - i) / (k + 1)); + if (unlikely (!chunk)) + { + env.set_error (); + return; + } + for (unsigned j = 0; j < chunk; j++) + encoder.encode_num_cs (env.argStack[i + j]); + for (unsigned j = 0; j < chunk; j++) + for (const auto &d : env.argStack[i + j].deltas) + encoder.encode_num_cs (d); + encoder.encode_int (chunk); + encoder.encode_op (OpCode_blendcs); + param.emitted_blend = true; + i += chunk; + } + } + static void flatten_blends (const blend_arg_t &arg, unsigned int i, cff2_cs_interp_env_t &env, flatten_param_t& param) { /* flatten the default values */ @@ -1131,10 +1199,13 @@ struct cff2_subset_plan if (desubroutinize) { - if (partial_instancing) + if (instancing_requested) { - /* Pass 1: collect which VarDatas the retained blends reference, so - * unused ones get pruned and the survivors renumbered. */ + /* Identify charstrings that can round absolute coordinates. Conservatively + * keep relative rounding for flex1, whose implicit direction can vary. + * Also collect the VarDatas referenced by partial instances. */ + hb_vector_t round_charstrings; + if (unlikely (!round_charstrings.resize (num_glyphs))) return false; hb_set_t used_fds; for (unsigned int i = 0; i < num_glyphs; i++) { @@ -1150,34 +1221,40 @@ struct cff2_subset_plan cff2_cs_interp_env_t env (str, acc, fd); cs_interpreter_t, cff2_cs_opset_usage_t, cff2_usage_param_t> interp (env); cff2_usage_param_t param; - param.instancing = &instancing; + param.instancing = partial_instancing ? &instancing : nullptr; param.drop_hints = drop_hints; if (unlikely (!interp.interpret (param))) return false; + round_charstrings.arrayZ[i] = param.has_blend && !param.has_flex1; } - for (unsigned fd : used_fds) + if (partial_instancing) { - cff2_usage_param_t param; - param.instancing = &instancing; - unsigned count = acc.privateDicts[fd].get_count (); - for (unsigned j = 0; j < count; j++) + for (unsigned fd : used_fds) { - const op_str_t &opstr = acc.privateDicts[fd][j]; - if (drop_hints && dict_opset_t::is_hint_op (opstr.op)) - continue; - cff2_priv_dict_interp_env_t env {hb_ubytes_t (opstr.ptr, opstr.length)}; - dict_interpreter_t interp (env); - if (unlikely (!interp.interpret (param))) - return false; + cff2_usage_param_t param; + param.instancing = &instancing; + unsigned count = acc.privateDicts[fd].get_count (); + for (unsigned j = 0; j < count; j++) + { + const op_str_t &opstr = acc.privateDicts[fd][j]; + if (drop_hints && dict_opset_t::is_hint_op (opstr.op)) + continue; + cff2_priv_dict_interp_env_t env {hb_ubytes_t (opstr.ptr, opstr.length)}; + dict_interpreter_t interp (env); + if (unlikely (!interp.interpret (param))) + return false; + } } + if (unlikely (!instancing.finalize ())) + return false; } - if (unlikely (!instancing.finalize ())) - return false; - /* Pass 2: like subr_flattener_t, but blends stay symbolic (no coords - * fed to the env) and get rewritten against the instanced store. */ + /* Keep full-instance blends unrounded until their absolute positions + * are known; partial-instance blends stay symbolic for rewriting. */ if (!subset_charstrings.resize_exact (num_glyphs)) return false; + if (capture_commands && !charstring_commands.resize_exact (num_glyphs)) + return false; for (unsigned int i = 0; i < num_glyphs; i++) { hb_codepoint_t glyph; @@ -1188,14 +1265,20 @@ struct cff2_subset_plan if (unlikely (fd >= acc.fdCount)) return false; - cff2_cs_interp_env_t env (str, acc, fd); + cff2_cs_interp_env_t env (str, acc, fd, + pinned ? plan->normalized_coords.arrayZ : nullptr, + pinned ? plan->normalized_coords.length : 0); + env.round_blends = !round_charstrings.arrayZ[i]; cs_interpreter_t, cff2_cs_opset_flatten_t, flatten_param_t> interp (env); flatten_param_t param = { subset_charstrings.arrayZ[i], (bool) (plan->flags & HB_SUBSET_FLAGS_NO_HINTING), - plan + plan, + capture_commands ? &charstring_commands.arrayZ[i] : nullptr }; - param.instancer = &instancing; + cff2_cs_rounding_t rounding; + if (round_charstrings.arrayZ[i]) param.rounding = &rounding; + param.instancer = partial_instancing ? &instancing : nullptr; if (unlikely (!interp.interpret (param))) return false; } diff --git a/src/meson.build b/src/meson.build index 95f64d78f..1ef9ba444 100644 --- a/src/meson.build +++ b/src/meson.build @@ -399,6 +399,7 @@ hb_subset_sources = files( 'hb-subset-cff-common.hh', 'hb-subset-cff1.cc', 'hb-subset-cff2.cc', + 'hb-subset-cff2-round.hh', 'hb-subset-cff2-to-cff1.hh', 'hb-subset-input.cc', 'hb-subset-input.hh', diff --git a/test/api/fonts/AdobeVFPrototype.abc.static.otf b/test/api/fonts/AdobeVFPrototype.abc.static.otf index 0c2e43db4a3a291a37526e19ed5de328ede5d273..e26994011fa96fd65f4ace139ff909cab42fac75 100644 GIT binary patch delta 585 zcmbOr@`hK$KP1GTfrp`iftkU<+0D)9=o8bdi6Z)pM<=@I_z0~CImy7l*uucTV3v`Q zn#lTv(H+QV0rFKca!V>WmNGmAvabNKKyG410Ru|_kjZcch}rTIb5r$p`LQxEupD7v zVA7blM^^k7gE^BkgAU^h1|y(-VDSGOgVDr~B0>y|3=GWE{%r&*ZD7!05M(l#EXG*I za(6<(xych4B{&##{(ojNV0txq1EV*i=H@?)GZ=k$tT}f=ZpO^c#dUS8-aZKh;nD%A zYmV(+v+>?4`CW65&E7kWV*wbHqjlOHlmI8B*5L4N+_yaLvhn>J40Dt&Wf!EZ+S-=*x^yG6eXwDsR+{eFVI zYYOZ41opn~O4XBpvsJQ|us`W!{nNol*zOE70#cv;4e|V#O?NrvdN} za?RAT(1J3Q(q14%B+>)IAo~y)K~m8N3xwbXSF+ihRueA_^P4kg{{NYCM*{1O#*FOj z3vs-K>x4sYB0ihodw|X8gm@|eI+&au9U$LC_`}>U#Al@@-3;_Z7 z#^2puaeUkOHo>8UlL{fpQ`W20lL(1wI>Eu8Q|^*fLhg-`CX)WBbKup&rsh-EtEbFWlv&dGytlLG<88UO^~L2UjZ&L_M@^PHw@Qk#?%JI)PwhPsmR#3X^w@Nxz42PB z?7l2kSGjACnrv0dCqBZgT&q2d4MkP7ShFp?`EXObxERFeIuk^=B@M zYJvW|8g*FFbd{n@|M|2yc1)jsCi-;#!ggh~5amw#p-CCZj-))f;js9o|7rU()3*V$ zCTp?lwj{`E$FDtM-CZ@d`?9s`=34PceZ%o9rsf8vrA~h9OzqiV()=|pR$Hkp{jx-z zGt_sd@2-6GqL^Qpv!4#i^pD{7Epa}b^vkaxMVj~=|!-WG>KS<|E zN2JdaIo;*0l`-i|M+u5)y+g1~cm7vzs&B@cp_4Uz1~yWk_Qo|lYDmV!^mOxpCk@@R*NBwfC|ro8iBzF0>% F;1A)m3{wCA diff --git a/test/api/fonts/cff2-rounding.otf b/test/api/fonts/cff2-rounding.otf new file mode 100644 index 0000000000000000000000000000000000000000..c5eb1139853dc10ae231f0a399caf37f9fc98038 GIT binary patch literal 6932 zcmeH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VQU{?=?GN>-z$;$|EOT0zXvaaG`wgjLkiS>(1K! zS_*X$zmC^xjjJT5+;zM8%j0It65U)fe-SrjGLPS^{H$!=d%O9|2n&NyWES4xE_!FNZD?2PaVGN0#r1a@W$}Dsx{h*77bi?JYmG zieERz+_G@Yi@{aqt}PIA;^n7S@$1Hz%@;uJaFw}h3#9VGnQxPS_xdnIxU1p-?YKC&OGT>a8~WWza04QB7y%U X#DgH1Sp(`4TmwsniUPAl@Edo(H literal 0 HcmV?d00001 diff --git a/test/api/generate-cff2-rounding-font.py b/test/api/generate-cff2-rounding-font.py new file mode 100644 index 000000000..6716178c6 --- /dev/null +++ b/test/api/generate-cff2-rounding-font.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +"""Generate CFF2 instancing regressions for fonttools/fonttools#4338. + +Run from the repository root. Each ring contour closes explicitly in the +default and in every variation region, so relative rounding must not open it. +The other glyphs exercise compact path operators, flexes, and hint masks. +""" + +import math +from pathlib import Path +import subprocess +import sys + +from fontTools.fontBuilder import FontBuilder +from fontTools.misc.psCharStrings import T2CharString + + +def ring(radius, wobble): + commands = [] + previous = (0, 0) + for cx, cy, direction in ((400, 400, 1), (1100, 400, -1)): + points = [ + ( + round(cx + (radius + wobble * (i % 3)) * math.cos(i * math.pi / 8)), + round(cy + (radius - wobble * (i % 2)) * math.sin(i * math.pi / 8)), + ) + for i in range(16) + ][::direction] + commands.append(("rmoveto", [points[0][j] - previous[j] for j in (0, 1)])) + previous = points[0] + for start, end in zip(points, points[1:] + points[:1]): + controls = [ + tuple(start[j] + (end[j] - start[j]) // 3 for j in (0, 1)), + tuple(end[j] - (end[j] - start[j]) // 3 for j in (0, 1)), + end, + ] + args = [] + for point in controls: + args.extend(point[j] - previous[j] for j in (0, 1)) + previous = point + commands.append(("rrcurveto", args)) + return commands + + +def blended(default, deltas): + return list(default) + [d[i] for i in range(len(default)) for d in deltas] + [len(default), "blend"] + + +program = [] +masters = [ring(r, w) for r, w in ((300, 7), (337, 23), (305, 11), (343, 29), (321, 13))] +for i, (op, args) in enumerate(masters[0]): + # Independent wght, slnt, interaction, and intermediate-wght regions. + deltas = [ + [masters[1][i][1][j] - v for j, v in enumerate(args)], + [masters[2][i][1][j] - v for j, v in enumerate(args)], + [masters[3][i][1][j] - masters[1][i][1][j] - masters[2][i][1][j] + v for j, v in enumerate(args)], + [masters[4][i][1][j] - (masters[1][i][1][j] + v) / 2 for j, v in enumerate(args)], + ] + program.extend(blended(args, deltas) + [op]) + +programs = {".notdef": [], "ring": program} +operators = { + "hlineto": [23, 31, -19, 41, 37], + "vlineto": [23, 31, -19, 41, 37], + "rcurveline": [17, 23, 31, -19, 41, 37, 29, -11], + "rlinecurve": [17, 23, 31, -19, 41, 37, 29, -11], + "hhcurveto": [13, 17, 23, 31, -19, 41, 37, 29, -11], + "vvcurveto": [13, 17, 23, 31, -19, 41, 37, 29, -11], + "hvcurveto": [17, 23, 31, -19, 41, 37, 29, -11, 13], + "vhcurveto": [17, 23, 31, -19, 41, 37, 29, -11, 13], + "flex": [17, 23, 31, -19, 41, 37, 29, -11, 13, 47, 19, -23, 50], + "hflex": [17, 23, 31, -19, 41, 37, 29], + "hflex1": [17, 23, 31, -19, 41, 37, 29, -11, 13], + # Its direction changes over wght: exercise the conservative fallback. + "flex1": [10, 20] * 5 + [17], +} +for op in ("hhcurveto", "vvcurveto", "hvcurveto", "vhcurveto"): + operators[op + ".one"] = [17, 23, 31, -19] + operators[op + ".two"] = [17, 23, 31, -19, 41, 37, 29, -11] +for op, args in operators.items(): + deltas = [[(j % 7) - 3 for j in range(len(args))]] + [[0] * len(args)] * 3 + if op == "flex": + deltas[0][-1] = 0 + if op == "flex1": + deltas[0] = [30, -10] * 5 + [0] + p = blended([101, 103], [[1, -1], [0, 0], [0, 0], [0, 0]]) + ["rmoveto"] + # Repeat to expose cumulative errors, including flex's implicit y reset. + for _ in range(3): + p += blended(args, deltas) + [op.split(".")[0]] + p += [23, 29, "rlineto", 31, "hmoveto", 37, "vmoveto", 41, 43, "rlineto"] + programs[op] = p + +stem = blended([101, 23, 29, 31], [[1, 1, 1, 1], [0] * 4, [0] * 4, [0] * 4]) +programs["hinted"] = stem + ["hstemhm"] + stem + ["hintmask", b"\xf0"] + program +programs["fractional"] = [10.25, 20.75, "rmoveto", 100.5, 0, 0, 100.5, -100.5, 0, "rlineto"] + +order = list(programs) +fb = FontBuilder(1000, isTTF=False) +fb.setupGlyphOrder(order) +fb.setupCharacterMap({0x41 + i: name for i, name in enumerate(order[1:])}) +fb.setupHorizontalMetrics({name: (2000, 0) for name in order}) +fb.setupHorizontalHeader(ascent=1600, descent=-400) +fb.setupNameTable({"familyName": "CFF2 Rounding", "styleName": "Regular"}) +fb.setupOS2() +fb.setupFvar([("wght", 300, 300, 900, "Weight"), ("slnt", -11, 0, 0, "Slant")], []) +fb.setupCFF2( + {name: T2CharString(program=p) for name, p in programs.items()}, + regions=[ + {"wght": (0, 1, 1)}, + {"slnt": (-1, -1, 0)}, + {"wght": (0, 1, 1), "slnt": (-1, -1, 0)}, + {"wght": (0, 0.5, 1)}, + ], +) +fb.setupPost(keepGlyphNames=True) +fb.font["head"].created = fb.font["head"].modified = 2082844800 +fb.font.recalcTimestamp = False +fb.save(Path(__file__).parent / "fonts" / "cff2-rounding.otf") + +# The existing API test also compares this table's serialized bytes. +subprocess.run( + [ + sys.argv[1] if len(sys.argv) > 1 else "build/util/hb-subset", + str(Path(__file__).parent / "fonts" / "AdobeVFPrototype.abc.otf"), + "--unicodes=61,62,63", + "--variations=wght=250,CNTR=0", + "--output-file=" + str(Path(__file__).parent / "fonts" / "AdobeVFPrototype.abc.static.otf"), + ], + check=True, +) diff --git a/test/api/test-instance-cff2.c b/test/api/test-instance-cff2.c index d560b5c1b..d62c1dc00 100644 --- a/test/api/test-instance-cff2.c +++ b/test/api/test-instance-cff2.c @@ -158,6 +158,156 @@ test_instance_cff2_large_store (void) } +typedef struct { + char op; + unsigned count; + float points[6]; +} rounding_command_t; + +static void +rounding_move_to (hb_draw_funcs_t *dfuncs HB_UNUSED, void *data, + hb_draw_state_t *st HB_UNUSED, float x, float y, + void *user_data HB_UNUSED) +{ + rounding_command_t command = {'M', 2, {x, y}}; + g_array_append_val ((GArray *) data, command); +} + +static void +rounding_line_to (hb_draw_funcs_t *dfuncs HB_UNUSED, void *data, + hb_draw_state_t *st HB_UNUSED, float x, float y, + void *user_data HB_UNUSED) +{ + rounding_command_t command = {'L', 2, {x, y}}; + g_array_append_val ((GArray *) data, command); +} + +static void +rounding_cubic_to (hb_draw_funcs_t *dfuncs HB_UNUSED, void *data, + hb_draw_state_t *st HB_UNUSED, float x1, float y1, + float x2, float y2, float x, float y, + void *user_data HB_UNUSED) +{ + rounding_command_t command = {'C', 6, {x1, y1, x2, y2, x, y}}; + g_array_append_val ((GArray *) data, command); +} + +static void +rounding_close_path (hb_draw_funcs_t *dfuncs HB_UNUSED, void *data, + hb_draw_state_t *st HB_UNUSED, void *user_data HB_UNUSED) +{ + rounding_command_t command = {'Z', 0, {0}}; + g_array_append_val ((GArray *) data, command); +} + +static void +check_rounding (hb_face_t *face, hb_face_t *subset, float weight, float slant, + float tolerance) +{ + hb_variation_t location[] = {{HB_TAG ('w','g','h','t'), weight}, + {HB_TAG ('s','l','n','t'), slant}}; + hb_font_t *original = hb_font_create (face); + hb_font_t *instanced = hb_font_create (subset); + hb_font_set_variations (original, location, 2); + hb_font_set_variations (instanced, location, 2); + hb_draw_funcs_t *funcs = hb_draw_funcs_create (); + hb_draw_funcs_set_move_to_func (funcs, rounding_move_to, NULL, NULL); + hb_draw_funcs_set_line_to_func (funcs, rounding_line_to, NULL, NULL); + hb_draw_funcs_set_cubic_to_func (funcs, rounding_cubic_to, NULL, NULL); + hb_draw_funcs_set_close_path_func (funcs, rounding_close_path, NULL, NULL); + + for (hb_codepoint_t glyph = 1; glyph < hb_face_get_glyph_count (face); glyph++) + { + char name[64]; + g_assert_true (hb_font_get_glyph_name (original, glyph, name, sizeof (name))); + GArray *expected = g_array_new (FALSE, FALSE, sizeof (rounding_command_t)); + GArray *actual = g_array_new (FALSE, FALSE, sizeof (rounding_command_t)); + g_assert_true (hb_font_draw_glyph_or_fail (original, glyph, funcs, expected)); + g_assert_true (hb_font_draw_glyph_or_fail (instanced, glyph, funcs, actual)); + g_test_message ("glyph %u, wght %g, slnt %g", glyph, weight, slant); + if (!strcmp (name, "flex1")) + { + /* flex1 deliberately retains relative rounding for the entire glyph. + * At wght=570 its first dx/dy round to 24/15, after a 101/103 moveto. */ + if (weight == 570) + { + rounding_command_t *curve = &g_array_index (actual, rounding_command_t, 1); + g_assert_cmpint (curve->op, ==, 'C'); + g_assert_cmpfloat (curve->points[0], ==, 125); + g_assert_cmpfloat (curve->points[1], ==, 118); + } + g_array_free (actual, TRUE); + g_array_free (expected, TRUE); + continue; + } + g_assert_cmpuint (expected->len, ==, actual->len); + for (unsigned i = 0; i < expected->len; i++) + { + rounding_command_t *a = &g_array_index (actual, rounding_command_t, i); + rounding_command_t *e = &g_array_index (expected, rounding_command_t, i); + g_assert_cmpint (a->op, ==, e->op); + for (unsigned j = 0; j < e->count; j++) + g_assert_cmpfloat_with_epsilon (a->points[j], e->points[j], tolerance); + /* The rings' final cubic endpoint must equal their moveto, without + * relying on the implicit line supplied by close_path. */ + if ((!strcmp (name, "ring") || !strcmp (name, "hinted")) && a->op == 'Z') + { + rounding_command_t *end = &g_array_index (actual, rounding_command_t, i - 1); + unsigned start = i - 1; + while (g_array_index (actual, rounding_command_t, start).op != 'M') start--; + rounding_command_t *move = &g_array_index (actual, rounding_command_t, start); + g_assert_cmpint (end->op, ==, 'C'); + g_assert_cmpfloat_with_epsilon (end->points[4], move->points[0], .001); + g_assert_cmpfloat_with_epsilon (end->points[5], move->points[1], .001); + } + } + g_array_free (actual, TRUE); + g_array_free (expected, TRUE); + } + hb_draw_funcs_destroy (funcs); + hb_font_destroy (original); + hb_font_destroy (instanced); +} + +static void +test_instance_cff2_absolute_rounding (void) +{ + hb_face_t *face = hb_test_open_font_file ("fonts/cff2-rounding.otf"); + for (unsigned mode = 0; mode < 4; mode++) + for (unsigned no_hinting = 0; no_hinting < 2; no_hinting++) + { + hb_subset_input_t *input = hb_subset_input_create_or_fail (); + hb_set_add_range (hb_subset_input_glyph_set (input), 0, hb_face_get_glyph_count (face) - 1); + if (no_hinting) hb_subset_input_set_flags (input, HB_SUBSET_FLAGS_NO_HINTING); + if (mode == 0 || mode == 3) + { + g_assert_true (hb_subset_input_pin_axis_location (input, face, HB_TAG ('w','g','h','t'), mode == 0 ? 570 : 300)); + g_assert_true (hb_subset_input_pin_axis_location (input, face, HB_TAG ('s','l','n','t'), mode == 0 ? -5.5 : 0)); + } + else + { + g_assert_true (hb_subset_input_set_axis_range (input, face, HB_TAG ('w','g','h','t'), 300, 900, 400)); + if (mode == 2) + g_assert_true (hb_subset_input_pin_axis_location (input, face, HB_TAG ('s','l','n','t'), -5.5)); + } + hb_face_t *subset = hb_subset_or_fail (face, input); + g_assert_nonnull (subset); + check_rounding (face, subset, mode == 0 ? 570 : mode == 3 ? 300 : 400, + mode == 1 || mode == 3 ? 0 : -5.5, .501); + if (mode == 1 || mode == 2) + { + check_rounding (face, subset, 300, mode == 1 ? 0 : -5.5, 1.51); + check_rounding (face, subset, 600, mode == 1 ? -11 : -5.5, 2.01); + check_rounding (face, subset, 900, mode == 1 ? -11 : -5.5, 2.01); + } + hb_face_destroy (subset); + hb_subset_input_destroy (input); + } + hb_face_destroy (face); +} + + + int main (int argc, char **argv) { @@ -167,6 +317,7 @@ main (int argc, char **argv) hb_test_add (test_instance_cff2_private_blend_overflow); hb_test_add (test_instance_cff2_empty_bounds); hb_test_add (test_instance_cff2_large_store); + hb_test_add (test_instance_cff2_absolute_rounding); return hb_test_run(); } diff --git a/test/subset/data/expected/downgrade_cff2/SourceSerif4Variable-Roman-HelloWorld.downgrade-cff2.48,65,6C,6C,6F,20,57,6F,72,6C,64.wght=650,opsz=48.otf b/test/subset/data/expected/downgrade_cff2/SourceSerif4Variable-Roman-HelloWorld.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Jn7u0O8> z+0rKz)A7@0Q4=+OFu`PjrBxn(bWPdivZQt}Qx;fXfzq(q{pz6(#w5Gt(jO$bm2tTN z2a1`=D))TX27z@3B8vmE5NKfwXywr2LF=!i3RN=_nheDw(62> zT_IWHPI2W5FcB_tje}j`P^+T2=7J5CwzO8X>qD1XZ`O#{kJ_7e=(9IjXOxPEaI*!m H48!~a$TV1M diff --git a/test/subset/data/expected/downgrade_cff2_iftb/Cantarell-VF-ABC.downgrade-cff2-iftb.41,42,43.wght=650.otf b/test/subset/data/expected/downgrade_cff2_iftb/Cantarell-VF-ABC.downgrade-cff2-iftb.41,42,43.wght=650.otf index e400ab0da2333a82cb54438be7b7ff23a86e4c11..82f757fa2f5657deb9ff6de2b34838262f30772f 100644 GIT binary patch delta 232 zcmV;~YuX-rsaX+Cft_Y!~w%b~T&(HiwN#``iJ z`*#Ko@PYRDhxP%w_Ynj5AAuFp*PN)xA8_LZdRD)IL-_blV#_bS55fO)zf it>^`(QAQJ*M;rTZ`zZS*`)>PY_aXZr_hYjW1m^*W{A#)Y delta 232 zcmV;~bvX-rsZX+Cft_Y!~w%b~T&(HiwM#``iJ z`*#Ko@PYRDi1q=x_Ynj5AAuFo*qo@xA8_LZdRD)RR;_bcP#_bS55fO)zf it?31)QAQJ*M;rTY`ziY+`)>PY_aXZr_hhpX1m^*VEo!;| diff --git a/test/subset/data/expected/instantiate_cff2/AdobeVFPrototype.default.all.wght=650,CNTR=50.otf b/test/subset/data/expected/instantiate_cff2/AdobeVFPrototype.default.all.wght=650,CNTR=50.otf index acf48c3b46b2a5c19bb9b14e9e351cc4ad364767..f48c1aa1b9c8e55901d9234abb8fbb978d653333 100644 GIT binary patch delta 20389 zcmch92V51$_J54bE|yrLi*PsYS`Zsn>?KxIkfwt4UN5~PbrI|+Dp#cU-g|HMj*2Cg z#Ke+BQ(rXYtZ%OG_n!-Dj4{5Km%P9C^YLZA%(11q+Ee3u$$Zk;2;NZbW-;=!8Fhnw>Zs_|% zEry;QwqV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