From 39cf27637e157ec13d8378ba89999d8a64809fd2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Oct 2020 14:59:03 +0900 Subject: [PATCH] Update to use virtual methods instead of reconstructing TextBuilder --- osu.Game/Skinning/LegacySpriteText.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game/Skinning/LegacySpriteText.cs b/osu.Game/Skinning/LegacySpriteText.cs index d7a3975c72..5d0e312f7c 100644 --- a/osu.Game/Skinning/LegacySpriteText.cs +++ b/osu.Game/Skinning/LegacySpriteText.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using osu.Framework.Graphics.Sprites; using osu.Framework.Text; using osu.Game.Graphics.Sprites; -using osuTK; namespace osu.Game.Skinning { @@ -13,6 +12,10 @@ namespace osu.Game.Skinning { private readonly LegacyGlyphStore glyphStore; + protected override char FixedWidthReferenceCharacter => '5'; + + protected override char[] FixedWidthExcludeCharacters => new[] { ',', '.', '%', 'x' }; + public LegacySpriteText(ISkin skin, string font = "score") { Shadow = false; @@ -22,8 +25,7 @@ namespace osu.Game.Skinning glyphStore = new LegacyGlyphStore(skin); } - protected override TextBuilder CreateTextBuilder(ITexturedGlyphLookupStore store) => - new TextBuilder(glyphStore, Font, MaxWidth, UseFullGlyphHeight, Vector2.Zero, Spacing, CharactersBacking, neverFixedWidthCharacters: new[] { ',', '.', '%', 'x' }, fixedWidthCalculationCharacter: '5'); + protected override TextBuilder CreateTextBuilder(ITexturedGlyphLookupStore store) => base.CreateTextBuilder(glyphStore); private class LegacyGlyphStore : ITexturedGlyphLookupStore {