src/OT/Layout/GSUB

Branch


Log

Author Commit Date CI Message
Behdad Esfahbod 4a26e289 2025-09-30T15:31:04 Add `hb_ot_layout_lookup_collect_glyph_alternates()` (#5367) * [map] Massage operator << overloads * [ot-layout] Add +hb_ot_layout_lookup_collect_glyph_alternates To collect all glyph mapping from SingleSubst or AlternateSubst lookups in one call. Needed by FreeType autohinter for performance. New API: +hb_ot_layout_lookup_collect_glyph_alternates() * [layout] Change hb_ot_layout_lookup_collect_glyph_alternates() API https://github.com/harfbuzz/harfbuzz/pull/5367#discussion_r2149019638
Behdad Esfahbod 6b62d367 2025-08-25T14:02:59 [ligature-cache] Handle case of ligature with no components (#5500) In the cache with "seconds" set-digest.
Behdad Esfahbod 8bdedb3b 2025-08-20T00:27:41 Limit external caches (#5483) * Revert "[external_cache] Remove a conditional (#5471)" This reverts commit 9794ad9e00ff66741c36ec9511e3e968663b74a7. * Limit external_cache to 8 subtables per lookup
Behdad Esfahbod 22545743 2025-08-20T00:06:00 Match positions no malloc (#5481) * Reduce allocation of match_positions by caching one in ctx * Use a stack-array for small match-positions This surgically enables stack-backed storage in vector. * Handle match-positions alloc failure And make allocations unchecked. * Clean up CFF hack to use static storage in vector * Fixup for match_positions allocations * Fix vector handling of foreign arrays memory management
Behdad Esfahbod 9794ad9e 2025-08-16T15:51:05 [external_cache] Remove a conditional (#5471)
Behdad Esfahbod 368598b5 2025-08-16T00:38:42 Increase match_positions stack allocation from 4 to 8 (#5468) Slight speedup on NotoNastaliq.
Behdad Esfahbod dae2c8bb 2025-08-14T22:26:40 [ligature] Add a set-digest on the second component (#5464)
Behdad Esfahbod 8268473a 2025-08-14T21:57:19 Add external_cache_create separate from cache_func (#5463) * Add external_cache_create separate from cache_func * Simplify cache_func_t signature * Rename a cache type * Rename another cache type
Behdad Esfahbod cf614fc8 2025-08-14T16:23:45 [LigatureSet] Use slow path only if <= 1 ligatures (#5462)
Behdad Esfahbod 6ec1b279 2025-08-11T01:14:19 [lookup] Give each subtable an external-cache opportunity (#5449) * [lookup] Give each subtable an external-cache opportunity * [subtable-cache] Fixups
Behdad Esfahbod 7b56d3a1 2025-07-26T05:35:57 [ot-layout] s/hb_ot_lookup_cache_t/hb_ot_layout_mapping_cache_t/g
Behdad Esfahbod 09978fc5 2025-07-26T04:20:59 [ot] Rename hb_ot_lookup_cache_op_t, and cache to subtable_cache
Behdad Esfahbod 3d154bc6 2025-07-14T13:53:27 [buffer-message] Fix potential buffer overflow... ...when buffer messaging is enabled and with malicious font. Fixes https://github.com/harfbuzz/harfbuzz/security/advisories/GHSA-p965-5rr7-9mhq
Garret Rieger 38ab13c6 2025-07-04T22:31:04 [repacker] add support for splitting GSUB Ligature lookups.
Behdad Esfahbod 89e28a23 2025-05-10T16:30:35 [skippy-iter] Use auto for type deduction
Behdad Esfahbod b8327fe6 2025-02-06T20:01:12 Fix compiler errors
Behdad Esfahbod c7378294 2025-02-06T01:42:25 [OT] Remove likely() from coverage check Not that it matters, but because of the set-digest, this path is not very likely() anymore.
Behdad Esfahbod cad264b2 2025-02-06T00:56:16 Indent
Behdad Esfahbod 69057e6e 2025-02-05T19:50:38 [Ligature] Cache coverage the same way as PairPos1 Another 7% down on Roboto-Regular.
Behdad Esfahbod ba1f194a 2024-05-02T12:18:11 [gsubgpos] Reduce stack use in recursion
Behdad Esfahbod 3a9262cc 2023-11-04T12:52:46 [sanitize] More hb_barrier() annotations
Behdad Esfahbod 9fc45f70 2023-10-05T14:06:39 [ReverseChainSingleSubst] Minor optimization
Behdad Esfahbod dcd3afca 2023-08-01T20:09:34 [skippy-iter] Remove unused num_items
Behdad Esfahbod 60db1427 2023-07-24T20:49:32 [layout] Remove unused "max-size" cruft
Behdad Esfahbod aa381ae9 2023-07-18T10:42:13 [ReverseChain] Remove SIZE_MAX Oops. Can't set it since the struct has offsets.
Behdad Esfahbod e583c9e9 2023-07-18T10:34:26 [ReverseChain] Add max-size
Behdad Esfahbod 49730531 2023-07-16T13:09:49 Config
Behdad Esfahbod 645fabd1 2023-07-16T11:36:59 [gsubgpos] Vastly speed up ChainRuleSet / RuleSet matching Match the first component in a fast loop. Idea replicated from LigatureSet. Speeds up Gulzar shaping by 22%! 37% in NotoNastaliqUrdu!
Behdad Esfahbod 77080f86 2023-07-16T11:26:32 .
Behdad Esfahbod 62e10c9f 2023-07-16T08:43:18 Revert "[gsubgpos] Allocate iterators further up" This reverts commit b9f364b8fcacf8ab32d0272190d8509f214e55f2.
Behdad Esfahbod b9f364b8 2023-07-16T08:42:36 [gsubgpos] Allocate iterators further up To avoid calling set_match_func repeatedly. Doesn't show speedup. Going to revert.
Behdad Esfahbod f94508ed 2023-07-15T15:28:19 [Ligature] Micro-optimize
Behdad Esfahbod d84c5f29 2023-07-08T15:22:51 Revert "[gsubgpos] Make (Chain)Context funcs templatized" This reverts commit 03ac08d267eb7ad2f1ac039115fc0030ea475fae.
Behdad Esfahbod e73223b9 2023-07-08T15:22:18 [gsubgpos] Make (Chain)Context funcs templatized Unfortunately they still won't be inlined because the matcher_t needs function pointers. So, no speed up. Going to revert.
Behdad Esfahbod 2006d321 2023-07-07T17:07:11 [sanitize] Add "fastpath" for ArrayOfOffset16To<> objects with max size Unfortunately this doesn't speed up NotoNastaliq or Gulzar as I was hoping for. Their GSUB tables are not large enough for this to kick in...
Behdad Esfahbod 7a85663c 2023-07-07T19:21:18 Revert "[sanitize] Add "fastpath" for ArrayOfOffset16To<> objects with max size" This reverts commit 10f8556c73f3cf231c6b5a900a6a1903f9516f90. This was, unfortunately, wrong :(.
Behdad Esfahbod 10f8556c 2023-07-07T17:07:11 [sanitize] Add "fastpath" for ArrayOfOffset16To<> objects with max size
Behdad Esfahbod 68b78914 2023-07-07T17:07:11 [sanitize] Add "fastpath" for ArrayOfOffset16To<> objects with max size Unfortunately this doesn't speed up NotoNastaliq or Gulzar as I was hoping for. Their GSUB tables are not large enough for this to kick in...
Behdad Esfahbod 90752cd5 2023-07-07T15:47:28 [type] Add HeadlessArray16Of
أحمد المحمودي (Ahmed El-Mahmoudy) 10b9ca54 2023-06-28T07:46:33 Fix typo: subtitution -> substitution
Behdad Esfahbod 82741304 2023-06-04T09:41:41 [subset] start_embed never returns nullptr Remove checks.
Behdad Esfahbod ca27925d 2023-06-03T16:18:15 Use hb_codepoint_pair_t in more places
Behdad Esfahbod ee9b631d 2023-05-05T10:26:57 [SingleSubst] Fix condition to upgrade to beyond-64k
Behdad Esfahbod 0e9ebf10 2023-05-05T06:57:51 [config] Add HB_OPTIMIZE_SIZE_MORE and enable in HB_TINY Part of https://github.com/harfbuzz/harfbuzz/issues/4220
Behdad Esfahbod 31949636 2023-05-04T16:29:48 Revert "[layout] Cache subtable coverages in hb_map_t" This reverts commit 7a715d74e06720c17d28ba7b4c3da0b583f8d1d3.
Behdad Esfahbod 7a715d74 2023-05-04T16:28:11 [layout] Cache subtable coverages in hb_map_t Proof-of-concept. Going to revert. Memory consumption is more than I like. It does speed up Roboto shaping another 15% though. Perhaps if we could add logic to choose which subtables to cache, this might be a useful approach.
Behdad Esfahbod ae0fe02d 2023-05-03T13:24:08 [Ligature] Use slow path if 2 or fewer ligatures
Behdad Esfahbod ddd6c2e7 2023-05-03T13:16:39 [Ligature] Micro-optimize more
Behdad Esfahbod 0fe90ebc 2023-05-03T12:49:31 [Ligature] Micro-optimize
Behdad Esfahbod 51061d28 2023-05-03T12:46:04 [Ligature] Minor tweak to recent code
Behdad Esfahbod 7881eadf 2023-05-02T14:56:18 [Ligature] Speed up Match the first component of the ligature in the LigatureSet loop. Speeds up Roboto shaping by 25%. I don't think it breaks anything. The test suite seems happy.
Garret Rieger 8658c257 2023-04-17T19:46:46 [subset] In LigatureSubst subsetting, check if the ligature glyph is in glyphset. Otherwise coverage will not match the retained ligature sets.
Behdad Esfahbod 7327006d 2023-03-07T21:06:01 [GSUB] Support SingleSubst in get_glyph_alternates Fixes https://github.com/harfbuzz/harfbuzz/discussions/4146
Behdad Esfahbod 08784baf 2023-03-02T10:48:30 [GSUB/GPOS] Fix sanitization in Format1 Fixes https://oss-fuzz.com/testcase-detail/5120727025319936
Garret Rieger 918193eb 2023-02-22T23:11:29 [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.
Behdad Esfahbod be8a87c4 2023-01-21T15:00:41 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.
Behdad Esfahbod ed023f66 2023-01-12T17:04:24 Enable -Wformat-signedness And fix the codebase.
Behdad Esfahbod 72fabef0 2022-11-30T11:37:49 [SingleSubstFormat2] Speed up closure
Behdad Esfahbod a0bde1e1 2022-11-16T21:27:12 [open-type] Remove (Sorted)ArrayOf.sub_array()
Behdad Esfahbod fc935fb8 2022-11-01T14:39:33 Fix snprintf use https://github.com/harfbuzz/harfbuzz/pull/3495#issuecomment-1299107964
Behdad Esfahbod 02b76393 2022-10-29T11:15:03 [config] Re-enable BORING_EXPANSION Only the non-experimental parts (currently avar2) are enabled by default.
Behdad Esfahbod 9aad3dba 2022-10-26T13:04:02 [SingleSubst] Fix degenerate-lookup test Part of https://github.com/harfbuzz/harfbuzz/issues/3853
Behdad Esfahbod 294b1c9f 2022-10-13T11:30:02 Use snprintf instead of sprintf
Qunxin Liu 8f3a7017 2022-09-09T15:00:37 [instance] support FeatureVariations table
Behdad Esfahbod a4e0fd16 2022-08-05T15:05:51 [MultipleSubst] Rewrite serialize signature as single iterator
Behdad Esfahbod 65d28bc5 2022-08-05T14:56:07 [MultipleSubst] Rewrite serialize() in terms of iterators Unused still, and hence untested
Behdad Esfahbod b57ea3b0 2022-08-05T14:29:27 Revert "[iter] Use && in uses of is_source_of" This reverts commit ccbba667a9bdc096f0053d5e3ee951a8b6298e8a.
Behdad Esfahbod ccbba667 2022-08-05T11:51:51 [iter] Use && in uses of is_source_of
Behdad Esfahbod 914542bd 2022-08-03T17:43:50 Whitespace
Behdad Esfahbod 6549aec8 2022-08-01T13:11:14 [SingleSubstFormat1] Help avoid timeouts in closure() some more For https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49712
Behdad Esfahbod 149b0305 2022-07-29T12:41:30 Fix thinko
Behdad Esfahbod f7677213 2022-07-29T11:57:57 [SingleSubstFormat1] Don't close glyphs in degenerate cases Fixes https://oss-fuzz.com/testcase-detail/5145429829877760
Behdad Esfahbod 59b05359 2022-07-24T17:14:09 [GSUB/GPOS] Add more buffer messages Behind HB_BUFFER_MESSAGE_MORE. https://github.com/harfbuzz/harfbuzz/pull/3495
Behdad Esfahbod bbb4db90 2022-07-21T12:34:46 [Coverage/SingleSubst] Move hand-written loop to Coverage
Behdad Esfahbod efa38807 2022-07-21T11:52:36 [subset/SingleSubsetFormat1] Use Coverage.intersect_set
Behdad Esfahbod 00dfbbce 2022-07-21T11:39:32 [Coverage] Rename and templatize intersected_coverage_glyphs
Behdad Esfahbod d0eb2737 2022-07-21T11:24:56 [subset/GSUB/GPOS] Use more intersected_coverage_glyphs()
Behdad Esfahbod 5d7556e1 2022-07-21T10:42:29 Revert "[subst/SingleSubstFormat1] Rewrite nicer" This reverts commit bababe10724c27b2cbb09bf25e7dcf4aeea07588. The hand-written code is still much faster :(.
Behdad Esfahbod 71ce931e 2022-07-21T10:41:29 [PairPos] Don't compute newFormat It was wrong, because it would be writing wrong values. Test suite doesn't seem to catch any.
Behdad Esfahbod bababe10 2022-07-21T10:25:27 [subst/SingleSubstFormat1] Rewrite nicer
Behdad Esfahbod fa471043 2022-07-20T22:42:18 [subset] Fix previous commit
Behdad Esfahbod c4d2ef90 2022-07-20T22:36:35 [subset] Speed up subsetting of SingleSubstFormat1_3
Behdad Esfahbod d01e6bab 2022-07-20T22:17:33 [subset] Speed up SingleSubstFormat1_3 closure
Behdad Esfahbod aae8c74e 2022-07-20T11:51:09 [>64k:layout:SingleSubstFormat3] Fix masking https://github.com/be-fonts/boring-expansion-spec/issues/31
Behdad Esfahbod af84680f 2022-07-17T12:00:04 [GSUB] Remove a reinterpret_cast
Behdad Esfahbod ecd8bc5a 2022-07-06T17:49:56 [>64k:layout:LigatureSubst] Implement format 2 Implements https://github.com/be-fonts/boring-expansion-spec/issues/33 Subset does NOT lower format.
Behdad Esfahbod 704e696a 2022-07-06T14:19:20 [>64k:layout] Templatize LigatureSubst
Behdad Esfahbod 27d24212 2022-07-06T14:05:21 [>64k:layout:AlternateSubst] Implement format 2 Implements rest of https://github.com/be-fonts/boring-expansion-spec/issues/32 Subset does NOT lower format.
Behdad Esfahbod c53d3ad5 2022-07-06T14:03:45 [>64k:layout] Templatize AlternateSet
Behdad Esfahbod a58a4862 2022-07-06T13:58:35 [>64k:layout:MultipleSubst] Implement format 2 Implements part of https://github.com/be-fonts/boring-expansion-spec/issues/32 Subset is NOT updated to lower format.
Behdad Esfahbod 684c8fce 2022-07-06T13:37:52 [>64k:layout] Templatize MultipleSubst
Behdad Esfahbod 8775e9b4 2022-07-06T13:28:17 [>64k:layout:SingleSubst] Implement format 3/4 Implements https://github.com/be-fonts/boring-expansion-spec/issues/31
Behdad Esfahbod e3caf8d5 2022-07-06T13:11:53 [>64k:layout] Templatize SingleSubst
Behdad Esfahbod d15041be 2022-07-11T13:39:21 [GSUB/GPOS] Trace toplevel sanitize
Behdad Esfahbod 5192294f 2022-07-08T14:00:24 .
Behdad Esfahbod 8a107125 2022-07-06T13:46:30 [layout] Make SubstLookup:serialize_single take iterators
Kleis Auke Wolthuizen 79eb0f74 2022-07-06T13:29:55 [GSUB] Fix build on GCC < 7
Garret Rieger 900476c6 2022-06-30T19:21:23 Move GSUB.hh GPOS.hh back into the GPOS/GSUB sub directories.
Garret Rieger 5fdae684 2022-06-29T23:52:08 [reorg] Move GSUB.hh up one level and change GSUB namespace to GSUB_impl.
Behdad Esfahbod 9fc9b1ec 2022-06-08T12:35:43 [layout] Minor, add using Lookup to GSUB/GPOS