From abf230a8bc3f1e13bf9a69e71e270b97428dfaaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=82=BA=E4=BB=80=E9=BA=BC?= Date: Sat, 4 Sep 2021 11:34:58 +0800 Subject: [PATCH] [temp] use this shit to test ttc format. and notice that ttc might have the issue: 1. ttc is list of fonts, not single font. so might have multiple font family. 2. it might contains the format that cannot be parsed (not pure ttf file.) --- osu.Game.Rulesets.Karaoke/IO/Stores/TtfGlyphStore.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/IO/Stores/TtfGlyphStore.cs b/osu.Game.Rulesets.Karaoke/IO/Stores/TtfGlyphStore.cs index 3e09d30e8..844907775 100644 --- a/osu.Game.Rulesets.Karaoke/IO/Stores/TtfGlyphStore.cs +++ b/osu.Game.Rulesets.Karaoke/IO/Stores/TtfGlyphStore.cs @@ -52,6 +52,7 @@ public TtfGlyphStore(ResourceStore store, string assetName = null) Store = new ResourceStore(store); Store.AddExtension("ttf"); + Store.AddExtension("ttc"); AssetName = assetName; @@ -69,8 +70,8 @@ public Task LoadFontAsync() => fontLoadTask ??= Task.Factory.StartNew(() => using (var s = Store.GetStream($@"{AssetName}")) { var fonts = new FontCollection(); - var fontFamily = fonts.Install(s); - font = new Font(fontFamily, 1); + var fontFamily = fonts.InstallCollection(s, out var description).ToArray(); + font = new Font(fontFamily[0], 1); } completionSource.SetResult(font);