Open Starpelly opened 1 year ago
@Starpelly Hey, did you manage to find a workaround for this issue?
Use Font Custom Initializer Event
public void InitializeFont(ImGuiIOPtr io)
{
var fontPath = $"{Application.streamingAssetsPath}/YOUR_FONT.ttf";
io.Fonts.AddFontFromFileTTF(fontPath, 32, null, io.Fonts.GetGlyphRangesDefault());
}
It doesn't seem to work for me, I'm having the same problem, is this problem solved so far, I'm not quite sure what step I'm missing.
It doesn't seem to work for me, I'm having the same problem, is this problem solved so far, I'm not quite sure what step I'm missing.
Since this question was asked, I've just decided to not use ImGui and role out my own thing. Sorry, I don't think this was ever fixed, sadly.
它似乎对我不起作用,我遇到了同样的问题,到目前为止这个问题是否已解决,我不太确定我错过了哪一步。
既然问了这个问题,我就决定不用ImGui,而是把自己的东西演绎出来。对不起,可悲的是,我认为这从未得到解决。
It seems pretty random that I can just use it fine in some unity versions, but in some it will just crash. I had a project before where I successfully enabled it, but today after I reimported uimgui it started crashing as well. Nothing has changed in the settings.
I've switched straight to godot for now and it's much easier on 2d development. And support for imgui is easy.
You could try a commit based on #c849ffc, download it and put it directly into the project, don't use the url import, otherwise unity3d will download you the latest commit, in this version I managed to set the fonts without crashing. The crash seems to be related to the DemoWindows form size. If it is crashing before importing, then delete imgui.ini from the directory and don't display the demo windows window, just create your own.
As for configuring fonts, just use the Font Custom Initializer (ImGuilOptr) callback and add your method script with the ImGuilOptr parameter in it
Describe the bug Unity Editor crashes on play, expected font to load. Even if I load it the traditional way, the Icon font doesn't load in the texture.
To Reproduce Steps to reproduce the behavior:
UImGui
componentVersion/Branch of UImGui: Version: 4.1.0
Unity Version 2021.3.15f1
Render pipeline (Built-in)
Expected behavior Load icon font with normal font
Screenshots
Code
Crash Report