From a46e8fce86e37fb6e6454314e21f1dad7ca931ed Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 6 Sep 2019 12:20:53 +0200 Subject: [PATCH] moved formatting to MLEM proper --- Demos/UiDemo.cs | 2 +- MLEM.Ui/Elements/Paragraph.cs | 2 +- {MLEM.Ui/Format => MLEM/Formatting}/FormattingCode.cs | 3 +-- {MLEM.Ui/Format => MLEM/Formatting}/TextFormatting.cs | 9 ++++++--- 4 files changed, 9 insertions(+), 7 deletions(-) rename {MLEM.Ui/Format => MLEM/Formatting}/FormattingCode.cs (95%) rename {MLEM.Ui/Format => MLEM/Formatting}/TextFormatting.cs (94%) diff --git a/Demos/UiDemo.cs b/Demos/UiDemo.cs index 5087a46..8d5be22 100644 --- a/Demos/UiDemo.cs +++ b/Demos/UiDemo.cs @@ -6,12 +6,12 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MLEM.Extensions; using MLEM.Font; +using MLEM.Formatting; using MLEM.Input; using MLEM.Startup; using MLEM.Textures; using MLEM.Ui; using MLEM.Ui.Elements; -using MLEM.Ui.Format; using MLEM.Ui.Style; namespace Demos { diff --git a/MLEM.Ui/Elements/Paragraph.cs b/MLEM.Ui/Elements/Paragraph.cs index 7dd650a..6a17d7a 100644 --- a/MLEM.Ui/Elements/Paragraph.cs +++ b/MLEM.Ui/Elements/Paragraph.cs @@ -6,8 +6,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MLEM.Extensions; using MLEM.Font; +using MLEM.Formatting; using MLEM.Textures; -using MLEM.Ui.Format; using MLEM.Ui.Style; namespace MLEM.Ui.Elements { diff --git a/MLEM.Ui/Format/FormattingCode.cs b/MLEM/Formatting/FormattingCode.cs similarity index 95% rename from MLEM.Ui/Format/FormattingCode.cs rename to MLEM/Formatting/FormattingCode.cs index 9c81066..75f1637 100644 --- a/MLEM.Ui/Format/FormattingCode.cs +++ b/MLEM/Formatting/FormattingCode.cs @@ -1,8 +1,7 @@ -using System; using Microsoft.Xna.Framework; using MLEM.Textures; -namespace MLEM.Ui.Format { +namespace MLEM.Formatting { public class FormattingCode { public readonly Type CodeType; diff --git a/MLEM.Ui/Format/TextFormatting.cs b/MLEM/Formatting/TextFormatting.cs similarity index 94% rename from MLEM.Ui/Format/TextFormatting.cs rename to MLEM/Formatting/TextFormatting.cs index 5ecd40d..3deb7a5 100644 --- a/MLEM.Ui/Format/TextFormatting.cs +++ b/MLEM/Formatting/TextFormatting.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Text.RegularExpressions; using Microsoft.Xna.Framework; @@ -7,13 +6,17 @@ using MLEM.Extensions; using MLEM.Font; using MLEM.Textures; -namespace MLEM.Ui.Format { +namespace MLEM.Formatting { public static class TextFormatting { public static readonly Dictionary FormattingCodes = new Dictionary(); - public static string OneEmString = " "; private static Regex formatRegex; + // Unicode suggests that a space should be 1/4em in length, so this string should be + // 1em in length for most fonts. If it's not for the used font, the user can just + // change the value of this string to something that is in fact 1em long + public static string OneEmString = " "; + static TextFormatting() { SetFormatIndicators('[', ']');