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 6, 2022
1 parent 015f82d commit 2f4c313
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 @@ -56,6 +56,7 @@ public TtfGlyphStore(ResourceStore<byte[]> store, string assetName = null)
Store = new ResourceStore<byte[]>(store);

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

AssetName = assetName;

Expand All @@ -73,8 +74,8 @@ public Task LoadFontAsync() => fontLoadTask ??= Task.Factory.StartNew(() =>
using (var s = Store.GetStream($@"{AssetName}"))
{
var fonts = new FontCollection();
var fontFamily = fonts.Add(s);
font = new Font(fontFamily, 1);
var fontFamily = fonts.AddCollection(s, out var description).ToArray();
font = new Font(fontFamily[0], 1);
}

completionSource.SetResult(font);
Expand Down

0 comments on commit 2f4c313

Please sign in to comment.