Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/grammar/grammar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand All @@ -1157,18 +1157,18 @@ 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;
}
const font = new FontInfo(
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)) {
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down