Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arabic text is revering lines in reportlab #90

Open
BouhamedMohammedMounir opened this issue Jul 12, 2023 · 1 comment
Open

Arabic text is revering lines in reportlab #90

BouhamedMohammedMounir opened this issue Jul 12, 2023 · 1 comment

Comments

@BouhamedMohammedMounir
Copy link

BouhamedMohammedMounir commented Jul 12, 2023

In reportLab, I need to display an arabic paragraph. I am using arabic-resharper and bidi-algorithm. The probelm appears that the Algothim revesing lines.

The code is:

def format_arabic_paragraph(arabic_text: str, paragraph_style: ParagraphStyle):
        reshaped_text = arabic_reshaper.reshape(arabic_text)
        bidirectional_text = algorithm.get_display(reshaped_text)
        formatted_paragraph = Paragraph(bidirectional_text, paragraph_style)
        return formatted_paragraph

arabic_text='وحدة1 وحدة2'

ActualOutput

وحدة2
وحدة1

Expected output

وحدة1
وحدة2

@BouhamedMohammedMounir
Copy link
Author

I have tried another library called pyfribidi. It seems that the problem with ReportLab staring Arabic paragraph from buttom.

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

No branches or pull requests

1 participant