Files
Mohammad EssamandClaude Opus 5.5 a538d3a75e feat(python): draw Arabic text in vis() with khatt from the rtl extra (#763)
* feat(python): draw Arabic text in vis() with khatt from the rtl extra

Recognized Arabic, Persian and Urdu text is returned in reading order,
but vis() draws it with ImageDraw.text, which only joins Arabic letters
and lays out right-to-left text when Pillow is built with Raqm. Without
it the visualization shows separate letters in reverse order, running
out of the box.

When khatt is installed (now part of the rtl extra on Python 3.10+),
right-to-left lines are shaped, start at the right edge of their box,
are centered vertically and shrink to fit the box. Other text, and RTL
text without khatt, is drawn by Pillow as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* style(python): ruff format the vis RTL changes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(python): let RTL text shrink below 10px to fit small boxes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 22:01:00 +08:00
..
2026-02-01 14:36:32 +08:00