diff --git a/osu.Game.Rulesets.Karaoke/Graphics/UserInterfaceV2/FontSelector.cs b/osu.Game.Rulesets.Karaoke/Graphics/UserInterfaceV2/FontSelector.cs index 10624d0a2..e808230c0 100644 --- a/osu.Game.Rulesets.Karaoke/Graphics/UserInterfaceV2/FontSelector.cs +++ b/osu.Game.Rulesets.Karaoke/Graphics/UserInterfaceV2/FontSelector.cs @@ -9,6 +9,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Rendering; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.IO.Stores; @@ -198,12 +199,12 @@ public FontSelector() } [BackgroundDependencyLoader] - private void load(FontManager fontManager) + private void load(FontManager fontManager, IRenderer renderer) { fonts.BindTo(fontManager.Fonts); // create local font store and import those files - localFontStore = new KaraokeLocalFontStore(fontManager); + localFontStore = new KaraokeLocalFontStore(fontManager, renderer); fontStore.AddStore(localFontStore); Current.BindValueChanged(e => diff --git a/osu.Game.Rulesets.Karaoke/IO/Stores/KaraokeLocalFontStore.cs b/osu.Game.Rulesets.Karaoke/IO/Stores/KaraokeLocalFontStore.cs index f02e6f527..71c991dac 100644 --- a/osu.Game.Rulesets.Karaoke/IO/Stores/KaraokeLocalFontStore.cs +++ b/osu.Game.Rulesets.Karaoke/IO/Stores/KaraokeLocalFontStore.cs @@ -4,6 +4,7 @@ #nullable disable using System.Collections.Generic; +using osu.Framework.Graphics.Rendering; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.IO.Stores; @@ -15,19 +16,18 @@ namespace osu.Game.Rulesets.Karaoke.IO.Stores public class KaraokeLocalFontStore : FontStore { private readonly Dictionary> fontInfos = new(); - private readonly IResourceStore store; private readonly FontManager fontManager; /// /// Construct a font store to be added to a parent font store via . /// /// font manager. + /// The renderer to create textures with. /// The texture source. /// The raw pixel height of the font. Can be used to apply a global scale or metric to font usages. - public KaraokeLocalFontStore(FontManager fontManager, IResourceStore store = null, float scaleAdjust = 100) - : base(store, scaleAdjust) + public KaraokeLocalFontStore(FontManager fontManager, IRenderer renderer, IResourceStore store = null, float scaleAdjust = 100) + : base(renderer, store, scaleAdjust) { - this.store = store; this.fontManager = fontManager; } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Settings/Previews/Gameplay/LyricPreview.cs b/osu.Game.Rulesets.Karaoke/Screens/Settings/Previews/Gameplay/LyricPreview.cs index 37faa8bce..868ec3724 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Settings/Previews/Gameplay/LyricPreview.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Settings/Previews/Gameplay/LyricPreview.cs @@ -8,6 +8,7 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; +using osu.Framework.Graphics.Rendering; using osu.Framework.Graphics.Sprites; using osu.Framework.IO.Stores; using osu.Game.Rulesets.Karaoke.Configuration; @@ -74,10 +75,10 @@ void addFont(FontUsage fontUsage) } [BackgroundDependencyLoader] - private void load(FontManager fontManager, KaraokeRulesetConfigManager config) + private void load(FontManager fontManager, IRenderer renderer, KaraokeRulesetConfigManager config) { // create local font store and import those files - localFontStore = new KaraokeLocalFontStore(fontManager); + localFontStore = new KaraokeLocalFontStore(fontManager, renderer); fontStore.AddStore(localFontStore); // fonts diff --git a/osu.Game.Rulesets.Karaoke/UI/KaraokePlayfieldAdjustmentContainer.cs b/osu.Game.Rulesets.Karaoke/UI/KaraokePlayfieldAdjustmentContainer.cs index 92228534b..07baaf163 100644 --- a/osu.Game.Rulesets.Karaoke/UI/KaraokePlayfieldAdjustmentContainer.cs +++ b/osu.Game.Rulesets.Karaoke/UI/KaraokePlayfieldAdjustmentContainer.cs @@ -5,6 +5,7 @@ using System.Linq; using osu.Framework.Allocation; +using osu.Framework.Graphics.Rendering; using osu.Framework.Graphics.Sprites; using osu.Framework.IO.Stores; using osu.Game.Rulesets.Karaoke.Configuration; @@ -26,7 +27,7 @@ public class KaraokePlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer private KaraokeLocalFontStore localFontStore; [BackgroundDependencyLoader] - private void load(FontManager fontManager, KaraokeRulesetConfigManager manager) + private void load( FontManager fontManager, IRenderer renderer, KaraokeRulesetConfigManager manager) { // get all font usage which wants to import. var targetImportFonts = new[] @@ -46,7 +47,7 @@ private void load(FontManager fontManager, KaraokeRulesetConfigManager manager) return; // create local font store and import those files - localFontStore = new KaraokeLocalFontStore(fontManager); + localFontStore = new KaraokeLocalFontStore(fontManager, renderer); fontStore.AddStore(localFontStore); foreach (var fontInfo in fontInfos)