Make the Kirat Rai ligature states ligature-transparent - #95
Open
youdie006 wants to merge 1 commit into
Open
Conversation
KIRAT_RAI_VOWEL_SIGN_E and _AI were the only two script ligature states without the ligature-transparent and ZWJ bits, so inserting a ZWJ or a default-ignorable mark into a Kirat Rai ligature widened it from 1 to 2 while every other script ligature was unaffected.
Contributor
|
Thanks for the report! I am inclined to say we should resolve this by changing the documentation. The Kirat Rai rules are intended only to ensure canonically equivalent strings have the same width, nothing beyond that. Unfortunately there is no Unicode spec for this, and no Kirat Rai monospace fonts. (As an aside, the excessively verbose Claude output is quite grating to read in PR descriptions, and wastes everyone's time. Please try to cut it down in the future) |
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.
The crate measures the same Kirat Rai ligature two ways:
KIRAT_RAI_VOWEL_SIGN_Eand_AI(src/gen/width_info.rs:39-40) are the only two of eight script-ligature states carrying none of the ligature-transparency bits, sois_ligature_transparentis false andsrc/lookup.rs:149-155never skips the ZWJ.scripts/unicode.py:214-215states the rule they break: "5th from top: whether this is unaffected by ligature-transparent (if set, should also set 3rd and 4th)". #53 established the convention for the first six states; #74 added Kirat Rai without it.The new constants use the same
0b0011_1100_prefix asLISU_TONE_LETTER_MYA_NA_JEUandKHMER_COENG_ELIGIBLE_LETTER. The edit is inscripts/unicode.py;src/gen/width_info.rsis regenerated output.Scope and verification
Differential over every Unicode scalar value as the inserted character, six
<base><mid><closer>sequences, pristine vs fixed, bothwidthandwidth_cjk:16D63..16D672 -> 116D63..16D682 -> 1master"\u{200d}" has the wrong width, left 2 right 1_EonlyCI rows run locally:
cargo test,--no-default-features,cargo fmt --check, clippy both feature sets under-D warnings,cargo docunder-D warnings,cargo +1.66.0 check --lib --features core,std— all exit 0. The regen gate (rm tests/emoji-test.txt && cd scripts && python3 unicode.py, thengit update-index --refresh && git diff-index --quiet HEAD --) exits 0 on the committed tree, and all fivesrc/gen/*.rsmd5s are unchanged by that regeneration.One thing I did not check: the Unicode core spec text on whether Kirat Rai vowel-sign ligatures must be ligature-transparent. I verified only that this crate is inconsistent with itself, with its generator's stated bit contract, and with its own docs. If the intended answer is the other direction,
src/lib.rs:80is what needs changing and I will send that instead.Disclosure: I used Claude (an AI assistant) while preparing this change. Every result above I ran and verified myself.