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

r97:b806215143c6 -

1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -769,7 +769,7
769 status_left = String.Format("{0:},{1:} {2}", this.mouseGrid.X, this.mouseGrid.Y, this.simulation.map.cells[(int)this.mouseGrid.X][(int)this.mouseGrid.Y].status);
769 status_left = String.Format("{0:},{1:} {2}", this.mouseGrid.X, this.mouseGrid.Y, this.simulation.map.cells[(int)this.mouseGrid.X][(int)this.mouseGrid.Y].status);
770 }
770 }
771
771
772 String header_left = String.Format("${0:}|{1:} trees⚘𐂷🌳", this.simulation.money, this.simulation.map.tree_count);
772 String header_left = String.Format("${0:}|{1:} trees⚘𐂷🌳\ue125", this.simulation.money, this.simulation.map.tree_count);
773 String header_middle = String.Format("{0:MMMMM yyyy} ({1:})", this.simulation.DateTime, this.simulation.Season);
773 String header_middle = String.Format("{0:MMMMM yyyy} ({1:})", this.simulation.DateTime, this.simulation.Season);
774 // String header_right = String.Format("Press H for help.");
774 // String header_right = String.Format("Press H for help.");
775 String header_right = "";
775 String header_right = "";
@@ -6,6 +6,7
6 using Num = System.Numerics;
6 using Num = System.Numerics;
7 using Microsoft.Xna.Framework;
7 using Microsoft.Xna.Framework;
8 using Microsoft.Xna.Framework.Graphics;
8 using Microsoft.Xna.Framework.Graphics;
9 using System.Runtime.InteropServices;
9
10
10 namespace isometricparkfna.UI
11 namespace isometricparkfna.UI
11 {
12 {
@@ -38,15 +39,28
38 ImGuiIOPtr io = ImGui.GetIO();
39 ImGuiIOPtr io = ImGui.GetIO();
39 //io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-medium.ttf", 15);
40 //io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-medium.ttf", 15);
40
41
41 #if DEBUG
42 // #if DEBUG
42 io.Fonts.AddFontFromFileTTF(@"Content/iosevka-medium.ttf", 15);
43 // 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", 15);
44 io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-medium.ttf", 17);
45 // 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", 20);
46 io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-extendedmedium.ttf", 25);
47 // io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-extendedmedium.ttf", 25);
47 io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-extendedmedium.ttf", 30);
48 // io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-extendedmedium.ttf", 30);
48 #endif
49 // #endif
50
49 this.monoFont = io.Fonts.AddFontFromFileTTF(@"Content/iosevka-term-extendedmedium.ttf", 15);
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 _imGuiRenderer.RebuildFontAtlas(); // Required so fonts are available for rendering
65 _imGuiRenderer.RebuildFontAtlas(); // Required so fonts are available for rendering
52
66
@@ -111,6 +111,9
111 <None Include="Content\iosevka-term-medium.ttf">
111 <None Include="Content\iosevka-term-medium.ttf">
112 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
112 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
113 </None>
113 </None>
114 <None Include="Content\typicons.ttf">
115 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
116 </None>
114 <None Include="Content\grammar.json">
117 <None Include="Content\grammar.json">
115 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
118 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
116 </None>
119 </None>
You need to be logged in to leave comments. Login now