Skip to content

Arabic text is revering lines in reportlab #90

@BouhamedMohammedMounir

Description

@BouhamedMohammedMounir

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions