1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-25 22:18:34 +01:00

a lot of font cleanup

This commit is contained in:
Ellpeck 2020-03-28 22:25:06 +01:00
parent 138f683776
commit 80f36c78bd
14 changed files with 76 additions and 176 deletions

View file

@ -1,19 +0,0 @@
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions;
using MonoGame.Extended.BitmapFonts;
namespace MLEM.Extended.Extensions {
public static class BitmapFontExtensions {
public static string SplitString(this BitmapFont font, string text, float width, float scale) {
return SpriteFontExtensions.SplitString(s => font.MeasureString(s).Width, text, width, scale);
}
public static string TruncateString(this BitmapFont font, string text, float width, float scale, bool fromBack = false) {
return SpriteFontExtensions.TruncateString(s => font.MeasureString(s).Width, text, width, scale, fromBack);
}
}
}

View file

@ -8,16 +8,6 @@ using MonoGame.Extended.BitmapFonts;
namespace MLEM.Extended.Extensions {
public static class SpriteBatchExtensions {
public static void DrawCenteredString(this SpriteBatch batch, BitmapFont font, string text, Vector2 position, float scale, Color color, bool horizontal = true, bool vertical = false, float addedScale = 0) {
var size = font.MeasureString(text);
var center = new Vector2(
horizontal ? size.Width * scale / 2F : 0,
vertical ? size.Height * scale / 2F : 0);
batch.DrawString(font, text,
position + (Vector2) size * scale / 2 - center,
color, 0, size / 2, scale + addedScale, SpriteEffects.None, 0);
}
public static void Draw(this SpriteBatch batch, Texture2D texture, RectangleF destinationRectangle, Rectangle? sourceRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth) {
batch.Draw(texture, destinationRectangle.ToMlem(), sourceRectangle, color, rotation, origin, effects, layerDepth);
}
@ -30,6 +20,5 @@ namespace MLEM.Extended.Extensions {
batch.Draw(texture, destinationRectangle, null, color);
}
}
}

View file

@ -7,58 +7,46 @@ using MLEM.Font;
using MonoGame.Extended.BitmapFonts;
namespace MLEM.Extended.Font {
public class GenericBitmapFont : IGenericFont {
public class GenericBitmapFont : GenericFont {
public readonly BitmapFont Font;
public float LineHeight => this.Font.LineHeight;
public override float LineHeight => this.Font.LineHeight;
public GenericBitmapFont(BitmapFont font) {
this.Font = font;
}
public Vector2 MeasureString(string text) {
public override Vector2 MeasureString(string text) {
return this.Font.MeasureString(text);
}
public Vector2 MeasureString(StringBuilder text) {
public override Vector2 MeasureString(StringBuilder text) {
return this.Font.MeasureString(text);
}
public void DrawString(SpriteBatch batch, string text, Vector2 position, Color color) {
public override void DrawString(SpriteBatch batch, string text, Vector2 position, Color color) {
batch.DrawString(this.Font, text, position, color);
}
public void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) {
public override void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) {
batch.DrawString(this.Font, text, position, color, rotation, origin, scale, effects, layerDepth);
}
public void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) {
public override void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) {
batch.DrawString(this.Font, text, position, color, rotation, origin, scale, effects, layerDepth);
}
public void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color) {
public override void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color) {
batch.DrawString(this.Font, text, position, color);
}
public void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) {
public override void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) {
batch.DrawString(this.Font, text, position, color, rotation, origin, scale, effects, layerDepth);
}
public void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) {
public override void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) {
batch.DrawString(this.Font, text, position, color, rotation, origin, scale, effects, layerDepth);
}
public void DrawCenteredString(SpriteBatch batch, string text, Vector2 position, float scale, Color color, bool horizontal = true, bool vertical = false, float addedScale = 0) {
batch.DrawCenteredString(this.Font, text, position, scale, color, horizontal, vertical, addedScale);
}
public string SplitString(string text, float width, float scale) {
return this.Font.SplitString(text, width, scale);
}
public string TruncateString(string text, float width, float scale, bool fromBack = false) {
return this.Font.TruncateString(text, width, scale, fromBack);
}
}
}

