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
Copy file name to clipboardExpand all lines: arabic_reshaper.py
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,15 @@
9
9
10
10
# Ported and tweaked from Java to Python, from Better Arabic Reshaper [https://github.com/agawish/Better-Arabic-Reshaper/]
11
11
12
+
# Usage:
13
+
### Install python-bidi [https://github.com/MeirKriheli/python-bidi], can be installed from pip `pip install python-bidi`.
14
+
15
+
# import arabic_reshaper
16
+
# from bidi.algorithm import get_display
17
+
# reshaped_text = arabic_reshaper.reshape(u'اللغة العربية رائعة')
18
+
# bidi_text = get_display(reshaped_text)
19
+
### Now you can pass `bidi_text` to any function that handles displaying/printing of the text, like writing it to PIL Image or passing it to a PDF generating method.
0 commit comments