Skip to content

Commit

Permalink
fix: setting null for a font style on a theme (google#5831)
Browse files Browse the repository at this point in the history
  • Loading branch information
alschmiedt authored Jan 4, 2022
1 parent b5abb3e commit 835fb02
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions core/renderers/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 835fb02

Please sign in to comment.