mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-28 17:19:17 +01:00
Monotone characters fixups (#5752)
* [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>
This commit is contained in:
1 parent
821b375331
commit
63fb2eec90
8 files changed
+58
-34
No files matched your search
+2
-2
@@ -495,7 +495,7 @@ typedef enum {
|
||||
(1u << HB_BUFFER_CLUSTER_LEVEL_GRAPHEMES))))
|
||||
|
||||
/**
|
||||
* HB_BUFFER_CLUSTER_LEVEL_IS_CHARACTERS
|
||||
* HB_BUFFER_CLUSTER_LEVEL_IS_CHARACTERS:
|
||||
* @level: #hb_buffer_cluster_level_t to test
|
||||
*
|
||||
* Tests whether a cluster level does not group cluster values by graphemes.
|
||||
@@ -505,7 +505,7 @@ typedef enum {
|
||||
*/
|
||||
#define HB_BUFFER_CLUSTER_LEVEL_IS_CHARACTERS(level) \
|
||||
((bool) ((1u << (unsigned) (level)) & \
|
||||
((1u << HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARCATERS) | \
|
||||
((1u << HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS) | \
|
||||
(1u << HB_BUFFER_CLUSTER_LEVEL_CHARACTERS))))
|
||||
|
||||
HB_EXTERN void
|
||||
|
||||
Reference in new issue
Block a user