VesCodes / ImGui

ImGui plugin for Unreal Engine
MIT License
107 stars 15 forks source link

Default font isn't packaged #7

Closed Wyverex42 closed 6 months ago

Wyverex42 commented 7 months ago

ImGuiContext.cpp references the TTF file directly like this:

const FString FontPath = FPaths::EngineContentDir() / TEXT("Slate/Fonts/Roboto-Regular.ttf");

This works fine in editor and non-staged builds, however as soon as you stage and/or package, ImGui reverts to the (quite ugly) default ImGui font.

One way to fix this is to add this line to your Build.cs file:

RuntimeDependencies.Add(Path.Combine(EngineDirectory, "Content/Slate/Fonts/Roboto-Regular.ttf"), StagedFileType.NonUFS);

Specifically, this needs to be of type NonUFS so that the file can be found using regular file operations, not just using the Unreal file system.

VesCodes commented 6 months ago

Hey hey, this should be fixed with https://github.com/VesCodes/ImGui/commit/e203fc7cb48d1a847a5186c22ee31a5c9c69177c