Commit graph

2419 commits

Author SHA1 Message Date
Khaled Hosny
69e1c3c352 [ft] Add hb_ft_font_get_ft_face()
A new name for hb_ft_font_get_face(), which is now deprecated.

Fixes  https://github.com/harfbuzz/harfbuzz/issues/5084
2025-02-28 23:56:03 +02:00
Garret Rieger
ea1434b897 Split iup glyf partial instance tests into a separate set which ignores due to IUP rounding differences fonttools. 2025-02-25 19:02:11 +00:00
Behdad Esfahbod
9a0cf8d641 [test/subset/cff-japanese] Shrink test
Was taking too long.
2025-02-25 00:19:25 -07:00
Behdad Esfahbod
084fb3ab4f [test/subset/cmap] Shrink test
Was taking more than the rest of the test suite combined.
2025-02-25 00:16:27 -07:00
Behdad Esfahbod
74bb7c52f3 Fix a compiler warning 2025-02-24 20:21:38 -07:00
Khaled Hosny
03cf1565f5 [directwrite] Rename font_get_font to font_get_dw_font
https://github.com/harfbuzz/harfbuzz/pull/5079#pullrequestreview-2627407692
2025-02-20 22:16:22 +02:00
Khaled Hosny
a8fd29718a [directwrite] Add hb_directwrite_font_create()/font_get_font()
Uses hb_directwrite_face_create() under the hood, but copies variations
from directwrite to hb-font.
2025-02-20 21:40:27 +02:00
Khaled Hosny
ff3aaece6d [test/shape-plan] Add another test and some comments 2025-02-14 21:54:30 +02:00
Khaled Hosny
cf336f17b2 [shape-plan] Rename hb_ot_shape_plan_get_features to get_feature_tags
Simplify the API by returning only feature tags. The users of this API
would be interested only in feature enabled by default and whether the
feature is globally or partially enabled wouldn’t be of much interest in
that case. For user features, the user of the API already have full
access to them.
2025-02-14 21:54:30 +02:00
Khaled Hosny
a7d7715f10 [shape-plan] Add hb_ot_shape_plan_get_features
This should get the features on a shape plan after executing it.

Initially I wanted to return an array of tags, but then there can be
user features that are not enabled globally, so I thought returning
hb_feature_t with value and range would be better. There is a TODO since
I couldn’t figure out how to get the value and range from the feature
mask. But also it may be overkill and a simple boolean indicating wither
it is a global feature or not would be enough.

I wounder also what should happen to non-user features that are applied
selectively, like init or medi, does ot make sense to indicate whether
they are global or not?

This is inspired by the discussion in:
https://github.com/fontforge/fontforge/pull/5522#pullrequestreview-2574321449,
but it might be useful to other HarfBuzz users.
2025-02-14 21:54:30 +02:00
Khaled Hosny
8c561733b6 [test/coretext] Add a test for copying variations 2025-02-12 14:21:09 +02:00
Khaled Hosny
7ba3efa5c6 [tests/fuzzing] Use the correct dirs for subset and repacker fuzzers 2025-02-09 18:42:45 +02:00
Khaled Hosny
c404d8fc70 [test/fuzzing] Merge hb_fuzzer_tools.py back and simplify 2025-02-09 18:11:38 +02:00
Khaled Hosny
4c43fdcd07 [test/fuzzing] Simplify Python scripts further
We always path the fuzzer path in meson, so we don’t need to search for
fuzzer path in the scripts, and then we can use one script for all the
fuzzers.
2025-02-09 18:11:34 +02:00
Behdad Esfahbod
c29b1de39f [test/fuzzing] Remove old cruft 2025-02-09 15:38:18 +00:00
Behdad Esfahbod
86329643fd [test/fuzzing] Call binaries with 64 fonts at a time
Second try... Previous attempt caused a too-many-command-line-args
on Windows.

https://github.com/harfbuzz/harfbuzz/issues/5061
2025-02-09 15:12:03 +00:00
Behdad Esfahbod
be22e43d7d [test/fuzzing] Run each fuzzer on all fonts in one process
Much much faster, specially under valgrind, than spawning one process per font.

