请帮我看看,为什么这样写显示不出中文?
已经把黑体放进了资源里并读进内存了
static void LoadCustomFont()
{
if (_customFontData.data == nullptr)
return;
for (int i = 0; i < _fontsCount; i++)
{
ImGuiIO& io = ImGui::GetIO();
auto newFont = io.Fonts->AddFontFromMemoryTTF(_customFontData.data, _customFontData.size, static_cast<float>((i + 1) * _fontSizeStep));
ImGui::GetIO().Fonts->GetGlyphRangesChineseFull();
if (newFont == nullptr)
return;
_fonts[i] = newFont;
}
_isCustomFontLoaded = true;
}
已经把黑体放进了资源里并读进内存了
static void LoadCustomFont()
{
if (_customFontData.data == nullptr)
return;
for (int i = 0; i < _fontsCount; i++)
{
ImGuiIO& io = ImGui::GetIO();
auto newFont = io.Fonts->AddFontFromMemoryTTF(_customFontData.data, _customFontData.size, static_cast<float>((i + 1) * _fontSizeStep));
ImGui::GetIO().Fonts->GetGlyphRangesChineseFull();
if (newFont == nullptr)
return;
_fonts[i] = newFont;
}
_isCustomFontLoaded = true;
}