Retain Unicode joining facts through shaping - #712
Open
waywardmonkeys wants to merge 1 commit into
Open
Conversation
Layout policy needs to distinguish scripts whose letters participate in cursive joining without treating every `Join_Causing` character as evidence of a cursive script. In particular, U+200D ZERO WIDTH JOINER has `Joining_Type=Join_Causing` and can occur in Latin or emoji text. Pack `Joining_Type` into `parley_data::Properties`, and generate a sorted lookup of ISO 15924 tags for scripts containing `Left_Joining`, `Right_Joining`, or `Dual_Joining` characters. Excluding `Join_Causing` and `Transparent` keeps `Zyyy` from being classified solely because it owns ZWJ and inherited marks. Expose `script_has_joining_characters` in `parley_engine` for its `parlance::Script` vocabulary, and retain the resolved `script` in each `ShapedRun`. `Item` and `ShapedRun` derive their convenience accessor from that script instead of caching duplicate state, so public record construction remains straightforward and there is no script/classification invariant to maintain. The lookup deliberately reports a Unicode fact. It does not inspect a particular string or decide letter-spacing policy.
Contributor
Author
|
This was done with assistance by GPT 5.6, Sol, xhigh. I've been through it though and made alterations. |
Contributor
Author
|
This is needed for Underwood. I also have a patch that uses this within |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Layout policy needs to distinguish scripts whose letters participate in cursive joining without treating every
Join_Causingcharacter as evidence of a cursive script. In particular, U+200D ZERO WIDTH JOINER hasJoining_Type=Join_Causingand can occur in Latin or emoji text.Pack
Joining_Typeintoparley_data::Properties, and generate a sorted lookup of ISO 15924 tags for scripts containingLeft_Joining,Right_Joining, orDual_Joiningcharacters. ExcludingJoin_CausingandTransparentkeepsZyyyfrom being classified solely because it owns ZWJ and inherited marks.Expose
script_has_joining_charactersinparley_enginefor itsparlance::Scriptvocabulary, and retain the resolvedscriptin eachShapedRun.ItemandShapedRunderive their convenience accessor from that script instead of caching duplicate state, so public record construction remains straightforward and there is no script/classification invariant to maintain.The lookup deliberately reports a Unicode fact. It does not inspect a particular string or decide letter-spacing policy.