Skip to content

Commit c9967e4

Browse files
committed
Adjust AddFont Api
1 parent 2980579 commit c9967e4

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

osu.Framework/Game.cs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -258,23 +258,12 @@ private void load(FrameworkConfigManager config)
258258
/// <param name="store">The backing store with font resources.</param>
259259
/// <param name="assetName">The base name of the font.</param>
260260
/// <param name="target">An optional target store to add the font to. If not specified, <see cref="Fonts"/> is used.</param>
261-
public void AddFont(ResourceStore<byte[]> store, string assetName = null, FontStore target = null)
261+
/// <param name="coloured">Whether the font is coloured (typically used for emoji fonts).</param>
262+
public void AddFont(ResourceStore<byte[]> store, string assetName = null, bool coloured = false, FontStore target = null)
262263
=> addFont(target ?? Fonts, store, assetName);
263264

264-
/// <summary>
265-
/// Add a color font (such as emoji fonts) to be globally accessible to the game.
266-
/// </summary>
267-
/// <param name="store">The backing store with font resources.</param>
268-
/// <param name="assetName">The base name of the font.</param>
269-
/// <param name="target">An optional target store to add the font to. If not specified, <see cref="Fonts"/> is used.</param>
270-
public void AddColorFont(ResourceStore<byte[]> store, string assetName = null, FontStore target = null)
271-
=> addColorFont(target ?? Fonts, store, assetName);
272-
273-
private void addFont(FontStore target, ResourceStore<byte[]> store, string assetName = null)
274-
=> target.AddTextureSource(new RawCachingGlyphStore(store, assetName, Host.CreateTextureLoaderStore(store)));
275-
276-
private void addColorFont(FontStore target, ResourceStore<byte[]> store, string assetName = null)
277-
=> target.AddTextureSource(new RawCachingGlyphStore(store, assetName, Host.CreateTextureLoaderStore(store), coloured: true));
265+
private void addFont(FontStore target, ResourceStore<byte[]> store, string assetName = null, bool coloured = false)
266+
=> target.AddTextureSource(new RawCachingGlyphStore(store, assetName, Host.CreateTextureLoaderStore(store), coloured: coloured));
278267

279268
protected override void LoadComplete()
280269
{

0 commit comments

Comments
 (0)