@@ -246,26 +246,29 @@ public String get() {
246
246
final ImFontAtlas fontAtlas = io .getFonts ();
247
247
final ImFontConfig fontConfig = new ImFontConfig (); // Natively allocated object, should be explicitly destroyed
248
248
249
+ // Glyphs could be added per-font as well as per config used globally like here
250
+ fontConfig .setGlyphRanges (fontAtlas .getGlyphRangesCyrillic ());
251
+
249
252
// Add a default font, which is 'ProggyClean.ttf, 13px'
250
253
fontAtlas .addFontDefault ();
251
254
252
255
// Fonts merge example
253
256
fontConfig .setMergeMode (true ); // When enabled, all fonts added with this config would be merged with the previously added font
254
257
fontConfig .setPixelSnapH (true );
255
258
256
- fontAtlas .addFontFromMemoryTTF (loadFromResources ("basis33.ttf" ), 16 , fontConfig , fontAtlas . getGlyphRangesCyrillic () );
259
+ fontAtlas .addFontFromMemoryTTF (loadFromResources ("basis33.ttf" ), 16 , fontConfig );
257
260
258
261
fontConfig .setMergeMode (false );
259
262
fontConfig .setPixelSnapH (false );
260
263
261
264
// Fonts from file/memory example
262
265
// 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 );
265
268
266
269
// 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 );
269
272
fontConfig .setName ("Roboto-Regular.ttf, 16px" ); // We can apply a new config value every time we add a new font
270
273
fontAtlas .addFontFromMemoryTTF (loadFromResources ("Roboto-Regular.ttf" ), 16 , fontConfig );
271
274
0 commit comments