Python-docx cant use font.rtl and size,name together

Viewed 34

I have a python code that creates a word file and writing to it. But I have a problem that when I'm using font.rtl the font.name and font.size not working. I know that is becuase of the language and the xml file that gets created, and I saw people importing codes from github that make it work but I have know idea how to do that. Someone can help me make it work and show me how to do it.

this is my code:

def setTextInfo(content_paragraph):
    font = content_paragraph.style.font
    font.name = 'David'
    font.bold = False
    font.rtl = True
    font.size = Pt(12)
    font.underline = False
    content_paragraph.alignment = WD_PARAGRAPH_ALIGNMENT.RIGHT

and this is the code that the name and size working

def setTextInfo(content_paragraph):
    font = content_paragraph.style.font
    font.name = 'David'
    font.bold = False
    # font.rtl = True
    font.size = Pt(12)
    font.underline = False
    content_paragraph.alignment = WD_PARAGRAPH_ALIGNMENT.RIGHT

the rtl disable the font name and size

0 Answers
Related