From d254d69ee2e6d1823279988d06e9882f68986f42 Mon Sep 17 00:00:00 2001 From: Benjamin Woodruff Date: Mon, 23 Apr 2018 22:15:45 -0700 Subject: [PATCH] Fix fontWeight options with DynamicCharAtlas The atlas wasn't using these values when setting the font. --- src/renderer/atlas/DynamicCharAtlas.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/atlas/DynamicCharAtlas.ts b/src/renderer/atlas/DynamicCharAtlas.ts index 302623dc..73e36e13 100644 --- a/src/renderer/atlas/DynamicCharAtlas.ts +++ b/src/renderer/atlas/DynamicCharAtlas.ts @@ -205,8 +205,9 @@ export default class DynamicCharAtlas extends BaseCharAtlas { this._tmpCtx.globalCompositeOperation = 'source-over'; // draw the foreground/glyph + const fontWeight = glyph.bold ? this._config.fontWeightBold : this._config.fontWeight; this._tmpCtx.font = - `${this._config.fontSize * this._config.devicePixelRatio}px ${this._config.fontFamily}`; + `${fontWeight} ${this._config.fontSize * this._config.devicePixelRatio}px ${this._config.fontFamily}`; if (glyph.bold) { this._tmpCtx.font = `bold ${this._tmpCtx.font}`; }