Skip to content

RTL shaping: Pillow direction/language, Kurdish and Arabic examples#811

Open
0xdolan wants to merge 10 commits intoamueller:mainfrom
0xdolan:feat/rtl-wordcloud-examples
Open

RTL shaping: Pillow direction/language, Kurdish and Arabic examples#811
0xdolan wants to merge 10 commits intoamueller:mainfrom
0xdolan:feat/rtl-wordcloud-examples

Conversation

@0xdolan
Copy link
Copy Markdown

@0xdolan 0xdolan commented Apr 19, 2026

Summary

Adds text_direction (ltr / rtl / ttb / auto), text_language, and text_features on WordCloud, forwarding them to Pillow ImageDraw.text / textbbox for correct RTL shaping when Pillow is built with libraqm. Auto direction uses Unicode bidirectional classes per word.

Includes Kurdish Sorani (ckb) and Arabic examples with bundled OFL fonts (Estedad, Noto Naskh Arabic), README updates, and tests.

Testing

pytest test/test_ckb_ku_words_rtl.py (render test skips without libraqm or fonts).


Opened from fork branch 0xdolan/word_cloud:feat/rtl-wordcloud-examples.

Made with Cursor

0xdolan added 10 commits April 19, 2026 14:49
Add text_direction (ltr|rtl|ttb|auto), text_language, and text_features.
When direction is auto, derive from Unicode bidirectional class of the word.
Pass kwargs through ImageDraw.text and textbbox for consistent layout.

Made-with: Cursor
Exercise Arabic-script Sorani text with bundled fonts when libraqm is available.

Made-with: Cursor
Align matplotlib and numpy constraints with legacy requirements (numpy 1.19.3 on Python 3.9).
Include cython as a runtime dependency for source installs.

Made-with: Cursor
…options

Read examples/arabicwords.txt, write examples/arabic_example.png, require a
bundled or path-resolved Arabic font.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant