feat(arabic): add tashkeel support and shadda+vowel ligatures#343
Merged
oneplus1000 merged 2 commits intosignintech:masterfrom Feb 8, 2026
Merged
feat(arabic): add tashkeel support and shadda+vowel ligatures#343oneplus1000 merged 2 commits intosignintech:masterfrom
oneplus1000 merged 2 commits intosignintech:masterfrom
Conversation
- Add tashkeel (diacritical marks) constants: FATHA, DAMMA, KASRA, SUKUN, SHADDA, TANWEEN_*, and Quranic marks - Add Shadda+Vowel ligature constants (Arabic Presentation Forms-B) - Add GetShaddaLigature() function for vowel-to-ligature lookup - Add IsTashkeel() function to detect Arabic diacritical marks - Add Allah ligature (U+FDF2) automatic conversion - Implement reverseWithTashkeel() to keep tashkeel attached during RTL reversal - Update ToArabic() to handle tashkeel-aware character shaping - Add comprehensive tests for tashkeel handling and ligatures - Update Arabic example with Surah Al-Fatiha and Adobe-Arabic font
Contributor
Author
|
@oneplus1000 please review |
Collaborator
|
Okay, I'll do it during the weekend. :-) |
Collaborator
|
Everything looks good overall. My only concern is that the Adobe TTF font should be replaced with an open-source font to avoid licensing issues. |
Contributor
Author
|
done, I replaced it with Amiri-regular. |
Collaborator
|
thank you |
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.
Summary
This PR enhances Arabic text support with proper handling of tashkeel (diacritical marks) and automatic ligature generation for better PDF rendering.
New Features
Tashkeel Constants: FATHA, DAMMA, KASRA, SUKUN, SHADDA, TANWEEN_*, and Quranic marks (SUPERSCRIPT_ALEF, MADDAH_ABOVE, etc.)
Shadda+Vowel Ligatures: Automatic combination using Arabic Presentation Forms-B (U+FC5E-U+FC63)
Allah Ligature: Automatic conversion of the word "الله" (Alef + Lam + Lam + Heh) to the special Allah ligature character U+FDF2 (ﷲ). This ensures the word is rendered correctly as a single beautiful ligature in PDF output, which is the proper typographic representation used in Arabic typography.
IsTashkeel(r rune) bool: Public function to detect Arabic diacritical marksGetShaddaLigature(vowel rune) rune: Get combined shadda+vowel formImprovements
Test plan
IsTashkeel(),GetShaddaLigature(), and tashkeel handling