Commit Graph

140 Commits

Author SHA1 Message Date
Garret Rieger 8658c257c4 [subset] In LigatureSubst subsetting, check if the ligature glyph is in glyphset.
Otherwise coverage will not match the retained ligature sets.
2023-04-17 14:35:27 -06:00
Garret Rieger a84cae424d [subset] Don't add invalid gids (-1) to the glyphset when loading glyph map from the accelerator. 2023-03-15 12:10:18 -06:00
Behdad Esfahbod 7327006d68 [GSUB] Support SingleSubst in get_glyph_alternates
Fixes https://github.com/harfbuzz/harfbuzz/discussions/4146
2023-03-07 21:06:01 -07:00
Behdad Esfahbod 08784baf10 [GSUB/GPOS] Fix sanitization in Format1
Fixes https://oss-fuzz.com/testcase-detail/5120727025319936
2023-03-02 10:48:30 -07:00
Behdad Esfahbod c67c0086ef [GPOS] Fix indexing in MarkLigPos
This was broken in 8708b9e081.

Fixes https://github.com/harfbuzz/harfbuzz/issues/4142
2023-03-01 13:32:44 -07:00
Garret Rieger 918193ebf9 [subset] fix a class of fuzzer timeouts caused by large shared coverage tables.
More acurately estimates the op count for CoverageFormat2 tables as the population size instead of the size in bytes.
2023-02-22 16:57:39 -07:00
Behdad Esfahbod adccc5355b [MarkBase] Adjust base-finding logic
Fixes https://github.com/harfbuzz/harfbuzz/issues/4124
2023-02-17 12:29:42 -07:00
Behdad Esfahbod 64fa5cd482 [GPOS] Fix assert fail introduced recently
Was introduced in 8708b9e081.

If these lookups are recursed to from (Chain)Context out-of-order,
it was possible that last_base > buffer->idx, in which case we
were attaching marks to a base after them... and an assertion
was failing fortunately.

Fixes https://oss-fuzz.com/testcase-detail/6377756666757120
2023-02-07 15:52:53 -07:00
Behdad Esfahbod 8708b9e081 [GPOS] Avoid O(n^2) behavior in mark-attachment
Better implementation; avoids arbitrary limit on look-back.
2023-02-06 14:51:25 -07:00
Matthias Clasen 09b7fce857 Make includes relative 2023-01-28 12:09:45 -07:00
Matthias Clasen e25e4c9a52 Move GDEF table to src/OT/Layout/GDEF 2023-01-28 12:09:45 -07:00
Behdad Esfahbod 749df4ee84 [PairPosFormat1] One more 2023-01-21 16:00:54 -07:00
Behdad Esfahbod b648ceb72f [PairSet] Optimize last commit 2023-01-21 15:58:59 -07:00
Behdad Esfahbod 891623243c [PairSet] Unify get_size() 2023-01-21 15:57:18 -07:00
Behdad Esfahbod b63159e8bf [PairPosFormat1] Fix stride
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55287
and generally the lookup with MediumTypes.
2023-01-21 15:51:40 -07:00
Behdad Esfahbod be8a87c453 Move TRACE_DISPATCH after may_recurse()
Such that we don't get memory access issues if DEBUG_SANITIZE is
on and may_recurse() returns false.
2023-01-21 15:50:25 -07:00
Behdad Esfahbod ed023f66df Enable -Wformat-signedness
And fix the codebase.
2023-01-12 17:04:24 -07:00
Behdad Esfahbod b33eb9ecfc [subset-plan] Simplify layout_variation_idx_delta_map allocation 2023-01-11 11:20:04 -07:00
Behdad Esfahbod 0728098e45 [Coverage] Speed up subset for too-large Coverage tables
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54980
2023-01-10 10:19:00 -07:00
Behdad Esfahbod 301f6e4b47 [Coverage] Remove TODO 2022-12-04 11:46:10 -07:00
Behdad Esfahbod dbbb8e8006 Revert "[map] Add hb_map_filter_invalid"
This reverts commit 8d7e921117.

