Description:
Add Icon font.
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r96:c55552ff3f8b -

1 NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
@@ -745,7 +745,7
745 745 //*/
746 746
747 747
748 String header_left = String.Format("${0:}|{1:} trees⚘𐂷🌳", this.simulation.money, this.simulation.map.tree_count);
748 String header_left = String.Format("${0:}|{1:} trees⚘𐂷🌳\ue125", this.simulation.money, this.simulation.map.tree_count);
749 749 String header_middle = String.Format("{0:MMMMM yyyy} ({1:})", this.simulation.DateTime, this.simulation.Season);
750 750 String header_right = String.Format("Hotkeys: Arrow keys; (F)orest Policy; (B)udget; 0 toggles pause");
751 751
@@ -6,6 +6,7
6 6 using Num = System.Numerics;
7 7 using Microsoft.Xna.Framework;
8 8 using Microsoft.Xna.Framework.Graphics;
9 using System.Runtime.InteropServices;
9 10
10 11 namespace isometricparkfna.UI
11 12 {
@@ -38,15 +39,28
38 39 ImGuiIOPtr io = ImGui.GetIO();
39 40 //io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-medium.ttf", 15);
40 41
41 #if DEBUG
42 io.Fonts.AddFontFromFileTTF(@"Content/iosevka-medium.ttf", 15);
43 io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-medium.ttf", 15);
44 io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-medium.ttf", 17);
45 io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-extendedmedium.ttf", 20);
46 io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-extendedmedium.ttf", 25);
47 io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-extendedmedium.ttf", 30);
48 #endif
42 // #if DEBUG
43 // io.Fonts.AddFontFromFileTTF(@"Content/iosevka-medium.ttf", 15);
44 // io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-medium.ttf", 15);
45 // io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-medium.ttf", 17);
46 // io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-extendedmedium.ttf", 20);
47 // io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-extendedmedium.ttf", 25);
48 // io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-extendedmedium.ttf", 30);
49 // #endif
50
49 51 this.monoFont = io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-extendedmedium.ttf", 15);
52 unsafe //god this sucks
53 {
54 ImFontConfigPtr config = ImGuiNative.ImFontConfig_ImFontConfig();
55 config.MergeMode = true;
56 var builder = new ImFontGlyphRangesBuilderPtr(ImGuiNative.ImFontGlyphRangesBuilder_ImFontGlyphRangesBuilder());
57 // builder.AddText("\ue125\ue126");
58 var icon_ranges = new ushort[] { 0xe000, 0xe1f4, 0 };
59 GCHandle rangeHandle = GCHandle.Alloc(icon_ranges, GCHandleType.Pinned);
60 io.Fonts.AddFontFromFileTTF(@"Content/typicons.ttf", 15, config, rangeHandle.AddrOfPinnedObject());
61
62
63 }
50 64
51 65 _imGuiRenderer.RebuildFontAtlas(); // Required so fonts are available for rendering
52 66
@@ -110,6 +110,9
110 110 <None Include="Content\iosevka-term-medium.ttf">
111 111 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
112 112 </None>
113 <None Include="Content\typicons.ttf">
114 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
115 </None>
113 116 <None Include="Content\grammar.json">
114 117 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
115 118 </None>
You need to be logged in to leave comments. Login now