Fix fontWeight options with DynamicCharAtlas

The atlas wasn't using these values when setting the font.
This commit is contained in:
Benjamin Woodruff
2018-04-23 22:15:45 -07:00
parent 4fd630ec5c
commit d254d69ee2
+2 -1
View File
@@ -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}`;
}