diff --git a/isometric-park-fna/FNAGame.cs b/isometric-park-fna/FNAGame.cs --- a/isometric-park-fna/FNAGame.cs +++ b/isometric-park-fna/FNAGame.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; @@ -35,6 +35,7 @@ private SpriteBatch batch; private SoundEffect sound; private SpriteFont monoFont; + private SpriteFont smallFont; private Camera camera = new Camera(new float[] { 0.25f, 0.5f, 1.0f, 2.0f, 4.0f }); @@ -906,7 +907,7 @@ bool quit = false; Menu.Render(debugWindow.monoFont, FNAGame.width, this.imGuiWindowBridgeEngine, ref quit, ref this.simulation.paused, ref this.simulation.currentRate, ref this.showBudget, header_left); - Toolbar.Render(debugWindow.monoFont, FNAGame.width, this.imGuiWindowBridgeEngine); + Toolbar.Render(debugWindow.monoFont, debugWindow.smallFont, FNAGame.width, this.imGuiWindowBridgeEngine); if (quit) { System.Environment.Exit(0); diff --git a/isometric-park-fna/UI/DebugWindow.cs b/isometric-park-fna/UI/DebugWindow.cs --- a/isometric-park-fna/UI/DebugWindow.cs +++ b/isometric-park-fna/UI/DebugWindow.cs @@ -32,6 +32,7 @@ private bool show_test_window; public ImFontPtr monoFont; + public ImFontPtr smallFont; public DebugWindow(ImGuiRenderer _imGuiRenderer, GraphicsDevice graphicsDevice) @@ -62,6 +63,20 @@ } + unsafe //god this sucks + { + ImFontConfigPtr config = ImGuiNative.ImFontConfig_ImFontConfig(); + config.MergeMode = true; + var builder = new ImFontGlyphRangesBuilderPtr(ImGuiNative.ImFontGlyphRangesBuilder_ImFontGlyphRangesBuilder()); + // builder.AddText("\ue125\ue126"); + var icon_ranges = new ushort[] { 0xe000, 0xe1f4, 0 }; + GCHandle rangeHandle = GCHandle.Alloc(icon_ranges, GCHandleType.Pinned); + io.Fonts.AddFontFromFileTTF(@"Content/typicons.ttf", 15, config, rangeHandle.AddrOfPinnedObject()); + + + } + this.smallFont = io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-extendedmedium.ttf", 5); + _imGuiRenderer.RebuildFontAtlas(); // Required so fonts are available for rendering