Surprisingly this slowed NotoNastaliqUrdu benchmark down by a couple
percent instead of speeding it up.
2022-12-04 11:13:39 -07:00
Behdad Esfahbod 8d7e921117 [map] Add hb_map_filter_invalid
Use it in one place.
2022-12-04 11:02:15 -07:00
Behdad Esfahbod 41a8597f38 [layout] Simplify CoverageFormat2 intersects_coverage() 2022-12-03 13:23:26 -07:00
Behdad Esfahbod 1f4d8ccaed [CoverageFormat2] Optimize intersects() 2022-12-03 13:17:15 -07:00
Behdad Esfahbod c482b06108 [gpos] Optimize PairPosFormat1::intersects 2022-12-03 13:14:31 -07:00
Behdad Esfahbod 4d19c724c0 [CoverageFormat1] Speed up intersects()
Speeds up SourceHanSerif/10000 benchmark (not in test suite) by
32%!
2022-12-03 09:57:29 -07:00
Behdad Esfahbod 2a7a1d5a73 [Coverage] Avoid timeout on broken ranges
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53929
2022-12-02 12:33:24 -07:00
Behdad Esfahbod 72fabef0a4 [SingleSubstFormat2] Speed up closure 2022-11-30 11:37:49 -07:00
Behdad Esfahbod d2a2670e54 [iter] Simplify has() interface implementations 2022-11-28 19:43:09 -07:00
Behdad Esfahbod 3e151139a8 [PairPos] Optimize get_effective_value_format
Speeds up BM_subset/subset_glyphs/SourceHanSans-Regular_subset.otf/nohinting/512
12%.
2022-11-28 14:23:49 -07:00
Behdad Esfahbod 26ad7a6022 [gpos] Minor micro-optimize 2022-11-28 14:12:52 -07:00
Behdad Esfahbod c769d7e181 [gpos] Whitespace 2022-11-28 14:03:58 -07:00
Behdad Esfahbod e3cc61838f [PairPos] Adjust kerning buffer messages 2022-11-26 13:58:04 -07:00
Behdad Esfahbod 6aaa16627c [Coverage] Comment 2022-11-24 14:58:42 -07:00
Behdad Esfahbod 05aa084e67 [PairPos] Another attempt at fixing unsafe-to-break with ValueFormat2
Fixes https://github.com/harfbuzz/harfbuzz/issues/3888#issuecomment-1326781116

Test:
$ hb-shape XBRoya34.ttf  ' الأ' --show-flags --script=arab
2022-11-24 12:14:09 -07:00
Behdad Esfahbod 58a696d80e More hb_memset 2022-11-22 12:56:05 -07:00
Behdad Esfahbod a0bde1e1ea [open-type] Remove (Sorted)ArrayOf.sub_array() 2022-11-16 21:27:12 -07:00
Behdad Esfahbod ea63e95e4c [GPOS.PairPos] Adjust unsafe-to-break for non-zero ValueFormat2
Fixes https://github.com/harfbuzz/harfbuzz/issues/3824
2022-11-14 12:36:48 -07:00
Behdad Esfahbod fc935fb81b Fix snprintf use
https://github.com/harfbuzz/harfbuzz/pull/3495#issuecomment-1299107964
2022-11-01 14:40:47 -06:00
Behdad Esfahbod 02b76393ef [config] Re-enable BORING_EXPANSION
Only the non-experimental parts (currently avar2) are
enabled by default.
2022-10-29 11:19:04 -06:00
Behdad Esfahbod 9aad3dba8f [SingleSubst] Fix degenerate-lookup test
Part of https://github.com/harfbuzz/harfbuzz/issues/3853
2022-10-26 13:04:02 -06:00
Behdad Esfahbod 294b1c9f6e Use snprintf instead of sprintf 2022-10-13 11:30:02 -06:00
Qunxin Liu 8f3a7017c3 [instance] support FeatureVariations table 2022-09-29 12:14:43 -06:00
Behdad Esfahbod 4bf9621113 [optical-bounds] Optimize 2022-09-01 13:36:26 -06:00
Behdad Esfahbod 5d6f1a88e4 [layout] Add hb_ot_layout_get_optical_bound() 2022-09-01 13:36:26 -06:00
Qunxin Liu 6de0a6f0b7 [instance] update GPOS ValueRecord table 2022-09-01 09:43:46 -07:00
Qunxin Liu 61636d4efe [instance] update GPOS AnchorFormat3 table 2022-09-01 09:37:00 -07:00
Qunxin Liu b72995ff16 [instance] GDEF table: collect both varidxes and deltas 2022-09-01 09:33:02 -07:00
Garret Rieger 5ea3c0be8f [repacker] Implement MarkArray::clone. 2022-08-11 22:21:28 +00:00
Behdad Esfahbod f4f7d691af
Merge pull request #3779 from harfbuzz/split_pair_pos_2
[repacker] Add PairPosFormat2 table splitting in the repacker.
2022-08-09 22:23:23 -06:00