Correct the ArabicPUATraditional.txt entry for 0xF295 which should be
isolated not final form. Also enable 0xFC43 ligature so the ligature is
actually used.
Fixes https://github.com/harfbuzz/harfbuzz/issues/5984
* [buffer] Fix a typo and doc string
* [buffer] Add merge_grapheme_clusters / merge_out_grapheme_clusters
Cluster merges serve two distinct purposes that require different level
gates:
- Grapheme grouping: combining marks merged into their base cluster.
Correct gate: IS_GRAPHEMES (levels 0 and 3).
New functions: merge_grapheme_clusters / merge_out_grapheme_clusters.
- Monotonicity maintenance: clusters merged to prevent non-monotone
output after ligature formation, reordering, etc.
Correct gate: IS_MONOTONE (levels 0 and 1).
Existing functions: merge_clusters / merge_out_clusters.
Previously both paths shared merge_clusters_impl's single IS_MONOTONE
gate, so GRAPHEMES (level 3) was incorrectly blocked from merging
grapheme clusters. This also caused a regression in the Thai and
Hangul shapers for MONOTONE_CHARACTERS (level 1): when their explicit
== MONOTONE_GRAPHEMES call-site guards were removed in #5069, the
impls' IS_MONOTONE gate no longer protected them.
Gates are now in the inline wrappers in hb-buffer.hh; the _impl
functions are gate-free. hb_form_clusters, CoreText grapheme
detection, and the Thai/Hangul shapers are updated to call the
grapheme-semantic variants. Fixes#5750.
Fixes https://github.com/harfbuzz/harfbuzz/issues/5751
Fixes https://github.com/harfbuzz/harfbuzz/issues/5750
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [thai] Adjust grapheme merging logic
* [hangul] Tweak grapheme merging
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* [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
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.
The range_features was ending up with random data because
hb_ms_make_feature_ranges() keeps pointers to data allocated in
feature_records and range_records, but that data was getting freed
before range_features was used. Change the variable scope to avoid
freeing the data too early.
Fixes https://github.com/harfbuzz/harfbuzz/issues/5113