Commit Graph

2207 Commits

Author SHA1 Message Date
Behdad Esfahbod 3fd6c0d97a [test-paint] Remove unused FT_Library 2023-01-08 12:30:26 -07:00
Behdad Esfahbod 28be4f8805 [test-paint] Actually run against hb-ft 2023-01-08 12:19:41 -07:00
Matthias Clasen ed7d0234e1 test-paint: Limit the precision of clip boxes
Update expected test results.
2023-01-08 11:57:43 -07:00
Matthias Clasen 10390ec5c6 Update expected test results 2023-01-08 09:06:03 -05:00
Matthias Clasen f3ce137420 test-paint: Be more flexible for expected results
When generating the expected output with GENERATE_DATA=1,
Glib's test framework puts out some comments at the top
of the file. Ignore them when comparing the expected
output. This makes it possible to directly use the output
of

GENERATE_DATA=1 ./test-paint -p TESTCASE

as expected result for TESTCASE.
2023-01-08 09:01:31 -05:00
Matthias Clasen d0aaea2319 Update test results for paint-test
These were affected by the PaintComposite optimization.
2023-01-07 16:30:56 -05:00
Qunxin Liu 1eb5445e75 [subset] Fix issue in hb_subset_input_override_name_table()
If a nameRecord with provided name_id/platform_id/encoding_id/lang_id
is not retained after subsetting, create it and insert it to
the name table. So we need to check against retained name_records
rather than name_record in the original name table.
2023-01-06 19:17:14 -07:00
Behdad Esfahbod c54debc76d [face] Add hb_face_collect_nominal_glyph_mapping
Fixes https://github.com/harfbuzz/harfbuzz/issues/3973
2023-01-05 11:57:48 -07:00
Matthias Clasen 9f3b59fe6b Update expected test results
These need updates, because they record
every callback, and we've changed what
callbacks are happening.
2022-12-31 16:19:20 -05:00
Matthias Clasen 313f74a693 Add a basic test for hb-coretext api
This tests what would be my minimum assumption
about this api. It was written blindly.
2022-12-28 11:14:22 -07:00
Matthias Clasen 661baf403c Add a basic test for hb-ft api
This tests what would be my minimum assumption
about this api.
2022-12-28 11:14:22 -07:00
Matthias Clasen 2a51567925 [paint] Add a test for recursion 2022-12-26 17:00:20 -07:00
Matthias Clasen 1eb4d002f2 Try to fix the build with msvc 2022-12-26 11:29:26 -07:00
Matthias Clasen 00e93102a6 Add a test for hb_ot_color_glyph_has_paint 2022-12-26 11:29:26 -07:00
Matthias Clasen e7b0947afd Add a test for hb_ot_color_has_paint 2022-12-26 11:29:26 -07:00
Matthias Clasen a7a93b85e6 Drop accidentally added ttx files 2022-12-24 12:08:32 -07:00
Behdad Esfahbod 6ccbfabd4f [paint] Return bool from paint_image()
Fixes https://github.com/harfbuzz/harfbuzz/issues/3974
2022-12-24 10:44:25 -07:00
Matthias Clasen d00e97f16c Add test-paint to the autotools build 2022-12-24 09:16:29 -05:00
Matthias Clasen 3478728edb Fix test-paint build without freetype 2022-12-24 09:16:29 -05:00
Matthias Clasen 9b9d7c7b8e Plug a memory lek in paint tests 2022-12-24 05:34:47 -05:00
Matthias Clasen f9c865a899 Update test results
These were changed by the introduction of
clip boxes.
2022-12-23 20:56:20 -05:00
Matthias Clasen 55b7af6b62 Tweak paint-tests 2022-12-23 18:34:09 -05:00
Matthias Clasen 44b48845b7 Add tests for hb_color_line_t
Test a few things that were broken with the
ft implementation before.
2022-12-23 16:28:53 -05:00
Behdad Esfahbod a4a86c0ec2 [test-paint] g_test_message 2022-12-23 13:52:22 -07:00
Behdad Esfahbod dcab567988 [test-paint] Don't use g_test_fail_print() for older glib 2022-12-23 13:47:37 -07:00
Matthias Clasen 8e197f50da Add missing paint test results 2022-12-23 13:40:02 -07:00
Matthias Clasen 3b021c5568 Run paint tests with ft font funcs 2022-12-23 13:37:59 -07:00
Matthias Clasen ca190aaba4 Split off the hb-paint tests
They belong in their own file.
2022-12-23 13:37:59 -07:00
Matthias Clasen ee7bbdf372 tests: Update expected results
These were changed by fixes for glyph transforms.
2022-12-23 13:37:59 -07:00
Matthias Clasen 3993a40703 test: Add some verification hints 2022-12-23 13:37:59 -07:00
Matthias Clasen 47dbebff39 [paint] Add COLRv0 tests 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 3c972867b9 More s/hb_font_get_glyph_shape/hb_font_draw_glyph/ 2022-12-23 13:37:59 -07:00
Matthias Clasen c221933977 [paint] Preserve foreground information 2022-12-23 13:37:59 -07:00
Matthias Clasen 6387004cad [paint] Simplify api
Drop the hb_paint_context_t struct from the API, and
only pass the font where we need it.
2022-12-23 13:37:59 -07:00
Matthias Clasen 71bd5a0dfc [paint] Resolve colors
We don't need to pass the index/alpha pairs to
client callbacks, and can just resolve the colors
internally.

