diff --git a/core/renderers/common/constants.js b/core/renderers/common/constants.js index 81401c6c6..295ccf368 100644 --- a/core/renderers/common/constants.js +++ b/core/renderers/common/constants.js @@ -622,18 +622,17 @@ ConstantProvider.prototype.setDynamicProperties_ = function(theme) { * @protected */ ConstantProvider.prototype.setFontConstants_ = function(theme) { - this.FIELD_TEXT_FONTFAMILY = - theme.fontStyle && theme.fontStyle['family'] !== undefined ? - theme.fontStyle['family'] : - this.FIELD_TEXT_FONTFAMILY; - this.FIELD_TEXT_FONTWEIGHT = - theme.fontStyle && theme.fontStyle['weight'] !== undefined ? - theme.fontStyle['weight'] : - this.FIELD_TEXT_FONTWEIGHT; - this.FIELD_TEXT_FONTSIZE = - theme.fontStyle && theme.fontStyle['size'] !== undefined ? - theme.fontStyle['size'] : - this.FIELD_TEXT_FONTSIZE; + if (theme.fontStyle && theme.fontStyle['family']) { + this.FIELD_TEXT_FONTFAMILY = theme.fontStyle['family']; + } + + if (theme.fontStyle && theme.fontStyle['weight']) { + this.FIELD_TEXT_FONTWEIGHT = theme.fontStyle['weight']; + } + + if (theme.fontStyle && theme.fontStyle['size']) { + this.FIELD_TEXT_FONTSIZE = theme.fontStyle['size']; + } const fontMetrics = dom.measureFontMetrics( 'Hg', this.FIELD_TEXT_FONTSIZE + 'pt', this.FIELD_TEXT_FONTWEIGHT,