Loads fonts via the virtual filesystem.

This commit is contained in:
Paul Chote
2016-01-21 17:33:43 +00:00
parent 8588f36575
commit 844e1a1770
4 changed files with 7 additions and 7 deletions

View File

@@ -90,7 +90,7 @@ namespace OpenRA
throw new InvalidOperationException("Renderer DLL is missing RendererAttribute to tell us what type to use!");
}
public void InitializeFonts(Manifest m)
public void InitializeFonts(ModData modData)
{
if (Fonts != null)
foreach (var font in Fonts.Values)
@@ -100,8 +100,8 @@ namespace OpenRA
if (fontSheetBuilder != null)
fontSheetBuilder.Dispose();
fontSheetBuilder = new SheetBuilder(SheetType.BGRA);
Fonts = m.Fonts.ToDictionary(x => x.Key,
x => new SpriteFont(Platform.ResolvePath(x.Value.First), x.Value.Second, fontSheetBuilder)).AsReadOnly();
Fonts = modData.Manifest.Fonts.ToDictionary(x => x.Key,
x => new SpriteFont(x.Value.First, modData.ModFiles.Open(x.Value.First).ReadAllBytes(), x.Value.Second, fontSheetBuilder)).AsReadOnly();
}
}