Skip to content

Arabic text is revering lines in reportlab #90

Open

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

Activity

  1. BouhamedMohammedMounir commented on Jul 12, 2023

    @BouhamedMohammedMounir
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions