diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 61491cc9ef..2cb2a90798 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -363,7 +363,7 @@ namespace OpenRA } ModData.InitializeLoaders(); - Renderer.InitializeFonts(ModData.Manifest); + Renderer.InitializeFonts(ModData); if (Cursor != null) Cursor.Dispose(); diff --git a/OpenRA.Game/Graphics/SpriteFont.cs b/OpenRA.Game/Graphics/SpriteFont.cs index d23bc0a728..be167a0b2f 100644 --- a/OpenRA.Game/Graphics/SpriteFont.cs +++ b/OpenRA.Game/Graphics/SpriteFont.cs @@ -27,7 +27,7 @@ namespace OpenRA.Graphics readonly Face face; readonly Cache, GlyphInfo> glyphs; - public SpriteFont(string name, int size, SheetBuilder builder) + public SpriteFont(string name, byte[] data, int size, SheetBuilder builder) { if (builder.Type != SheetType.BGRA) throw new ArgumentException("The sheet builder must create BGRA sheets.", "builder"); @@ -35,7 +35,7 @@ namespace OpenRA.Graphics this.size = size; this.builder = builder; - face = new Face(Library, name); + face = new Face(Library, data, 0); face.SetPixelSizes((uint)size, (uint)size); glyphs = new Cache, GlyphInfo>(CreateGlyph, Pair.EqualityComparer); diff --git a/OpenRA.Game/Renderer.cs b/OpenRA.Game/Renderer.cs index 6e669c68ef..37c487c0c0 100644 --- a/OpenRA.Game/Renderer.cs +++ b/OpenRA.Game/Renderer.cs @@ -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(); } } diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index f5147ab525..67247dd639 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -172,7 +172,7 @@ Fonts: Font:./mods/common/FreeSansBold.ttf Size:14 Title: - Font:d2k:Dune2k.ttf + Font:./mods/d2k/Dune2k.ttf Size:32 MediumBold: Font:./mods/common/FreeSansBold.ttf