Add freetype support

This commit is contained in:
SpaiR committed 2020-05-18 13:42:40 +03:00
1 parent 407d1b9cc4
commit 7f152431fa
7 files changed
+90 -1

No files matched your search

@@ -1,6 +1,7 @@
import imgui.ImFontAtlas;
import imgui.ImFontConfig;
import imgui.ImGui;
import imgui.ImGuiFreeType;
import imgui.ImGuiIO;
import imgui.callbacks.ImStrConsumer;
import imgui.callbacks.ImStrSupplier;
@@ -262,7 +263,7 @@ public final class ImGuiGlfwExample {
// ------------------------------
// Fonts from file/memory example
fontConfig.setRasterizerMultiply(1.2f); // This will make fonts a bit more readable
// fontConfig.setRasterizerMultiply(1.2f); // This will make fonts a bit more readable
// We can add new fonts directly from file
fontAtlas.addFontFromFileTTF("src/test/resources/DroidSans.ttf", 13, fontConfig);
@@ -276,6 +277,8 @@ public final class ImGuiGlfwExample {
fontConfig.destroy(); // After all fonts were added we don't need this config more
ImGuiFreeType.buildFontAtlas(fontAtlas, ImGuiFreeType.RasterizerFlags.LightHinting);
// Method initializes LWJGL3 renderer.
// This method SHOULD be called after you've initialized your ImGui configuration (fonts and so on).
// ImGui context should be created as well.