View file

@ -17,9 +17,9 @@ namespace MLEM.Ui.Elements {
private string text;
private string splitText;
public FormattingCodeCollection Formatting;
public StyleProp<IGenericFont> RegularFont;
public StyleProp<IGenericFont> BoldFont;
public StyleProp<IGenericFont> ItalicFont;
public StyleProp<GenericFont> RegularFont;
public StyleProp<GenericFont> BoldFont;
public StyleProp<GenericFont> ItalicFont;
public StyleProp<FormatSettings> FormatSettings;
public StyleProp<Color> TextColor;

View file

@ -26,7 +26,7 @@ namespace MLEM.Ui.Elements {
public StyleProp<NinePatch> HoveredTexture;
public StyleProp<Color> HoveredColor;
public StyleProp<float> TextScale;
public StyleProp<IGenericFont> Font;
public StyleProp<GenericFont> Font;
private readonly StringBuilder text = new StringBuilder();
public string Text => this.text.ToString();
public string PlaceholderText;
@ -53,7 +53,7 @@ namespace MLEM.Ui.Elements {
}
}
public TextField(Anchor anchor, Vector2 size, Rule rule = null, IGenericFont font = null) : base(anchor, size) {
public TextField(Anchor anchor, Vector2 size, Rule rule = null, GenericFont font = null) : base(anchor, size) {
this.InputRule = rule ?? DefaultRule;
if (font != null)
this.Font.Set(font);
@ -159,17 +159,17 @@ namespace MLEM.Ui.Elements {
batch.Draw(tex, this.DisplayArea, color, this.Scale);
if (this.displayedText != null) {
var textPos = this.DisplayArea.Location + new Vector2(this.TextOffsetX * this.Scale, this.DisplayArea.Height / 2);
var lineHeight = this.Font.Value.LineHeight * this.TextScale * this.Scale;
var textPos = this.DisplayArea.Location + new Vector2(this.TextOffsetX * this.Scale, this.DisplayArea.Height / 2 - lineHeight / 2);
if (this.text.Length > 0 || this.IsSelected) {
var textColor = this.TextColor.OrDefault(Color.White);
this.Font.Value.DrawCenteredString(batch, this.displayedText, textPos, this.TextScale * this.Scale, textColor * alpha, false, true);
this.Font.Value.DrawString(batch, this.displayedText, textPos, textColor * alpha, 0, Vector2.Zero, this.TextScale * this.Scale, SpriteEffects.None, 0);
if (this.IsSelected && this.caretBlinkTimer >= 0.5F) {
var textSize = this.Font.Value.MeasureString(this.displayedText.Substring(0, this.CaretPos - this.textOffset)) * this.TextScale * this.Scale;
var caretHeight = this.Font.Value.LineHeight * this.TextScale * this.Scale;
batch.Draw(batch.GetBlankTexture(), new RectangleF(textPos.X + textSize.X, textPos.Y - caretHeight / 2, this.CaretWidth * this.Scale, caretHeight), null, textColor * alpha);
batch.Draw(batch.GetBlankTexture(), new RectangleF(textPos.X + textSize.X, textPos.Y, this.CaretWidth * this.Scale, lineHeight), null, textColor * alpha);
}
} else if (this.PlaceholderText != null) {
this.Font.Value.DrawCenteredString(batch, this.PlaceholderText, textPos, this.TextScale * this.Scale, this.PlaceholderColor.OrDefault(Color.Gray) * alpha, false, true);
this.Font.Value.DrawString(batch, this.PlaceholderText, textPos, this.PlaceholderColor.OrDefault(Color.Gray) * alpha, 0, Vector2.Zero, this.TextScale * this.Scale, SpriteEffects.None, 0);
}
}
base.Draw(time, batch, alpha, blendState, samplerState, matrix);

View file

@ -35,9 +35,9 @@ namespace MLEM.Ui.Style {
public Vector2 ProgressBarProgressPadding;
public NinePatch ProgressBarProgressTexture;
public Color ProgressBarProgressColor;
public IGenericFont Font;
public IGenericFont BoldFont;
public IGenericFont ItalicFont;
public GenericFont Font;
public GenericFont BoldFont;
public GenericFont ItalicFont;
public FormatSettings FormatSettings;
public float TextScale = 1;
public SoundEffect ActionSound;

View file

@ -34,45 +34,34 @@ namespace MLEM.Ui.Style {
this.Font = new EmptyFont();
}
private class EmptyFont : IGenericFont {
private class EmptyFont : GenericFont {
public float LineHeight => 1;
public override float LineHeight => 1;
public Vector2 MeasureString(string text) {
public override Vector2 MeasureString(string text) {
return Vector2.One;
}
public Vector2 MeasureString(StringBuilder text) {
public override Vector2 MeasureString(StringBuilder text) {
return Vector2.One;
}
public void DrawString(SpriteBatch batch, string text, Vector2 position, Color color) {
public override void DrawString(SpriteBatch batch, string text, Vector2 position, Color color) {
}
public void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) {
public override void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) {
}
public void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) {
public override void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) {
}
public void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color) {
public override void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color) {
}
public void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) {
public override void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) {
}
public void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) {
}
public void DrawCenteredString(SpriteBatch batch, string text, Vector2 position, float scale, Color color, bool horizontal = true, bool vertical = false, float addedScale = 0) {
}
public string SplitString(string text, float width, float scale) {
return text;
}
public string TruncateString(string text, float width, float scale, bool fromBack = false) {
return text;
public override void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) {
}
}

View file

@ -39,16 +39,6 @@ namespace MLEM.Extensions {
return new NinePatch(tex, 1);
}
public static void DrawCenteredString(this SpriteBatch batch, SpriteFont font, string text, Vector2 position, float scale, Color color, bool horizontal = true, bool vertical = false, float addedScale = 0) {
var size = font.MeasureString(text);
var center = new Vector2(
horizontal ? size.X * scale / 2F : 0,
vertical ? size.Y * scale / 2F : 0);
batch.DrawString(font, text,
position + size * scale / 2 - center,
color, 0, size / 2, scale + addedScale, SpriteEffects.None, 0);
}
public static void Draw(this SpriteBatch batch, Texture2D texture, RectangleF destinationRectangle, Rectangle? sourceRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth) {
var source = sourceRectangle ?? new Rectangle(0, 0, texture.Width, texture.Height);
var scale = new Vector2(1F / source.Width, 1F / source.Height) * destinationRectangle.Size;

View file

@ -1,21 +1,30 @@
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MLEM.Font;
namespace MLEM.Extensions {
public static class SpriteFontExtensions {
namespace MLEM.Font {
public abstract class GenericFont {
public static string SplitString(this SpriteFont font, string text, float width, float scale) {
return SplitString(s => font.MeasureString(s).X, text, width, scale);
}
public abstract float LineHeight { get; }
public static string TruncateString(this SpriteFont font, string text, float width, float scale, bool fromBack = false) {
return TruncateString(s => font.MeasureString(s).X, text, width, scale, fromBack);
}
public abstract Vector2 MeasureString(string text);
public static string TruncateString(Func<StringBuilder, float> widthFunc, string text, float width, float scale, bool fromBack = false) {
public abstract Vector2 MeasureString(StringBuilder text);
public abstract void DrawString(SpriteBatch batch, string text, Vector2 position, Color color);
public abstract void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth);
public abstract void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth);
public abstract void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color);
public abstract void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth);
public abstract void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth);
public string TruncateString(string text, float width, float scale, bool fromBack = false) {
var total = new StringBuilder();
for (var i = 0; i < text.Length; i++) {
if (fromBack) {
@ -24,18 +33,18 @@ namespace MLEM.Extensions {
total.Append(text[i]);
}
if (widthFunc(total) * scale >= width)
if (this.MeasureString(total).X * scale >= width)
return total.ToString(fromBack ? 1 : 0, total.Length - 1);
}
return total.ToString();
}
public static string SplitString(Func<string, float> widthFunc, string text, float width, float scale) {
public string SplitString(string text, float width, float scale) {
var total = new StringBuilder();
foreach (var line in text.Split('\n')) {
var curr = new StringBuilder();
foreach (var word in line.Split(' ')) {
if (widthFunc(word) * scale >= width) {
if (this.MeasureString(word).X * scale >= width) {
if (curr.Length > 0) {
total.Append(curr).Append('\n');
curr.Clear();
@ -43,7 +52,7 @@ namespace MLEM.Extensions {
var wordBuilder = new StringBuilder();
for (var i = 0; i < word.Length; i++) {
wordBuilder.Append(word[i]);
if (widthFunc(wordBuilder.ToString()) * scale >= width) {
if (this.MeasureString(wordBuilder.ToString()).X * scale >= width) {
total.Append(wordBuilder.ToString(0, wordBuilder.Length - 1)).Append('\n');
wordBuilder.Remove(0, wordBuilder.Length - 1);
}
@ -51,7 +60,7 @@ namespace MLEM.Extensions {
curr.Append(wordBuilder).Append(' ');
} else {
curr.Append(word).Append(' ');
if (widthFunc(curr.ToString()) * scale >= width) {
if (this.MeasureString(curr.ToString()).X * scale >= width) {
var len = curr.Length - word.Length - 1;
if (len > 0) {
total.Append(curr.ToString(0, len)).Append('\n');
@ -65,9 +74,9 @@ namespace MLEM.Extensions {
return total.ToString(0, total.Length - 2);
}
public static string GetWidthString(IGenericFont font, float width, char content = ' ') {
public string GetWidthString(float width, char content = ' ') {
var strg = content.ToString();
while (font.MeasureString(strg).X < width)
while (this.MeasureString(strg).X < width)
strg += content;
return strg;
}

View file

@ -5,58 +5,46 @@ using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions;
namespace MLEM.Font {
public class GenericSpriteFont : IGenericFont {
public class GenericSpriteFont : GenericFont {
public readonly SpriteFont Font;
public float LineHeight => this.Font.LineSpacing;
public override float LineHeight => this.Font.LineSpacing;
public GenericSpriteFont(SpriteFont font) {
this.Font = font;
}
public Vector2 MeasureString(string text) {
public override Vector2 MeasureString(string text) {
return this.Font.MeasureString(text);
}
public Vector2 MeasureString(StringBuilder text) {
public override Vector2 MeasureString(StringBuilder text) {
return this.Font.MeasureString(text);
}
public void DrawString(SpriteBatch batch, string text, Vector2 position, Color color) {
public override void DrawString(SpriteBatch batch, string text, Vector2 position, Color color) {
batch.DrawString(this.Font, text, position, color);
}
public void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) {
public override void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) {
batch.DrawString(this.Font, text, position, color, rotation, origin, scale, effects, layerDepth);
}
public void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) {
public override void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) {
batch.DrawString(this.Font, text, position, color, rotation, origin, scale, effects, layerDepth);
}
public void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color) {
public override void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color) {
batch.DrawString(this.Font, text, position, color);
}
public void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) {
public override void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) {
batch.DrawString(this.Font, text, position, color, rotation, origin, scale, effects, layerDepth);
}
public void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) {
public override void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) {
batch.DrawString(this.Font, text, position, color, rotation, origin, scale, effects, layerDepth);
}
public void DrawCenteredString(SpriteBatch batch, string text, Vector2 position, float scale, Color color, bool horizontal = true, bool vertical = false, float addedScale = 0) {
batch.DrawCenteredString(this.Font, text, position, scale, color, horizontal, vertical, addedScale);
}
public string SplitString(string text, float width, float scale) {
return this.Font.SplitString(text, width, scale);
}
public string TruncateString(string text, float width, float scale, bool fromBack = false) {
return this.Font.TruncateString(text, width, scale, fromBack);
}
}
}

View file

@ -1,34 +0,0 @@
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace MLEM.Font {
public interface IGenericFont {
float LineHeight { get; }
Vector2 MeasureString(string text);
Vector2 MeasureString(StringBuilder text);
void DrawString(SpriteBatch batch, string text, Vector2 position, Color color);
void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth);
void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth);
void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color);
void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth);
void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth);
void DrawCenteredString(SpriteBatch batch, string text, Vector2 position, float scale, Color color, bool horizontal = true, bool vertical = false, float addedScale = 0);
string SplitString(string text, float width, float scale);
string TruncateString(string text, float width, float scale, bool fromBack = false);
}
}

View file

@ -37,8 +37,8 @@ namespace MLEM.Formatting {
this.CodeType = Type.Animation;
}
public virtual string GetReplacementString(IGenericFont font) {
return this.CodeType == Type.Icon ? SpriteFontExtensions.GetWidthString(font, font.LineHeight) : string.Empty;
public virtual string GetReplacementString(GenericFont font) {
return this.CodeType == Type.Icon ? font.GetWidthString(font.LineHeight) : string.Empty;
}
public enum Type {

View file

@ -20,7 +20,7 @@ namespace MLEM.Formatting {
font.DrawString(batch, charSt, position, color, 0, Vector2.Zero, scale, SpriteEffects.None, layerDepth);
};
public delegate void DrawCharacter(FormatSettings settings, IGenericFont font, SpriteBatch batch, string totalText, int index, int effectStartIndex, string charSt, Vector2 position, Color color, float scale, float layerDepth, TimeSpan timeIntoAnimation);
public delegate void DrawCharacter(FormatSettings settings, GenericFont font, SpriteBatch batch, string totalText, int index, int effectStartIndex, string charSt, Vector2 position, Color color, float scale, float layerDepth, TimeSpan timeIntoAnimation);
}
}

View file

@ -44,14 +44,14 @@ namespace MLEM.Formatting {
formatRegex = new Regex($"{op}[^{op}{cl}]*{cl}");
}
public static string RemoveFormatting(this string s, IGenericFont font) {
public static string RemoveFormatting(this string s, GenericFont font) {
return formatRegex.Replace(s, match => {
var code = FromMatch(match);
return code != null ? code.GetReplacementString(font) : match.Value;
});
}
public static FormattingCodeCollection GetFormattingCodes(this string s, IGenericFont font) {
public static FormattingCodeCollection GetFormattingCodes(this string s, GenericFont font) {
var codes = new FormattingCodeCollection();
var codeLengths = 0;
foreach (Match match in formatRegex.Matches(s)) {
@ -70,7 +70,7 @@ namespace MLEM.Formatting {
return codes;
}
public static void DrawFormattedString(this IGenericFont regularFont, SpriteBatch batch, Vector2 pos, string unformattedText, FormattingCodeCollection formatting, Color color, float scale, IGenericFont boldFont = null, IGenericFont italicFont = null, float depth = 0, TimeSpan timeIntoAnimation = default, FormatSettings formatSettings = null) {
public static void DrawFormattedString(this GenericFont regularFont, SpriteBatch batch, Vector2 pos, string unformattedText, FormattingCodeCollection formatting, Color color, float scale, GenericFont boldFont = null, GenericFont italicFont = null, float depth = 0, TimeSpan timeIntoAnimation = default, FormatSettings formatSettings = null) {
var settings = formatSettings ?? FormatSettings.Default;
var currColor = color;
var currFont = regularFont;