You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Arabic text: per-letter splits render isolated letters and word rows render reversed, with no lint warning #5885
Two common text recipes silently break Arabic (also Persian and Urdu; the second also affects Hebrew). Reproduced with hyperframes@0.8.169, both snapshot and render (chrome-headless-shell):
Per-letter stagger (text.split("") into inline-block spans; SplitText chars does the same). Each letter is shaped alone, so "مرحبا بالعالم" renders as disconnected letters.
Per-word stagger with no dir. Inline-block words are bidi-neutral, so the line defaults to LTR and the words come out in reverse order ("بالعالم مرحبا"). Flex phrase rows (asr-keyword-glow, caption rows) behave the same way.
hyperframes lint reports neither: 0 errors on the repro (re-checked on 0.8.173), only an unrelated structure warning. None of the 18 bundled fonts covers Arabic either, so it falls back to whatever the machine has.
Minimal repro (index.html; put NotoSansArabic.ttf from Google Fonts next to it):
npx hyperframes render . -o out.mp4, last frame (row A reference, row B isolated letters, row C reversed words):
Proposed solution
Lint warnings:
Arabic-script text split per character into separate elements;
inline-block or flex word rows holding RTL text with no dir or direction on the container;
Arabic text whose font-family has no Arabic coverage.
Skill guidance for agents. I have a draft rule, hyperframes-animation/rules/arabic-rtl-text.md, plus a one-line note in typography.md. It covers direction, word-level splits, a joiner-aware letter split, and fonts. I'll open it as a PR that references this issue.
Alternatives considered
Word-level animation only: fixes the joins, but the direction is still needed.
With the fixes (dir="rtl" on the container, plus a ZWJ joiner-aware split), the same kind of scene renders identically to plain text in 0.8.169, including lam-alef, harakat and Arabic-Indic digits:
In Safari (Studio preview or published page), ZWJ-padded letters fall back to another font when the font has no U+200D glyph (Alexandria as served by Google Fonts, IBM Plex Sans Arabic, Cairo, Tajawal). MP4 renders are not affected.
Activity
docs(skills): add Arabic and right-to-left text rule