Fixes https://github.com/harfbuzz/harfbuzz/issues/5061
2025-02-09 14:55:44 +00:00
Behdad Esfahbod
6738ee3d1b [ci/fedora-valgrind] Add time multiplier of 10 and run slow tests 2025-02-09 13:50:27 +00:00
Behdad Esfahbod
fc4d507770 [hb-draw-fuzzer] Increase test time
I'm getting timeouts. Might be an infinite loop. But let's see.
2025-02-09 13:28:45 +00:00
Behdad Esfahbod
cb6779f9e5 [test] Try running slow tests early
Probably already happens, but this wouldn't hurt.

https://github.com/harfbuzz/harfbuzz/issues/4153#issuecomment-2646125367
2025-02-09 08:39:03 +00:00
Behdad Esfahbod
134eef550d [test] Reorder test suites
Makes it a bit faster.

https://github.com/harfbuzz/harfbuzz/issues/4153#issuecomment-2646120679
2025-02-09 08:26:11 +00:00
Behdad Esfahbod
c55738fa77 [test] Set MALLOC_CHECK_ to 1 instead of 2; kill G_SLICE=always-malloc
MALLOC_CHECK_=2 makes running tests twice slower on macOS. Value 1
is as fast as not checking at all. It's not like this ever caught
a bug for us or anything. We have so many sanitizers and fuzzers
funning on CI, which catch all kinds of memory problems.

G_SLICE is long gone in glib.

The slowest part of running the test suite now is the google-benchmark
tests, that get run by us... I'll see if I can disable. I had reported
it before at https://github.com/harfbuzz/harfbuzz/issues/4153
2025-02-09 08:11:01 +00:00
Behdad Esfahbod
be287eab02 [trak] Don't shift glyphs
That's what CoreText does and fonts are designed for. Who are we to improve on...
2025-02-09 04:19:02 +00:00
Behdad Esfahbod
1150d4bf12 [trak] Remove support for disabling using pseudo-font-feature
Fixes https://github.com/harfbuzz/harfbuzz/issues/5052
2025-02-09 04:16:57 +00:00
Behdad Esfahbod
1bf0a5bc17 [trak] Streamline a bit
Also use float math.
2025-02-09 02:43:09 +00:00
Behdad Esfahbod
b1677e76aa [trak] Handle "out-of-range" values better
If requested size < min-size, use the value for min-size.
If requested size > max-size, use the value for max-size.

This is the only way that makes sense. Extrapolating as we were
doing, is just wrong...

This also seems to match what CoreText does.

Adjacent to fixing https://github.com/harfbuzz/harfbuzz/issues/5054
2025-02-09 02:05:36 +00:00
Behdad Esfahbod
f394206b7c [ot-shape] Only apply trak'ing if STAT table present 2025-02-06 19:56:33 +00:00
Behdad Esfahbod
7f5fac7c87 [test-buffer] Fix unintionally merged change 2025-02-04 23:35:34 +00:00
Behdad Esfahbod
f0ead85283 [aat] Implement set filtering for Noncontextual chains as well 2025-02-04 23:30:30 +00:00
Khaled Hosny
4825e5e2b4 [face] Add fallback implementation to hb_face_reference_blob
If referencing the face blob is not possible (e.g. not implemented by
the font functions), use face builder to create a blob out of
individual table blobs.

