Skip to content

feat: add ArabicShaping table (Joining_Type) — fixes #101 - #102

Merged
mathiasbynens merged 5 commits into
node-unicode:mainfrom
FekyBaz:feat/arabic-shaping-101
Sep 9, 2026
Merged

mathiasbynens merged 5 commits into
node-unicode:mainfrom
FekyBaz:feat/arabic-shaping-101

Conversation

@FekyBaz

@FekyBaz FekyBaz commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #101.Adds ArabicShaping.txt (Joining_Type) support so consumers implementing Arabic text shaping alongside a bidi algorithm (e.g. bidi-js, maplibre-gl-js#8343) can depend on this package instead of rolling their own UCD downloader.Changes:- scripts/parse-arabic-shaping.mjs (new): parses code; name; Joining_Type; Joining_Group lines into per-value regenerate sets (explicit entries only, mirroring parse-bidi-class; unlisted code points stay implicit per the file's T/U default rule, same as other parsers here).- scripts/download.mjs: arabic-shaping in TYPES.- data/resources.mjs: arabic-shaping URLs for Unicode 3.2.0 through 18.0.0 (legacy -Update layout for 3.2.0/4.0.0/4.0.1, ucd/ afterwards — every URL HEAD-verified 200).- index.mjs: wires Joining_Type generation (after Vertical_Orientation).- tests/tests.mjs: snapshot test for Joining_Type/Dual_Joining on the newest version (auto-created on first run, like other snapshots).Verification (offline, no clone needed): parser run against the real ArabicShaping-17.0.0.txt yields exactly the file's distribution (D615/R153/U50/C7/L5/T4, 834 entries, no ranges); spot checks U+0628=D, U+0627=R, U+0621=U, U+0600=U, U+0640=C, U+200D=C; unlisted U+061C correctly absent; missing-file versions return undefined so pre-3.2.0 outputs are unchanged. Generated Joining_Type/D artifacts verified end-to-end (ranges decode, 615 code points incl. U+0628). node --check clean on all touched files.Notes: Joining_Group is parsed but intentionally not emitted (single-map convention per writeFiles call); unlisted-codepoint defaults (T for marks, U otherwise) are left implicit per spec rather than materialized, matching how this repo treats bidi-class defaults.

@mathiasbynens
mathiasbynens merged commit 144669f into node-unicode:main Sep 9, 2026
1 check failed
@mathiasbynens

Copy link
Copy Markdown
Collaborator

Some follow-up fixes were needed: ca10450

@FekyBaz

FekyBaz commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for merging + for the canonical-name fix in ca10450 — noted for next time (I see parse-bidi-class already did it that way; should have mirrored it). The committed data files for all versions look right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ArabicShaping table

2 participants