Skip to content

Commit a0a5b65

Browse files
committed
Add cyrillic glyphs
1 parent d5b76bc commit a0a5b65

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

imgui-lwjgl3/src/test/java/ImGuiGlfwExample.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,26 +246,29 @@ public String get() {
246246
final ImFontAtlas fontAtlas = io.getFonts();
247247
final ImFontConfig fontConfig = new ImFontConfig(); // Natively allocated object, should be explicitly destroyed
248248

249+
// Glyphs could be added per-font as well as per config used globally like here
250+
fontConfig.setGlyphRanges(fontAtlas.getGlyphRangesCyrillic());
251+
249252
// Add a default font, which is 'ProggyClean.ttf, 13px'
250253
fontAtlas.addFontDefault();
251254

252255
// Fonts merge example
253256
fontConfig.setMergeMode(true); // When enabled, all fonts added with this config would be merged with the previously added font
254257
fontConfig.setPixelSnapH(true);
255258

256-
fontAtlas.addFontFromMemoryTTF(loadFromResources("basis33.ttf"), 16, fontConfig, fontAtlas.getGlyphRangesCyrillic());
259+
fontAtlas.addFontFromMemoryTTF(loadFromResources("basis33.ttf"), 16, fontConfig);
257260

258261
fontConfig.setMergeMode(false);
259262
fontConfig.setPixelSnapH(false);
260263

261264
// Fonts from file/memory example
262265
// We can add new fonts from the file system
263-
fontAtlas.addFontFromFileTTF("src/test/resources/Rubik-Regular.ttf", 13, fontConfig);
264-
fontAtlas.addFontFromFileTTF("src/test/resources/Rubik-Regular.ttf", 16, fontConfig);
266+
fontAtlas.addFontFromFileTTF("src/test/resources/Righteous-Regular.ttf", 14, fontConfig);
267+
fontAtlas.addFontFromFileTTF("src/test/resources/Righteous-Regular.ttf", 16, fontConfig);
265268

266269
// Or directly from the memory
267-
fontConfig.setName("Roboto-Regular.ttf, 13px"); // This name will be displayed in Style Editor
268-
fontAtlas.addFontFromMemoryTTF(loadFromResources("Roboto-Regular.ttf"), 13, fontConfig);
270+
fontConfig.setName("Roboto-Regular.ttf, 14px"); // This name will be displayed in Style Editor
271+
fontAtlas.addFontFromMemoryTTF(loadFromResources("Roboto-Regular.ttf"), 14, fontConfig);
269272
fontConfig.setName("Roboto-Regular.ttf, 16px"); // We can apply a new config value every time we add a new font
270273
fontAtlas.addFontFromMemoryTTF(loadFromResources("Roboto-Regular.ttf"), 16, fontConfig);
271274

39.9 KB
Binary file not shown.
-130 KB
Binary file not shown.

0 commit comments

Comments
 (0)