Fixes https://github.com/harfbuzz/harfbuzz/issues/5036
2025-02-04 15:45:22 +02:00
Behdad Esfahbod
b394ab39e9 [test-buffer] Add code for testing end_ptr 2025-02-01 14:26:32 +00:00
Behdad Esfahbod
9ef009f597 [test] Fix test
Broken by previous commit.
https://github.com/harfbuzz/harfbuzz/issues/5020#issuecomment-2613597379
2025-01-24 16:37:12 -07:00
Garret Rieger
bdb50f1c6e [repacker] Also rename api method from hb_subset_repack_or_fail -> hb_subset_serialize_or_fail. 2025-01-07 13:39:51 -07:00
Garret Rieger
056504168c [repacker] rename hb-subset-repacker -> hb-subset-serialize.
Also hb_link_t and hb_object_t to hb_subset_serialize_link_t and hb_subset_serialize_object_t.
2025-01-07 13:39:51 -07:00
Garret Rieger
5a6f5922dd [repacker] Promote repacking API to stable.
For #227.
2025-01-07 11:28:38 -07:00
David Corbett
57569baa65 Don’t insert U+25CC before super/subscript digits 2025-01-03 05:19:13 -07:00
David Corbett
edb3b20895 Make hb_test_tools.py work in Python 3.13 2024-12-15 12:34:48 -07:00
David Corbett
f887096ab1 [myanmar] Allow all tones (& visarga) in any order 2024-12-15 12:32:08 -07:00
Khaled Hosny
773fe85018 [layout] Blocklist the GDEF table of various Courier New versions
These files have incorrectly give several base glyphs GDEF mark glyph
class leading in zeroing there advance widths.

Fixes https://github.com/harfbuzz/harfbuzz/issues/4936
2024-11-21 14:40:57 -07:00
Garret Rieger
b0d52abe97 [subset] consider variation selectors subsetting cmap14
cmap14 subsetting code was not considering variation selectors in the input unicode set when deciding which variant glyphs to keep. This updates subsetting to only keeps variant glyphs if their variation selector code point is in the input unicodes set.

For https://github.com/harfbuzz/harfbuzz/issues/4911
2024-11-11 13:45:08 -07:00
Qunxin Liu
622e9c33c3 [instancer] fix for incorrect offset calculation when we have gvar padding 2024-11-06 12:38:00 -07:00
Behdad Esfahbod
2dc6334133 [tests] Remove invalid tests from collections.tests
Previously we silently returned the empty face if face_index
was out of range. With util/ now using the new API
hb_font_face_create_from_file_or_fail(), that returns a nullptr
face now. So, adjust tests.
2024-10-15 14:58:13 -06:00
Behdad Esfahbod
755929c48d Fix more compiler warnings
In case FreeType is not available.
2024-10-12 20:08:32 -06:00
Khaled Hosny
4d1f6e049c [COLR] Enable COLRv0 support in get_extents()
paint_glyph() supports COLRv0 but this code is never reached because of
the early return if version is not 1. This early return seems to be from
before COLRv0 extents were supported.
2024-10-07 13:24:14 -06:00
Julien Nabet
e157205499 unused-parameter in test/fuzzing/hb-draw-fuzzer.cc
../test/fuzzing/hb-draw-fuzzer.cc:19:28: error: unused parameter 'dfuncs' [-Werror,-Wunused-parameter]
_move_to (hb_draw_funcs_t *dfuncs, void *draw_data_,
                           ^
../test/fuzzing/hb-draw-fuzzer.cc:22:10: error: unused parameter 'user_data' [-Werror,-Wunused-parameter]
          void *user_data)
                ^
../test/fuzzing/hb-draw-fuzzer.cc:31:28: error: unused parameter 'dfuncs' [-Werror,-Wunused-parameter]
_line_to (hb_draw_funcs_t *dfuncs, void *draw_data_,
                           ^
../test/fuzzing/hb-draw-fuzzer.cc:34:10: error: unused parameter 'user_data' [-Werror,-Wunused-parameter]
          void *user_data)
                ^
../test/fuzzing/hb-draw-fuzzer.cc:44:33: error: unused parameter 'dfuncs' [-Werror,-Wunused-parameter]
_quadratic_to (hb_draw_funcs_t *dfuncs, void *draw_data_,
                                ^
../test/fuzzing/hb-draw-fuzzer.cc:46:15: error: unused parameter 'control_x' [-Werror,-Wunused-parameter]
               float control_x, float control_y,
                     ^
../test/fuzzing/hb-draw-fuzzer.cc:46:32: error: unused parameter 'control_y' [-Werror,-Wunused-parameter]
               float control_x, float control_y,
                                      ^
../test/fuzzing/hb-draw-fuzzer.cc:48:15: error: unused parameter 'user_data' [-Werror,-Wunused-parameter]
               void *user_data)
                     ^
