apply weight settings in width cache

This commit is contained in:
Jörg Breitbart
2023-07-31 16:49:58 +02:00
parent e75ec5b51f
commit c796514de8
2 changed files with 45 additions and 14 deletions
+12 -2
View File
@@ -98,7 +98,12 @@ export class DomRenderer extends Disposable implements IRenderer {
}));
this._widthCache = new WidthCache(document);
this._widthCache.setFont(this._optionsService.rawOptions.fontFamily, this._optionsService.rawOptions.fontSize);
this._widthCache.setFont(
this._optionsService.rawOptions.fontFamily,
this._optionsService.rawOptions.fontSize,
this._optionsService.rawOptions.fontWeight,
this._optionsService.rawOptions.fontWeightBold
);
this._setDefaultSpacing();
}
@@ -373,7 +378,12 @@ export class DomRenderer extends Disposable implements IRenderer {
// Refresh CSS
this._injectCss(this._themeService.colors);
// update spacing cache
this._widthCache.setFont(this._optionsService.rawOptions.fontFamily, this._optionsService.rawOptions.fontSize);
this._widthCache.setFont(
this._optionsService.rawOptions.fontFamily,
this._optionsService.rawOptions.fontSize,
this._optionsService.rawOptions.fontWeight,
this._optionsService.rawOptions.fontWeightBold
);
this._setDefaultSpacing();
}