Skip to content

RTL attribute disables font name! #430

@pooryakhajouie

Description

@pooryakhajouie

I create a style to use it for my paragraphs. when I change the RTL attribute to TRUE, the text is not written with the font I've specified and when it sets FALSE, the code works properly and font name is correct. the text is a mix of Persian and English.
my style is like this:

word_document = docx.Document()

style_rtl = word_document.styles.add_style('NormalRTL', WD_STYLE_TYPE.PARAGRAPH)
style_rtl.font.name = 'Noto Naskh Arabic'
style_rtl.font.rtl = True

paragraph = word_document.add_paragraph('.سلام new آخر')
paragraph.style = style_rtl

I try several ways to solve this but still no answer. anyone knows what's the problem?

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