From 7434526b18785dba6cca76102f8613bda4496416 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Tue, 6 Jan 2026 10:54:58 +0100 Subject: [PATCH] changing font size and line height to multiplier values --- src/grammar/grammar.ts | 18 +++++++++--------- src/main.ts | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/grammar/grammar.ts b/src/grammar/grammar.ts index e152a73..da0a9f7 100644 --- a/src/grammar/grammar.ts +++ b/src/grammar/grammar.ts @@ -1124,14 +1124,14 @@ export class FontInfo implements IFontInfo { public startIndex: number, public endIndex: number, public fontFamily: string | null, - public fontSize: number | null, - public lineHeight: number | null + public fontSizeMultiplier: number | null, + public lineHeightMultiplier: number | null ) { } optionsEqual(other: IFontInfo): boolean { return this.fontFamily === other.fontFamily - && this.fontSize === other.fontSize - && this.lineHeight === other.lineHeight; + && this.fontSizeMultiplier === other.fontSizeMultiplier + && this.lineHeightMultiplier === other.lineHeightMultiplier; } } @@ -1157,9 +1157,9 @@ export class LineFonts { return; } const fontFamily = styleAttributes.fontFamily; - const fontSize = styleAttributes.fontSize; - const lineHeight = styleAttributes.lineHeight; - if (!fontFamily && !fontSize && !lineHeight) { + const fontSizeMultiplier = styleAttributes.fontSize; + const lineHeightMultiplier = styleAttributes.lineHeight; + if (!fontFamily && !fontSizeMultiplier && !lineHeightMultiplier) { this._lastIndex = endIndex; return; } @@ -1167,8 +1167,8 @@ export class LineFonts { this._lastIndex, endIndex, fontFamily, - fontSize, - lineHeight + fontSizeMultiplier, + lineHeightMultiplier ); const lastFont = this._fonts[this._fonts.length - 1] if (lastFont && lastFont.endIndex === this._lastIndex && lastFont.optionsEqual(font)) { diff --git a/src/main.ts b/src/main.ts index 6d27764..c8f2c3a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -273,12 +273,12 @@ export interface IFontInfo { /** * Font size specification */ - readonly fontSize: number | null; + readonly fontSizeMultiplier: number | null; /** * Line height specification */ - readonly lineHeight: number | null; + readonly lineHeightMultiplier: number | null; } export interface IToken {