Closed Charltsing closed 2 weeks ago
You shouldn't used fixed (in this context) this will create a heap corruption, you either have to use the File load function or you have to keep the pointer alive for the time that the texture is created. And additionally read the Ownership comment, ImGui cannot free a piece of memory allocated with the GC either use mashal AllocH and Free or my utils.
the pointer has to be alive until you call
ImGui.GetTexDataAsRGBA32(io.Fonts, &pixels, &width, &height, null);
and create a texture after that it's safe to free.
if you want that imgui keeps ownership then i suggest using ImGui.MemAlloc instead of Marshal or my utils, this prevents issues with freeing.
(font size 24) (font size 16) (font size 16 with config.PixelSnapH = true; config.OversampleH = 1;)
the smaller you go, the more "blur" you get, and make sure you have your DPI configuration correct. (like in SDL2 or WinApi, or any windowing framework.)
It may be a problem with ImGui
Maybe there is a way to make Chinese fonts not appear blurry at 16 pixels, but I haven't found it yet.
IMGUI.net sample
Hexa.NET.ImGui.Widgets demo
Maybe there is a way to make Chinese fonts not appear blurry at 16 pixels, but I haven't found it yet.