add eastAsia test
add eastAsia test
This commit is contained in:
parent
0660a0f37e
commit
badce481c6
13
tests/richtext_eastAsia.py
Normal file
13
tests/richtext_eastAsia.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
from docxtpl import DocxTemplate, RichText
|
||||||
|
tpl=DocxTemplate('test_files/richtext_eastAsia_tpl.docx')
|
||||||
|
rt = RichText('测试TEST', font = 'Microsoft YaHei')
|
||||||
|
ch = RichText('测试TEST', font = '微软雅黑')
|
||||||
|
sun = RichText('测试TEST', font = 'SimSun')
|
||||||
|
context = {
|
||||||
|
'example' : rt,
|
||||||
|
'Chinese' : ch,
|
||||||
|
'simsun' : sun,
|
||||||
|
}
|
||||||
|
|
||||||
|
tpl.render(context)
|
||||||
|
tpl.save('test_files/richtext_eastAsia.docx')
|
||||||
Loading…
x
Reference in New Issue
Block a user