From d6fa33035a02130d1c3826547194aeb9c75b8668 Mon Sep 17 00:00:00 2001 From: wangfengming Date: Sun, 7 Jun 2020 14:58:59 +0800 Subject: [PATCH] :doc: update demo `53-chinese.ts` --- demo/53-chinese.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/demo/53-chinese.ts b/demo/53-chinese.ts index 1bacf888a6..eee6eb9032 100644 --- a/demo/53-chinese.ts +++ b/demo/53-chinese.ts @@ -7,7 +7,7 @@ // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, HeadingLevel, Packer, Paragraph } from "../build"; +import { Document, HeadingLevel, Packer, Paragraph, TextRun } from "../build"; const doc = new Document({ styles: { @@ -38,6 +38,15 @@ doc.addSection({ new Paragraph({ text: "中文和英文 Chinese and English", }), + new Paragraph({ + children: [ + new TextRun({ + text: "中文和英文 Chinese and English", + font: { eastAsia: "SimSun" }, // set eastAsia to "SimSun". + // The ascii characters will use the default font ("Times") specified in paragraphStyles + }), + ], + }), ], });