../test/fuzzing/hb-draw-fuzzer.cc:58:29: error: unused parameter 'dfuncs' [-Werror,-Wunused-parameter]
_cubic_to (hb_draw_funcs_t *dfuncs, void *draw_data_,
                            ^
../test/fuzzing/hb-draw-fuzzer.cc:60:11: error: unused parameter 'control1_x' [-Werror,-Wunused-parameter]
           float control1_x, float control1_y,
                 ^
../test/fuzzing/hb-draw-fuzzer.cc:60:29: error: unused parameter 'control1_y' [-Werror,-Wunused-parameter]
           float control1_x, float control1_y,
                                   ^
../test/fuzzing/hb-draw-fuzzer.cc:61:11: error: unused parameter 'control2_x' [-Werror,-Wunused-parameter]
           float control2_x, float control2_y,
                 ^
../test/fuzzing/hb-draw-fuzzer.cc:61:29: error: unused parameter 'control2_y' [-Werror,-Wunused-parameter]
           float control2_x, float control2_y,
                                   ^
../test/fuzzing/hb-draw-fuzzer.cc:63:11: error: unused parameter 'user_data' [-Werror,-Wunused-parameter]
           void *user_data)
                 ^
../test/fuzzing/hb-draw-fuzzer.cc:73:31: error: unused parameter 'dfuncs' [-Werror,-Wunused-parameter]
_close_path (hb_draw_funcs_t *dfuncs, void *draw_data_,
                              ^
../test/fuzzing/hb-draw-fuzzer.cc:75:13: error: unused parameter 'user_data' [-Werror,-Wunused-parameter]
             void *user_data)
                   ^
16 errors generated.
2024-10-06 22:48:37 +03:00
Julien Nabet
8de0d91166 missing-field-initializers in test/api/test-ot-face.c
FAILED: test/fuzzing/hb-shape-fuzzer.p/hb-shape-fuzzer.cc.o clang++ -Itest/fuzzing/hb-shape-fuzzer.p -Itest/fuzzing -I../test/fuzzing -I. -I.. -Isrc -I../src -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++11 -fno-exceptions -O3 -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -DHAVE_CONFIG_H -Wall -Wextra -Werror -MD -MQ test/fuzzing/hb-shape-fuzzer.p/hb-shape-fuzzer.cc.o -MF test/fuzzing/hb-shape-fuzzer.p/hb-shape-fuzzer.cc.o.d -o test/fuzzing/hb-shape-fuzzer.p/hb-shape-fuzzer.cc.o -c ../test/fuzzing/hb-shape-fuzzer.cc In file included from ../test/fuzzing/hb-shape-fuzzer.cc:9: ../test/fuzzing/../api/test-ot-face.c:47:34: error: missing field 'y_bearing' initializer [-Werror,-Wmissing-field-initializers]
hb_glyph_extents_t extents = {0};
^
../test/fuzzing/../api/test-ot-face.c:85:55: error: missing field 'enable' initializer [-Werror,-Wmissing-field-initializers]
hb_aat_layout_feature_selector_info_t setting = {0};
^
2 errors generated.
2024-10-06 12:47:27 -06:00
David Corbett
b6196986d7 [USE] Update the data files
This uses the data files from
<e00698c07a/USE>.
2024-10-03 19:54:54 -06:00
Behdad Esfahbod
867366ccf1 [test] Add GeezaPro tests for MacOS 15.0 2024-09-24 09:40:44 -06:00
Behdad Esfahbod
7aace3d3fc Ignore CGJ and Mongolian Variation Selectors during GPOS
Fixes https://github.com/harfbuzz/harfbuzz/issues/4869
2024-09-23 08:00:06 -06:00
Behdad Esfahbod
5e5cd10e10 Don't make variation-selectors default-ignorable if not-found set
https://github.com/harfbuzz/harfbuzz/pull/4863#issuecomment-2366908261
2024-09-23 06:30:59 -06:00