Hide ImGui compat factories behind legacy XCUI interop
This commit is contained in:
@@ -12,8 +12,6 @@ constexpr float kUiFontSize = 18.0f;
|
||||
constexpr const char* kPrimaryUiFontPath = "C:/Windows/Fonts/segoeui.ttf";
|
||||
constexpr const char* kChineseFallbackFontPath = "C:/Windows/Fonts/msyh.ttc";
|
||||
|
||||
} // namespace
|
||||
|
||||
bool BuildDefaultXCUIEditorFontAtlas(::ImFontAtlas& atlas, ::ImFont*& outDefaultFont) {
|
||||
outDefaultFont = nullptr;
|
||||
atlas.Clear();
|
||||
@@ -55,6 +53,19 @@ bool BuildDefaultXCUIEditorFontAtlas(::ImFontAtlas& atlas, ::ImFont*& outDefault
|
||||
return outDefaultFont != nullptr;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
bool ConfigureDefaultXCUIEditorFontsForCurrentContext() {
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
ImFont* uiFont = nullptr;
|
||||
if (!BuildDefaultXCUIEditorFontAtlas(*io.Fonts, uiFont)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
io.FontDefault = uiFont;
|
||||
return io.FontDefault != nullptr;
|
||||
}
|
||||
|
||||
} // namespace XCUIBackend
|
||||
} // namespace Editor
|
||||
} // namespace XCEngine
|
||||
|
||||
Reference in New Issue
Block a user