From 5f9a4ac7449ca6ec5e2ab09f131216c671310ce7 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 3a5a49911..e6205edf2 100644 --- a/osu.Game.Rulesets.Karaoke/IO/Stores/TtfGlyphStore.cs +++ b/osu.Game.Rulesets.Karaoke/IO/Stores/TtfGlyphStore.cs @@ -48,6 +48,7 @@ public TtfGlyphStore(ResourceStore store, string assetName = null) Store = new ResourceStore(store); Store.AddExtension("ttf"); + Store.AddExtension("ttc"); AssetName = assetName; @@ -65,8 +66,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);