环境:python3.12 python-docx 1.1.2
最初使用的设置字体的代码:
from docx import Document
from docx.oxml.ns import qn
doc = Document()
style = doc.styles['Title']
style.font.name = 'Times New Roman' # 设置西文
环境:python3.12 python-docx 1.1.2
最初使用的设置字体的代码:
from docx import Document
from docx.oxml.ns import qn
doc = Document()
style = doc.styles['Title']
style.font.name = 'Times New Roman' # 设置西文