Jelajahi Sumber

Demo: Display extra info from ImFontConfig in the font display

ocornut 9 tahun lalu
induk
melakukan
02ce1a2b32
1 mengubah file dengan 4 tambahan dan 1 penghapusan
  1. 4 1
      imgui_demo.cpp

+ 4 - 1
imgui_demo.cpp

@@ -246,7 +246,10 @@ void ImGui::ShowTestWindow(bool* p_opened)
                     ImGui::Text("Ascent: %f, Descent: %f, Height: %f", font->Ascent, font->Descent, font->Ascent - font->Descent);
                     ImGui::Text("Fallback character: '%c' (%d)", font->FallbackChar, font->FallbackChar);
                     for (int config_i = 0; config_i < font->ConfigDataCount; config_i++)
-                        ImGui::BulletText("Input %d: \'%s\'", config_i, font->ConfigData[config_i].Name);
+                    {
+                        ImFontConfig* cfg = &font->ConfigData[config_i];
+                        ImGui::BulletText("Input %d: \'%s\'\nOversample: (%d,%d), PixelSnapH: %d", config_i, cfg->Name, cfg->OversampleH, cfg->OversampleV, cfg->PixelSnapH);
+                    }
                     ImGui::TreePop();
                 }
                 ImGui::TreePop();