Report_Generator/Windows/baogao_project/tools/tempCodeRunnerFile.py

12 lines
739 B
Python
Raw Permalink Normal View History

2025-07-02 09:19:15 +08:00
# 复制原格式(取第一个段落的格式)
if orig_cell.paragraphs:
orig_para = orig_cell.paragraphs[0]
new_para.style = orig_para.style
new_run = new_para.add_run(line_text)
if orig_para.runs:
orig_run = orig_para.runs[0]
new_run.bold = orig_run.bold
new_run.italic = orig_run.italic
new_run.underline = orig_run.underline
new_run.font.size = Pt(10.5) # 字体大小
new_run._element.rPr.rFonts.set(qn('w:eastAsia'), '仿宋')