Experimental font option for RichText objects
This commit is contained in:
parent
a3c15b226e
commit
197807d272
@ -391,7 +391,8 @@ class RichText(object):
|
|||||||
bold=False,
|
bold=False,
|
||||||
italic=False,
|
italic=False,
|
||||||
underline=False,
|
underline=False,
|
||||||
strike=False):
|
strike=False
|
||||||
|
font=None):
|
||||||
|
|
||||||
|
|
||||||
if not isinstance(text, six.text_type):
|
if not isinstance(text, six.text_type):
|
||||||
@ -423,6 +424,8 @@ class RichText(object):
|
|||||||
prop += u'<w:u w:val="%s"/>' % underline
|
prop += u'<w:u w:val="%s"/>' % underline
|
||||||
if strike:
|
if strike:
|
||||||
prop += u'<w:strike/>'
|
prop += u'<w:strike/>'
|
||||||
|
if font:
|
||||||
|
prop += u'<w:rFonts w:ascii="Courier New" w:hAnsi="{}" w:cs="{}"/>'.format(font, font)
|
||||||
|
|
||||||
self.xml += u'<w:r>'
|
self.xml += u'<w:r>'
|
||||||
if prop:
|
if prop:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user