Repository navigation
Arabic and right-to-left text across the engine and every kit, by @mahmoud-ibrahim-dev in #53. Sync with python3 .claude/skills/papermorph/scripts/engine.py site.
#36 gave books an Arabic interface; everything drawn on the stage, and each kit's word-by-word helpers, still read left to right, so an Arabic book showed its words, numbers and equations in the wrong order. Arabic, Hebrew, Persian and Urdu books now read correctly in lessons, picture books, documentaries, shorts, scroll stories and maps. English books are set exactly as before: check_i18n.py compares an English lesson with the previous engine.
- Each stage text takes its reading order from its own first letter; in a right-to-left book a line that a Latin word opens reads as Arabic when most of its words are. U+200F or U+200E as the first character forces a direction. New global
isRTL(str)for kit helpers. - An expression inside a right-to-left line keeps its left-to-right order (
لو 5 + x = 7no longer shows asx = 7 + 5) on the stage, in cards, options, captions and titles. Year ranges, dates and sums in Arabic-Indic digits are left to read with their sentence. - The documentary's
say(),stream(), and the shorts, picture-book, map and scroll kits set Arabic upright, without letter spacing, in Arabic faces;stream()types whole graphemes, so vowel marks and emoji are never split. rat()reads Arabic-Indic digits,٫,٬and the Arabic comma, so an answer typed on an Arabic keyboard is graded as the same number.tts.pynames number shapes that Edge's Arabic voices skip or split and suggests a spelling;new_book.pygives right-to-left books their direction and voice; new translationstheEndandaiIllustrationin all five interface languages.- A long Arabic word before an expression is scanned once (bbf2d8d): a 30,000-letter line took about 5 s, now 2 ms.
The kits now call isRTL and the new translations, so a book using the v2.13 kits needs this engine.