36 lines
1.3 KiB
Java
36 lines
1.3 KiB
Java
package gui.constants;
|
|
|
|
import gui.AssetManager;
|
|
import imgui.ImFont;
|
|
import imgui.ImFontConfig;
|
|
import imgui.ImFontGlyphRangesBuilder;
|
|
import imgui.ImGui;
|
|
|
|
public class Fonts {
|
|
|
|
public static ImFont ARIAL;
|
|
public static ImFont ARIAL_BOLD;
|
|
public static ImFont CHERI;
|
|
public static ImFont COMIC;
|
|
public static ImFont INFECTED;
|
|
public static ImFont EMOJIS;
|
|
|
|
private static final String baseDir = "";
|
|
|
|
public static void createFonts() {
|
|
ImFontGlyphRangesBuilder builder = new ImFontGlyphRangesBuilder();
|
|
builder.addRanges(ImGui.getIO().getFonts().getGlyphRangesDefault());
|
|
builder.addRanges(ImGui.getIO().getFonts().getGlyphRangesCyrillic());
|
|
|
|
ImFontConfig cfg = new ImFontConfig();
|
|
cfg.setGlyphRanges(builder.buildRanges());
|
|
|
|
COMIC = ImGui.getIO().getFonts().addFontFromMemoryTTF(AssetManager.getResource("comic.ttf"), 50.0f);
|
|
ARIAL_BOLD = ImGui.getIO().getFonts().addFontFromMemoryTTF(AssetManager.getResource("arial_bold.ttf"), 50.0f);
|
|
ARIAL = ImGui.getIO().getFonts().addFontFromMemoryTTF(AssetManager.getResource("arial.ttf"), 50.0f, cfg);
|
|
CHERI = ImGui.getIO().getFonts().addFontFromMemoryTTF(AssetManager.getResource("cheri.ttf"), 50.0f);
|
|
INFECTED = ImGui.getIO().getFonts().addFontFromMemoryTTF(AssetManager.getResource("INFECTED.ttf"), 50.0f);
|
|
}
|
|
|
|
}
|