From 999e30723df8825fc4bb982d79a01c28348a3cdf Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 9 Jun 2017 18:26:57 +0200 Subject: [PATCH] Reduce the duplication slightly when detecting an OpenType font (in the `Font` constructor) --- src/core/fonts.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/fonts.js b/src/core/fonts.js index d44868274..54a53d99e 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -628,26 +628,26 @@ var Font = (function FontClosure() { } } else if (isOpenTypeFile(file)) { // Sometimes the type/subtype can be a complete lie (see issue7598.pdf). - type = subtype = 'OpenType'; + subtype = 'OpenType'; } } if (subtype === 'CIDFontType0C' && type !== 'CIDFontType0') { type = 'CIDFontType0'; } - if (subtype === 'OpenType') { - type = 'OpenType'; - } // Some CIDFontType0C fonts by mistake claim CIDFontType0. if (type === 'CIDFontType0') { if (isType1File(file)) { subtype = 'CIDFontType0'; } else if (isOpenTypeFile(file)) { // Sometimes the type/subtype can be a complete lie (see issue6782.pdf). - type = subtype = 'OpenType'; + subtype = 'OpenType'; } else { subtype = 'CIDFontType0C'; } } + if (subtype === 'OpenType' && type !== 'OpenType') { + type = 'OpenType'; + } var data; switch (type) {