-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
貌似设置字体有点问题
#include "Global.h"
#include "AImGui.h"
#include "font_data.h"
#include
int main() {
android::AImGui imgui(android::AImGui::Options {
.renderType = android::AImGui::RenderType::RenderNative, .autoUpdateOrientation = true
});
ImGuiIO& io = ImGui::GetIO();
ImFont *font = io.Fonts->AddFontFromMemoryTTF(
(void*) _binary_font_ttf_start,
_binary_font_ttf_end - _binary_font_ttf_start,
24.0f,
nullptr,
io.Fonts->GetGlyphRangesChineseSimplifiedCommon()
);
IM_ASSERT(font != nullptr);
if (!imgui) {
LogInfo("[-] ImGui initialization failed");
return -1;
}
bool state = true;
std::thread processInputEventThread(
[&] {
while (state) {
imgui.ProcessInputEvent();
}
}
);
while (state) {
imgui.BeginFrame();
{
ImGui::Begin("Hello, world!", &state);
ImGui::Text("你好");
ImGui::End();
}
imgui.EndFrame();
}
if (processInputEventThread.joinable()) {
processInputEventThread.join();
}
return 0;
}
这是代码
用的是内存字体 内存字体测试过是没有问题的 在原版imgui是可以正常设置的
Metadata
Metadata
Assignees
Labels
No labels