File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ def add(
3838 strike = False ,
3939 font = None ,
4040 url_id = None ,
41+ rtl = False ,
42+ lang = None ,
4143 ):
4244
4345 # If a RichText is added
@@ -73,8 +75,12 @@ def add(
7375 prop += '<w:vertAlign w:val="superscript"/>'
7476 if bold :
7577 prop += "<w:b/>"
78+ if rtl :
79+ prop += '<w:bCs/>'
7680 if italic :
7781 prop += "<w:i/>"
82+ if rtl :
83+ prop += '<w:iCs/>'
7884 if underline :
7985 if underline not in [
8086 "single" ,
@@ -98,7 +104,10 @@ def add(
98104 prop += '<w:rFonts w:ascii="{font}" w:hAnsi="{font}" w:cs="{font}"{regional_font}/>' .format (
99105 font = font , regional_font = regional_font
100106 )
101-
107+ if rtl :
108+ prop += '<w:rtl w:val="true"/>'
109+ if lang :
110+ prop += '<w:lang w:val="%s"/>' % lang
102111 xml = "<w:r>"
103112 if prop :
104113 xml += "<w:rPr>%s</w:rPr>" % prop
You can’t perform that action at this time.
0 commit comments