This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package gui;
|
||||
|
||||
import imgui.ImFont;
|
||||
import imgui.ImFontConfig;
|
||||
import imgui.ImFontGlyphRangesBuilder;
|
||||
import imgui.ImGui;
|
||||
|
||||
public class Fonts {
|
||||
@@ -10,14 +12,22 @@ public class Fonts {
|
||||
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());
|
||||
// builder.addRanges(ImGui.getIO().getFonts().getGlyphRangesChineseFull());
|
||||
ImFontConfig cfg = new ImFontConfig();
|
||||
cfg.setGlyphRanges(builder.buildRanges());
|
||||
|
||||
COMIC = ImGui.getIO().getFonts().addFontFromFileTTF(baseDir + "comic.ttf", 50.0f);
|
||||
ARIAL_BOLD = ImGui.getIO().getFonts().addFontFromFileTTF(baseDir + "arial_bold.ttf", 50.0f);
|
||||
ARIAL = ImGui.getIO().getFonts().addFontFromFileTTF(baseDir + "arial.ttf", 50.0f);
|
||||
CHERI = ImGui.getIO().getFonts().addFontFromFileTTF(baseDir + "cheri.ttf", 50.0f);
|
||||
ARIAL_BOLD = ImGui.getIO().getFonts().addFontFromFileTTF(baseDir + "arial_bold.ttf", 50.0f);
|
||||
ARIAL = ImGui.getIO().getFonts().addFontFromFileTTF(baseDir + "arial.ttf", 50.0f, cfg);
|
||||
CHERI = ImGui.getIO().getFonts().addFontFromFileTTF(baseDir + "cheri.ttf", 50.0f);
|
||||
INFECTED = ImGui.getIO().getFonts().addFontFromFileTTF(baseDir + "INFECTED.ttf", 50.0f);
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +88,9 @@ public class SudokuRenderer {
|
||||
}
|
||||
|
||||
public void render() {
|
||||
if (Options.Symboles == Symbols.Russian) {
|
||||
ImGui.pushFont(Fonts.ARIAL);
|
||||
}
|
||||
final float sudokuViewWidth = cellSize.x * doku.getWidth();
|
||||
final float displayWidth = ImGui.getIO().getDisplaySizeX();
|
||||
float offsetX = displayWidth / 2.0f - sudokuViewWidth / 2.0f;
|
||||
@@ -135,6 +138,9 @@ public class SudokuRenderer {
|
||||
ImGui.popStyleVar(2);
|
||||
renderPopup();
|
||||
ImGui.endChild();
|
||||
if (Options.Symboles == Symbols.Russian) {
|
||||
ImGui.popFont();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ public enum Symbols {
|
||||
|
||||
Numbers("Nombres", getNumbers()),
|
||||
Letters("Lettres", getLetters()),
|
||||
Emojis("Emojis", getEmojis());
|
||||
Russian("Cyrilique", getRussian()),
|
||||
Emojis("Emojis (Console uniquement)", getEmojis());
|
||||
|
||||
String displayName;
|
||||
List<String> symbols;
|
||||
@@ -49,6 +50,14 @@ public enum Symbols {
|
||||
return sym;
|
||||
}
|
||||
|
||||
private static List<String> getRussian() {
|
||||
List<String> sym = new ArrayList<>();
|
||||
for (int i = 0; i < 100; i++) {
|
||||
sym.add(new String(Character.toChars(0X0400 + i)));
|
||||
}
|
||||
return sym;
|
||||
}
|
||||
|
||||
private static List<String> getEmojis() {
|
||||
List<String> sym = new ArrayList<>();
|
||||
for (int i = 0; i < 100; i++) {
|
||||
|
||||
Reference in New Issue
Block a user