diff --git a/MLEM/Font/GenericFont.cs b/MLEM/Font/GenericFont.cs index e0f634f..97e23aa 100644 --- a/MLEM/Font/GenericFont.cs +++ b/MLEM/Font/GenericFont.cs @@ -142,10 +142,10 @@ namespace MLEM.Font { switch (text[i]) { case '\n': xOffset = 0; - size.Y += font.LineHeight; + size.Y += this.LineHeight; break; case OneEmSpace: - xOffset += font.LineHeight; + xOffset += this.LineHeight; break; case Nbsp: xOffset += font.MeasureChar(' '); @@ -170,7 +170,7 @@ namespace MLEM.Font { size.X = xOffset; } // include the last line's height too! - size.Y += (fontFunction?.Invoke(text.Length - 1) ?? this).LineHeight; + size.Y += this.LineHeight; return size; } diff --git a/MLEM/Formatting/TokenizedString.cs b/MLEM/Formatting/TokenizedString.cs index 9382f0f..0b2bf88 100644 --- a/MLEM/Formatting/TokenizedString.cs +++ b/MLEM/Formatting/TokenizedString.cs @@ -194,7 +194,7 @@ namespace MLEM.Formatting { if (l < token.SplitDisplayString.Length - 1) { innerOffset.X = token.InnerOffsets[l] = this.GetInnerOffsetX(font, t, l + 1, alignment); - innerOffset.Y += tokenFont.LineHeight; + innerOffset.Y += font.LineHeight; } else { innerOffset.X += size.X; } @@ -239,7 +239,7 @@ namespace MLEM.Formatting { if (index <= 0) return token.GetFont(font); } - return font; + return null; } }