Update test results.
2022-12-23 13:37:59 -07:00
Matthias Clasen 9be01b6bff [paint] Pass hb_paint_context_t along
Replace the font argument with a hb_paint_context_t
that carries the font, the palette index and the
foreground color.

The hb_font_paint_glyph() api now takes the palette
index and the foreground color as extra arguments.

Update all callers and regenerate test results.
2022-12-23 13:37:59 -07:00
Matthias Clasen 97224f3b63 [paint] Pass font to all callbacks
This will lead to easier implementations.

At the same time, we change the push_clip_glyph
callback to use the font as-is, no unscaling needed.

Update all callers and expected test results.
2022-12-23 13:37:59 -07:00
Matthias Clasen b0fa40b2ec tests: More diagnostics 2022-12-23 13:37:59 -07:00
Matthias Clasen 290bb338bf Dist test result files 2022-12-23 13:37:59 -07:00
Matthias Clasen 74ccc1e76d tests: Produce useful output on failure 2022-12-23 13:37:59 -07:00
Matthias Clasen 084291108a Tests: Fix memleak pointed out by valgrind 2022-12-23 13:37:59 -07:00
Behdad Esfahbod d8cb7ceefb [test] Try fixing bots with old glib 2022-12-23 13:37:59 -07:00
Matthias Clasen 2d4678b647 Add a comment 2022-12-23 13:37:59 -07:00
Matthias Clasen 30a6fd04d0 [colr] Add some tests 2022-12-23 13:37:59 -07:00
Chun-wei Fan 4622be7f84 test/fuzzing: Fix dist
We need to dist the repacker fuzzer test items into the tarball, along
with the items in graphs/ and sets/.
2022-12-22 06:44:04 -07:00
Garret Rieger 40342c9437 [subset] check for addition overflow in hdmx size calculation.
Fixes https://oss-fuzz.com/testcase-detail/4877336988483584.
2022-12-21 16:44:06 -07:00
Garret Rieger b5acde43ed [subset] check pending/subsetted tag sets for alloc failure. 2022-12-13 15:31:40 -07:00
Garret Rieger 9fbe52b88d [subset] enable instancing tests by default. 2022-12-12 20:24:24 +00:00
Garret Rieger eda02c2ebd [subset] Move hb_subset_preprocess to be non-experimental. 2022-12-08 16:32:24 -07:00
Garret Rieger 35233d2514 [repacker] fix fuzzer reported stack overflow.
Fixes https://oss-fuzz.com/testcase-detail/6014493291577344.
2022-12-07 10:32:56 -07:00
Garret Rieger b17fbc200b [repacker] use memcpy to avoid alignment issues. 2022-12-05 14:13:47 -07:00
Garret Rieger f1d3489388 [repacker] bail on failure to alloc assigned_bytes set.
Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/5390364397928448.
2022-12-05 14:13:47 -07:00
Garret Rieger 239a5aca02 [repacker] don't allow references to the null object in graph.
Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/6714085985353728
2022-12-05 14:13:47 -07:00
David Corbett 260df1fa32 [indic] Support <U+0A02, U+0A40> 2022-12-04 10:46:47 -07:00
Qunxin Liu 8eadb83640 [subset] Update hb_subset_input_override_name_table API
Override the name string for the NameRecord identified by name_id,
platform_id, encoding_id and language_ids specified by the user.
If a record with specified name_id does not exist, this API will create
a new NameRecord with provided info and insert it to the name table.
2022-12-02 18:05:53 -07:00
Garret Rieger 16f61a1c87 [repacker] only build repacker fuzzer when experimental api is enabled. 2022-12-02 00:02:14 +00:00
Garret Rieger de5a621322 [repacker] enforce root node having no incoming edges. 2022-12-01 23:37:16 +00:00
Garret Rieger 30e405e470 [repacker] ensure link obj indices are valid. 2022-12-01 22:12:59 +00:00
Garret Rieger 554ed06fac [repacker] add cycle detection to the graph sort.
This allows us to bail early if the graph is not acyclic.
2022-12-01 21:52:37 +00:00
Garret Rieger 9e99d08470 [repacker] validate link widths during repacker setup. 2022-12-01 20:17:41 +00:00
Garret Rieger edf7a29595 [repacker] Validate link positions before running the repacker. 2022-12-01 20:17:41 +00:00
Garret Rieger 88d437525f [repacker] add test for repacker fuzzer. 2022-12-01 20:17:40 +00:00
Garret Rieger 6627a1ab45 [repacker] Add a initial seed for the fuzzer repacker. 2022-12-01 20:17:40 +00:00
Garret Rieger deca30b268 [repacker] get repacker fuzzer working.
Additionally add helper method that allows a graph to be saved as a fuzzer seed.
2022-12-01 20:17:40 +00:00
Garret Rieger 261a605f9c [repacker] verify graph is a dag before using the fuzzer input. 2022-12-01 20:17:40 +00:00
Garret Rieger 985b19f678 [repacker] begin implementing a fuzzer for the repacker api. 2022-12-01 20:17:39 +00:00
Garret Rieger 64e8707eca [subset] don't use hb repacker when generating test files from fonttools. 2022-11-24 18:24:50 +00:00
Garret Rieger ff3cac0ccd [subset] Fix unecessary trailing 0 bytes left by ContextFormat2 pruning.
Uneeded rules where beind removed from the count by the bytes for them was being left in the font.
2022-11-23 23:50:49 +00:00
Garret Rieger dd1ba328a8 [repacker] fix fuzzer timeout.
For https://oss-fuzz.com/testcase-detail/5845846876356608. Only process the set of unique overflows.
2022-11-21 16:24:48 -07:00
Behdad Esfahbod 527823ccac [unicode] Destroy user_data in set_funcs fail paths
This is what the font_funcs / draw_funcs do.
2022-11-19 15:19:08 -07:00
Qunxin Liu 6314aa7da4 [subset] add an experimental API that can override name strings for specified name_id 2022-11-08 14:10:25 -07:00
Behdad Esfahbod f53ef69d59 [indic] Order left-matras inside-out
Fixes https://github.com/harfbuzz/harfbuzz/issues/3863
2022-11-05 15:40:05 -06:00
Garret Rieger 2822b589bc [subset] Include instancing tests in distribution.
Automatically enable them when the experimental api is enabled.
2022-11-03 14:24:15 -06:00
Qunxin Liu 8a5524833c [instance] update OS2/.usWeightClass and .usWidthClass when
no-prune-unicode-ranges option is enabled
2022-10-27 11:59:31 -06:00
Behdad Esfahbod e854739b2d [fuzzing] Add test font for previous commit 2022-10-26 13:12:56 -06:00
Garret Rieger db22bfb3cc [subset] Remove Franklin from the tests which is not an open source font. 2022-10-17 13:15:47 -06:00
Garret Rieger 3394ec7048 [subset] use subset accelerator in tests.
This ensures it produces equivalent subsets as without the accelerator.
2022-10-13 23:02:54 +00:00
Qunxin Liu d5fc4a73c0 [instance] add tests for featureVariations
Also updated the script that is used to generate tests.With fonttools,
we now do instancing first and then subsetting.

