Skip to content

Commit

Permalink
[temp] use this shit to test ttc format.
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
andy840119 committed Sep 4, 2021
1 parent ea9d0d4 commit 5f9a4ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions osu.Game.Rulesets.Karaoke/IO/Stores/TtfGlyphStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public TtfGlyphStore(ResourceStore<byte[]> store, string assetName = null)
Store = new ResourceStore<byte[]>(store);

Store.AddExtension("ttf");
Store.AddExtension("ttc");

AssetName = assetName;

Expand All @@ -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);
Expand Down

0 comments on commit 5f9a4ac

Please sign in to comment.