Domotion

Writing mode (RTL / vertical)

RTL is fully supported. Vertical writing-mode falls back to horizontal for now.

Right-to-left scripts — full support

Arabic, Hebrew, and other RTL scripts round-trip faithfully. Domotion uses bidi-js to apply paired-bracket mirroring on RTL embedding levels before the text reaches the path renderer, then run-based fontkit shaping to produce the correct contextual glyph forms.

Pure RTL paragraphs, mixed LTR / RTL on the same line ("Hello مرحبا world"), bracket and quote mirroring (( / ) swap visual direction inside RTL runs), numerical digits in RTL contexts, and RTL alignment via direction: rtl on the parent all work as authored.

The exception: vertical writing modes

writing-mode: vertical-rl, vertical-lr, and sideways-rl / sideways-lr currently render as horizontal-tb. text-orientation only matters in vertical modes and is therefore also unsupported. A warning is logged whenever a vertical writing mode is captured.

Why this is hard

Vertical writing changes per-glyph orientation rules, line-break direction, and how decorations attach. The element-raster fallback is the planned path forward — capturing the vertical region as a screenshot and embedding it as an SVG <image> — but it isn't yet wired up. See docs/02-writing-mode.md in the repo for the design notes.

Workarounds

  • If you have a small vertical region (a side label, a vertical badge), pre-render it as an inline SVG and let it pass through unchanged.
  • If you have a large vertical block (a vertical-Japanese article), Domotion is not the right tool today — capture as a static PNG instead.

See also