Skip to content

Commit

Permalink
[FIX] : fix font size for android
Browse files Browse the repository at this point in the history
  • Loading branch information
aiekick committed Feb 21, 2024
1 parent a9e1463 commit 8c91524
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions DemoDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ bool CustomDrawReadOnlyCheckBoxFileDialog::m_DrawFooter() {
return res;
}

void DemoDialog::init() {
void DemoDialog::init(const float& vFontSize) {
ImGui::CustomStyle::Init();
ImGui::SetPUSHID(4577);

Expand Down Expand Up @@ -319,12 +319,12 @@ void DemoDialog::init() {
});
#endif // USE_THUMBNAILS

ImGui::GetIO().Fonts->AddFontFromMemoryCompressedBase85TTF(FONT_ICON_BUFFER_NAME_RM, 15.0f);
ImGui::GetIO().Fonts->AddFontFromMemoryCompressedBase85TTF(FONT_ICON_BUFFER_NAME_RM, vFontSize);
static const ImWchar icons_ranges[] = {ICON_MIN_IGFD, ICON_MAX_IGFD, 0};
ImFontConfig icons_config;
icons_config.MergeMode = true;
icons_config.PixelSnapH = true;
ImGui::GetIO().Fonts->AddFontFromMemoryCompressedBase85TTF(FONT_ICON_BUFFER_NAME_IGFD, 15.0f, &icons_config, icons_ranges);
ImGui::GetIO().Fonts->AddFontFromMemoryCompressedBase85TTF(FONT_ICON_BUFFER_NAME_IGFD, vFontSize, &icons_config, icons_ranges);

// Our state

Expand Down
2 changes: 1 addition & 1 deletion DemoDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DemoDialog {
ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);

public:
void init();
void init(const float& vFontSize);
void display(const int32_t& vDisplayWidth, const int32_t& vDisplayHeight);
void manageGPU();
void unit();
Expand Down
2 changes: 1 addition & 1 deletion mainAndroid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void Init(struct android_app* app)
g_IniFilename = std::string(app->activity->internalDataPath) + "/imgui.ini";
io.IniFilename = g_IniFilename.c_str();

g_DemoDialog.init();
g_DemoDialog.init(50.0f);

// Setup Platform/Renderer backends
ImGui_ImplAndroid_Init(g_App->window);
Expand Down
2 changes: 1 addition & 1 deletion mainWinLinuxMacos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ int main(int, char**) {
ImGui_ImplOpenGL3_Init(glsl_version);

DemoDialog demoDialog;
demoDialog.init();
demoDialog.init(15.0f);

// Main loop
int32_t display_w = 0;
Expand Down

0 comments on commit 8c91524

Please sign in to comment.