From 59f54b946d4fb54ce7cbad89f9b7e8fb7d61b473 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 1 Apr 2020 13:40:35 +0200 Subject: [PATCH] Ensure that all `Font` instances have the `vertical` property set to a boolean Given that the `vertical` property is always accessed on the main-thread, ensuring that the property is explicitly defined seems like the correct thing to do since it also avoids boolean casting elsewhere in the code-base. --- src/core/evaluator.js | 2 +- src/core/fonts.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/evaluator.js b/src/core/evaluator.js index b06e8b0a1..ec05ce27c 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -1761,7 +1761,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { fontFamily: font.fallbackName, ascent: font.ascent, descent: font.descent, - vertical: !!font.vertical, + vertical: font.vertical, }; } textContentItem.fontName = font.loadedName; diff --git a/src/core/fonts.js b/src/core/fonts.js index 00a721aa9..81136c650 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -607,7 +607,7 @@ var Font = (function FontClosure() { } this.cidEncoding = properties.cidEncoding; - this.vertical = properties.vertical; + this.vertical = !!properties.vertical; if (this.vertical) { this.vmetrics = properties.vmetrics; this.defaultVMetrics = properties.defaultVMetrics;