mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-22 16:39:19 +01:00
feat: merge game symbol font from lodestone into our ImGui font
This commit is contained in:
parent
6a779fa166
commit
14fb36a8b3
1 changed files with 18 additions and 1 deletions
|
|
@ -200,7 +200,7 @@ namespace Dalamud.Interface
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IntPtr PresentDetour(IntPtr swapChain, uint syncInterval, uint presentFlags)
|
private unsafe IntPtr PresentDetour(IntPtr swapChain, uint syncInterval, uint presentFlags)
|
||||||
{
|
{
|
||||||
if (this.scene == null)
|
if (this.scene == null)
|
||||||
{
|
{
|
||||||
|
|
@ -209,9 +209,26 @@ namespace Dalamud.Interface
|
||||||
this.scene.OnBuildUI += Display;
|
this.scene.OnBuildUI += Display;
|
||||||
this.scene.OnNewInputFrame += OnNewInputFrame;
|
this.scene.OnNewInputFrame += OnNewInputFrame;
|
||||||
|
|
||||||
|
ImFontConfigPtr fontConfig = ImGuiNative.ImFontConfig_ImFontConfig();
|
||||||
|
fontConfig.MergeMode = true;
|
||||||
|
fontConfig.PixelSnapH = true;
|
||||||
|
|
||||||
var fontPathJp = Path.Combine(this.dalamud.StartInfo.WorkingDirectory, "UIRes", "NotoSansCJKjp-Medium.otf");
|
var fontPathJp = Path.Combine(this.dalamud.StartInfo.WorkingDirectory, "UIRes", "NotoSansCJKjp-Medium.otf");
|
||||||
ImGui.GetIO().Fonts.AddFontFromFileTTF(fontPathJp, 17.0f, null, ImGui.GetIO().Fonts.GetGlyphRangesJapanese());
|
ImGui.GetIO().Fonts.AddFontFromFileTTF(fontPathJp, 17.0f, null, ImGui.GetIO().Fonts.GetGlyphRangesJapanese());
|
||||||
|
|
||||||
|
var fontPathGame = Path.Combine(this.dalamud.StartInfo.WorkingDirectory, "UIRes", "gamesym.ttf");
|
||||||
|
Log.Verbose(fontPathGame);
|
||||||
|
|
||||||
|
var rangeHandle = GCHandle.Alloc(new ushort[]
|
||||||
|
{
|
||||||
|
0xE020,
|
||||||
|
0xE0DB,
|
||||||
|
0
|
||||||
|
}, GCHandleType.Pinned);
|
||||||
|
|
||||||
|
|
||||||
|
ImGui.GetIO().Fonts.AddFontFromFileTTF(fontPathGame, 17.0f, fontConfig, rangeHandle.AddrOfPinnedObject());
|
||||||
|
|
||||||
ImGui.GetIO().Fonts.Build();
|
ImGui.GetIO().Fonts.Build();
|
||||||
|
|
||||||
ImGui.GetStyle().GrabRounding = 3f;
|
ImGui.GetStyle().GrabRounding = 3f;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue