Bidirectional Text
النص ثنائي الاتجاه
I'm figuring out how Arabic and Latin share a line.
I keep running into lines where Arabic and English sit next to each other — URLs, brand names, code snippets. The text doesn't just flow one way anymore. Punctuation jumps sides, parentheses flip, and it took me a while to realize there's an actual algorithm (the Unicode Bidi Algorithm) deciding all of it.
Common Pitfalls
Bidi can produce unexpected results: punctuation may jump to the wrong side, parentheses can appear reversed, and numbers inside Arabic sentences can shift position depending on the algorithm's interpretation. Designers and developers working with bidi text need to understand concepts like base direction, directional overrides, and embedding levels. Testing with real mixed-direction content, not just placeholder text, is essential to catch layout issues before they reach users.