Commit Graph
2614 Commits
Author SHA1 Message Date
Qunxin Liu cf31e7ac4e [instancer] support full instancing for avar2 (#5676) 2025-12-11 10:54:49 -07:00
Khaled Hosny 46bc4e95f9 [kbts] Update to version 2.0 2025-11-28 12:56:36 +02:00
Garret Rieger 09c14fa4f2 Fix fuzzer found memory leak. (#5643)
Fixes https://oss-fuzz.com/testcase-detail/6083012753424384
2025-11-14 02:27:35 -07:00
Behdad Esfahbod 33f8ee8efc [test] Add HarfBust tests 2025-11-10 02:55:44 -07:00
Behdad Esfahbod b11c14227f Match backtrack/lookahead per syllable (#5635)
* [match-backtrack] Fix syllable-setting logic

If accidentally backtrack_len() was equal idx, we were setting
syllable, even though we want to match backtrack, which shouldn't
match syllable.

I'm surprised how this was not exposed before.

Fixes https://github.com/harfbuzz/harfbuzz/issues/5597

* Always match backtrack per syllable

* Always match lookahead per syllable as well

* Add Indic test for per-syllable backtrack/lookahead matching
2025-11-04 13:49:52 -07:00
Behdad Esfahbod 844f2fea06 [GPOS] Handle attach_chain() overflow (#5636)
Fixes https://oss-fuzz.com/testcase-detail/5461871294742528
2025-11-03 20:28:54 -07:00
Khaled Hosny 6105bad187 Fix applying synthetic slight to glyph origins (#5629)
* Fix applying synthetic slight to glyph origins

The hb_font_t::get_glyph_[h/v]_origins() methods were applying all the
transformations to the first glyph in the buffer. This shows up for
vertical text only because h_origin callback is usually unset.

Fixes https://github.com/harfbuzz/harfbuzz/issues/5628

* Don’t apply slant to glyph origin

Per discussion in https://github.com/harfbuzz/harfbuzz/issues/5628#issuecomment-3459345504

* Disable only font functions that fail
2025-10-29 13:59:51 -06:00
Behdad Esfahbod f159600ccb Fix a draw fuzzer uninitialized-memory issue (#5615)
Fixes https://oss-fuzz.com/testcase-detail/5714890590584832
2025-10-17 19:49:40 -06:00
Harry Dalton 780b986659 [shape] Test fallback to kern table under different shapers
More specifically, this asserts that the `kern` table is avoided for
certain shapers, and that we avoid double-spacing in the presence of
`dist` for the same.
2025-10-17 16:26:21 -06:00
Khaled Hosny 189358e3d0 [test] Add test for harfrust#278 (#5610)
Add test case for https://github.com/harfbuzz/harfrust/pull/278
2025-10-14 20:06:26 -06:00
Qunxin Liu 0952bc0ac2 [subset] de-duplicate features (#5494) 2025-09-26 12:10:28 -04:00
Garret Rieger 54ab8f0df4 [repacker] make repacker object ids stable.
Prior to this change the object id for a vertex in the repacker graph is it's position in the topological ordering. As a result after each sorting the object ids change. This decouples the topological sorting from the object id assignments. A separate ordering list is retained. This simplifies handling around object ids which no longer needs to account for them shifting, and improves performance by eliminating the step of reassigned link object ids after each sort.
2025-09-15 16:34:44 -06:00
Behdad Esfahbod d6343fa3bf [instancer/varstore] Update test expectations 2025-09-13 13:38:47 -06:00
Garret Rieger aa58b43de4 [subset] Introduce HB_SUBSET_FLAGS_RETAIN_NUM_GLYPHS. (#5547)
Used in conjunction with retain gids, when set the num glyphs from the input font will be preserved. Empty glyphs will be inserted as necessary to maintain the num glyphs value. Put under experimental for now.
2025-09-12 14:24:41 -06:00
Behdad Esfahbod c9480db91b [instancer/varstore] Add a heuristic to speed up optimization 2025-09-12 12:51:26 -06:00
Garret Rieger 6dadd8461f Re-disable fonttools comparison for update_def_wght.tests 2025-09-12 12:38:22 -06:00
Behdad Esfahbod 0f1dab0f93 [instancer/varstore] More gain_from_merging optimization (#5543)
* [instancer/varstore] More gain_from_merging optimization

* [tests] Re-enable a test that was disabled until an issue fixed

See comment.
2025-09-12 11:43:21 -06:00
David Corbett bc2c60e490 [Unicode 17] Add tests 2025-09-10 12:15:49 -04:00
David Corbett e189b34ec9 [Unicode 17] Update the emoji table & cluster test 2025-09-10 11:19:14 -04:00
Qunxin Liu 77d073044e [subset] fix HVAR encoding width (#5523) 2025-09-02 15:40:51 -06:00
Behdad Esfahbod a89c36e0d9 [GPOS/kerx] Support attaching marks to bases after them (#5520)
See comments. Fuzzer found. I'm surprised this was not discovered
before though. I hope I have not missed anything.

Fixes https://oss-fuzz.com/testcase-detail/6399443634290688
2025-09-02 13:05:11 -06:00
Khaled Hosny b7c55efe0d [subset] Fix shaping behaviour when pruning empty mark sets
See https://github.com/harfbuzz/harfbuzz/issues/5499
2025-08-26 00:45:26 +03:00
Behdad Esfahbod 2c22a65f0c [test] Add test for would_apply with multiple subtables
From HarfRust issue:
https://github.com/harfbuzz/harfrust/issues/118
2025-08-08 15:14:16 -06:00
Qunxin Liu cd49b14b4f [subset] add more aggressive pruning for MarkLigPos and MarkMarkPos (#5434)
Remove lig/mark glyphs without defined anchor points after subsetting
2025-07-29 15:32:26 -06:00
Behdad Esfahbod 4f8193ceff [tests/vertical] Add test for previous commit 2025-07-26 13:06:45 -06:00
Qunxin Liu 879c4ac784 [subset] MarkBasePos: remove base glyphs with empty base record
BaseRecord could become empty if all anchor offsets for retained mark
classes are null
2025-07-24 14:25:54 -07:00
Garret Rieger 04d60de6ae [CFF2] Fix fuzzer failure in CFF2.
Fixes https://oss-fuzz.com/testcase-detail/5291661985120256
2025-07-23 12:59:22 -06:00
Khaled Hosny 16fe5422b6 [kbts] Add some tests 2025-07-23 21:39:23 +03:00
Behdad Esfahbod d47a319b82 [rust] Roll deps forward
Adjust tests. See:

https://github.com/harfbuzz/harfbuzz/issues/5388
2025-07-15 12:08:00 -06:00
Khaled Hosny af1b9acc27 [glib] Drop fallback code for versions we don’t support
We require Glib 2.30.0, so drop checks for older versions.
2025-07-02 20:14:51 +03:00
Behdad Esfahbod 7278f8a20e [test/shape] Clean up meson
Fixes https://github.com/harfbuzz/harfbuzz/issues/5366
2025-06-14 11:02:37 -06:00
Behdad Esfahbod 6eb4ed6aee [meson] Disable some tests under -Dutilities=disabled
Fixes https://github.com/harfbuzz/harfbuzz/issues/5365
2025-06-14 09:24:44 -06:00
Behdad Esfahbod 47089fe7a3 Big misc changes
- Make geometry types into templates taking float or double.
- Changes to paint() transform elimination.
- Add font->has_nonzero_coords and use it across.
- Extensions to avar processing for otherwise invalid mappings.
2025-06-08 13:43:27 +03:00
Behdad Esfahbod cc884606bc [test/shape] --safe-to-insert-tatweel
At some point we should switch to --show-flags.
For now, tests all pass regardless of this switch.
2025-06-06 21:39:03 -06:00
Behdad Esfahbod 7908e86e35 [util/test-shape] Only output one line per test
If a shape call was failing, perhaps because of --verify failing,
hb-shape was producing multiple lines possibly, making the test
runner get out of sync and fail all following tests.

https://github.com/harfbuzz/harfruzz/issues/60
2025-06-06 20:19:06 -06:00
Behdad Esfahbod 7e353d3718 [test] Remove u8 prefix from strings
No idea how/why this got in there to begin with.
2025-05-23 14:31:58 -06:00
Garret Rieger fac64e5838 [instancer] add a test which checks calculation of vmtx tsb during CFF2 instancing. 2025-05-23 12:47:23 -06:00
Behdad Esfahbod eeabc29c69 [test/subset] Fix test-runner when ots is present 2025-05-17 11:24:51 -07:00
Garret Rieger 3e122d9df9 Disable OTS on the cmap4 overflow test case.
The test file has been stripped of most tables to avoid checking in a very large font (since it has a high number of codepoints), which causes OTS to fail on missing required tables.
2025-05-16 11:08:00 -07:00
Garret Rieger 4e76727183 Add a test checks we can recover from cmap4 overflow. 2025-05-15 10:05:18 -06:00
Behdad Esfahbod 604056056c [test/shape] Move LucidaGrande test to macos.tests 2025-05-09 23:17:35 -06:00
Behdad Esfahbod 19a5d1aabd [test/shape] Only do unsafe-to-concat check for ot shaper
For now, to get harfRuzz testing going better.
2025-05-07 16:57:19 -06:00
Behdad Esfahbod 2f7fbeeea2 [test/shape] Allow specifying shaper / face-loader as env-vars 2025-05-07 13:42:56 -06:00
Behdad Esfahbod 21a67df4c9 [run-tests.py] Clean up file descriptors 2025-05-06 15:42:48 -06:00
Behdad Esfahbod fcedcf8111 [coretext] Another old-system build fix
Fixes https://github.com/harfbuzz/harfbuzz/issues/5300#issuecomment-2831684725
2025-04-25 19:04:37 -06:00
Behdad Esfahbod 38db1facf2 [paint] Change back return type of paint_glyph() to void
Add new "_or_fail" variants of draw_glyph and paint_glyph

New API:
+hb_font_draw_glyph_or_fail_func_t
+hb_font_paint_glyph_or_fail_func_t
+hb_font_funcs_set_draw_glyph_or_fail_func()
+hb_font_funcs_set_paint_glyph_or_fail_func()
+hb_font_draw_glyph_or_fail()
+hb_font_paint_glyph_or_fail()

Deprecated API:
-hb_font_draw_glyph_func_t
-hb_font_paint_glyph_func_t
-hb_font_funcs_set_draw_glyph_func()
-hb_font_funcs_set_paint_glyph_func()
2025-04-23 18:23:51 -06:00
Behdad Esfahbod e78310bfaa [paint] Change return type to bool, and return false for outline glyphs
It was impossible to get synthetic bold/slant correctly with the
previous API. This is a minor API break, but one I'm willing to take.
2025-04-23 01:02:15 -06:00
Behdad Esfahbod 9445778e18 [test-paint] Update expectations for recent slant changes 2025-04-22 21:33:15 -06:00
Behdad Esfahbod 8aa88aa416 [COLRv1:ot/ft] Use paint-bounded instead of paint-extents
Faster. Note that this also means that if there is no clip-box,
we don't compute the bounds and emit an initial clip anymore.
That was totally unnecessary and against the COLRv1 rendering
algorithm.

This makes painting of COLRv1 fonts without clipboxes *much*
faster, as previously we were computing bounds using all subglyph
outlines. Not anymore.

Before:
BM_Font/paint_glyph/Nupuram-Color.colrv1.ttf/ot                   1.78 ms

After:
BM_Font/paint_glyph/Nupuram-Color.colrv1.ttf/ot                  0.155 ms
2025-04-20 04:11:07 -06:00
Garret Rieger efcb7d3de1 [subset] close unicodes over bidi mirror variants during subsetting.
Fixes #5281. Does the closure by default, but I've introduced a new flag and option to disable this behaviour since some users may want to get the minimal set if they know they don't need the mirrored variants.
2025-04-11 18:13:28 -06:00