From 29be3ac8baadeb10ee827147b67a798348be6b9b Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 19 Nov 2016 18:13:04 +0000 Subject: Set font on runs --- lib/documents.js | 3 ++- lib/docx/body-reader.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/documents.js b/lib/documents.js index 428dc09..fc45627 100644 --- a/lib/documents.js +++ b/lib/documents.js @@ -52,7 +52,8 @@ function Run(children, properties) { isUnderline: properties.isUnderline, isItalic: properties.isItalic, isStrikethrough: properties.isStrikethrough, - verticalAlignment: properties.verticalAlignment || verticalAlignment.baseline + verticalAlignment: properties.verticalAlignment || verticalAlignment.baseline, + font: properties.font || null }; } diff --git a/lib/docx/body-reader.js b/lib/docx/body-reader.js index 30f8bc9..6bc1934 100644 --- a/lib/docx/body-reader.js +++ b/lib/docx/body-reader.js @@ -42,7 +42,7 @@ function BodyReader(options) { if (verticalAlignmentElement) { properties.verticalAlignment = verticalAlignmentElement.attributes["w:val"]; } - + properties.font = element.firstOrEmpty("w:rFonts").attributes["w:ascii"]; properties.isBold = readBooleanElement(element.first("w:b")); properties.isUnderline = readBooleanElement(element.first("w:u")); properties.isItalic = readBooleanElement(element.first("w:i")); -- cgit v1.2.3