implement default letter spacing

This commit is contained in:
Jörg Breitbart
2023-07-30 18:46:33 +02:00
parent b358754b46
commit e9058b7498
2 changed files with 22 additions and 6 deletions
@@ -38,6 +38,8 @@ export class DomRendererRowFactory {
private _selectionEnd: [number, number] | undefined;
private _columnSelectMode: boolean = false;
public defaultSpacing = 0;
constructor(
private readonly _document: Document,
@ICharacterJoinerService private readonly _characterJoinerService: ICharacterJoinerService,
@@ -390,12 +392,7 @@ export class DomRendererRowFactory {
charElement.textContent = text;
}
// apply letter-spacing rule
if (spacing) {
/**
* TODO:
* - check if we can ignore tiny spacings here (saves ~400ms)
* - check if we can apply a global spacing to rows element
*/
if (spacing !== this.defaultSpacing) {
charElement.style.letterSpacing = `${spacing}px`;
}