With different order of subsetting and instancing operations on the same
VF file, fonttools seems to generate 2 different font files with different
glyph set.
1. do subsetting and then instancing: this seems result in a larger glyph
   set in the font file. Lookups are collected from both retained features
   and all possible alternate featurevariations, this leads to a larger
   glyph set after glyph closurei. And instancer doesn't redo glyph
   closure, it does lookups pruning only.

2. do instancing and then subsetting: lookups are collected from
   features that are replaced already and possible alternate feature
   variations
2022-09-29 12:14:43 -06:00
Jonathan Kew 21b0e59414 [aat] Add test for rlig-to-aat feature mapping in Geeza Pro. 2022-09-20 10:37:27 -06:00
David Corbett 09b9a1ffdd [USE] Allow ZWNJ at the end of a cluster 2022-09-06 11:33:12 -06:00
Qunxin Liu 470944901f [instance] add benchmarks for instancing 2022-09-01 13:22:05 -06:00
Qunxin Liu 88c02e0024 [instance] add tests for full instancing
Also update previous tests with GDEF/GPOS tables
2022-09-01 09:44:28 -07:00
David Corbett ade87e1538 [Unicode 15] Add tests 2022-08-27 19:11:19 -04:00
David Corbett e93c2d1309 [Unicode 15] Update the emoji table & cluster test 2022-08-27 19:11:19 -04:00
David Corbett d0c32c5a0e [Unicode 15] Update the UCD table 2022-08-27 19:11:16 -04:00
Qunxin Liu f887ee0c67 [instance] update post.italicAngle
Add tests for instancing glyf/hmtx
2022-08-22 09:30:09 -07:00
Behdad Esfahbod 4ab7e579cb Make HB_BORING_EXPANSION opt-in instead of opt-out
Fixes https://github.com/harfbuzz/harfbuzz/issues/3757
2022-08-12 12:23:48 -06:00
Qunxin Liu 7fde6ab025 fuzzer fix: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49790 2022-08-05 15:10:31 -06:00
Khaled Hosny afe6629b2f Fix make dist 2022-08-03 19:56:29 +02:00
Behdad Esfahbod e68e874da6 Update test/fuzzing/README 2022-08-03 11:31:34 -06:00
Behdad Esfahbod fc9e6ae8d9 [run-tests.py] Write out the failing test 2022-07-30 12:02:36 -06:00
Behdad Esfahbod 56a5bc3bd0 [emoji] Regenerate test data
Fix generator.
2022-07-30 00:08:44 -06:00
Garret Rieger f3aff45e04 [repacker] Update call to hb_subset_repack_or_fail in tests. 2022-07-29 16:16:46 -06:00
Behdad Esfahbod bdbb8c297e Add test for previous commit 2022-07-29 12:04:28 -06:00
Behdad Esfahbod e2cc34e190 [subset/GPOS] Fix a fuzzer timeout test
Fixes https://oss-fuzz.com/testcase-detail/5234369031176192
2022-07-26 12:31:40 -06:00
Behdad Esfahbod 1945b400da [cpluscplus] Wrap hb-subset types as well
Also changes signature of get_user_data of hb.h types to take const
object. This is safe.
2022-07-25 10:45:55 -06:00
Behdad Esfahbod 4cb83967aa [subset/ClassDefFormat2] Fix timeout
Fixes https://oss-fuzz.com/testcase-detail/5417800474165248
2022-07-23 11:00:20 -06:00
Behdad Esfahbod 32c85b8c8c [avar2] Fix mapping when coords length don't match
Ouch.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49407
2022-07-23 10:50:26 -06:00
Behdad Esfahbod 9eab3ac72d [CoverageFormat2] Remove hand-written loop
While on a fuzzer-found test case (added) that loop was faster,
on real fonts, including NotoNastaliq in our benchmark, it was
actually slower, which intuitively I would have expected.

Still no idea why on that fuzzer case it's faster though. :(
2022-07-21 12:36:53 -06:00
Behdad Esfahbod 7050021fed [cursive-positioning.tests] Fix test specification
Still failing. Figuring out.
2022-07-20 11:27:12 -06:00