Update richtext_eastAsia.py
This commit is contained in:
parent
b75867397a
commit
a9122c34d4
@ -1,5 +1,10 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
'''
|
||||||
|
Created : 2022-08-03
|
||||||
|
@author: Dongfang Song
|
||||||
|
'''
|
||||||
from docxtpl import DocxTemplate, RichText
|
from docxtpl import DocxTemplate, RichText
|
||||||
tpl=DocxTemplate('test_files/richtext_eastAsia_tpl.docx')
|
tpl=DocxTemplate('templates/richtext_eastAsia_tpl.docx')
|
||||||
rt = RichText('测试TEST', font = 'Microsoft YaHei')
|
rt = RichText('测试TEST', font = 'Microsoft YaHei')
|
||||||
ch = RichText('测试TEST', font = '微软雅黑')
|
ch = RichText('测试TEST', font = '微软雅黑')
|
||||||
sun = RichText('测试TEST', font = 'SimSun')
|
sun = RichText('测试TEST', font = 'SimSun')
|
||||||
@ -10,4 +15,4 @@ context = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tpl.render(context)
|
tpl.render(context)
|
||||||
tpl.save('test_files/richtext_eastAsia.docx')
|
tpl.save('output/richtext_eastAsia.docx')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user