Improved code style

This commit is contained in:
Willem Cazander 2022-02-11 13:48:55 +01:00
parent b52cc50c45
commit dc978272b4
4 changed files with 27 additions and 38 deletions

View file

@ -47,48 +47,27 @@ public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ<BaseGlyphSet> {
TONE_SCRIPT.BȍőnGlyphSetNumber36()), TONE_SCRIPT.BȍőnGlyphSetNumber36()),
GREEK(new BaseGlyphSetNumber("ō","α","β","γ","δ","ε","ϝ","ζ","η","θ"), GREEK(new BaseGlyphSetNumber("ō","α","β","γ","δ","ε","ϝ","ζ","η","θ"),
LATIN_BASIC.BȍőnGlyphSetNumber16(),
new BaseGlyphSetNumber("α","β","γ","δ","ε","ϝ","ζ","η","θ","ι","κ","λ","μ","ν","ξ","ο","π","ϟ","ρ","σ","τ","υ","φ","χ","ψ","ω","ϡ")),
GREEK_HEX(GREEK.BȍőnGlyphSetNumber10(),
new BaseGlyphSetNumber("ō","α","β","γ","δ","ε","ϝ","ζ","η","θ","ι","κ","λ","μ","ν","ξ"), new BaseGlyphSetNumber("ō","α","β","γ","δ","ε","ϝ","ζ","η","θ","ι","κ","λ","μ","ν","ξ"),
GREEK.BȍőnGlyphSetNumber36()), new BaseGlyphSetNumber("α","β","γ","δ","ε","ϝ","ζ","η","θ","ι","κ","λ","μ","ν","ξ","ο","π","ϟ","ρ","σ","τ","υ","φ","χ","ψ","ω","ϡ")),
CYRILLIC(new BaseGlyphSetNumber("Ф","А","В","Г","Д","Є","Ѕ","З","И","Ѳ"),
LATIN_BASIC.BȍőnGlyphSetNumber16(),
new BaseGlyphSetNumber("А","В","Г","Д","Є","Ѕ","З","И","Ѳ","І","К","Л","М","Н","Ѯ","Ѻ","П","Ч","Р","С","Т","Ѵ","Ф","Х","Ѱ","Ѿ","Ц")),
CYRILLIC_HEX(CYRILLIC.BȍőnGlyphSetNumber10(),
new BaseGlyphSetNumber("Ф","А","В","Г","Д","Є","Ѕ","З","И","Ѳ","҂"," ҈"," ҉","","",""),
CYRILLIC.BȍőnGlyphSetNumber36()),
BENGALI(new BaseGlyphSetNumber("","","","","","","","","",""), BENGALI(new BaseGlyphSetNumber("","","","","","","","","",""),
LATIN_BASIC.BȍőnGlyphSetNumber16(),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")),
BENGALI_HEX(BENGALI.BȍőnGlyphSetNumber10(),
new BaseGlyphSetNumber("","","","","","","","","","","জ্ঞ","ক্ষ","","","",""), new BaseGlyphSetNumber("","","","","","","","","","","জ্ঞ","ক্ষ","","","",""),
BENGALI.BȍőnGlyphSetNumber36()), new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")),
THAI(new BaseGlyphSetNumber("","","","","","","","","",""), THAI(new BaseGlyphSetNumber("","","","","","","","","",""),
LATIN_BASIC.BȍőnGlyphSetNumber16(),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")),
THAI_HEX(THAI.BȍőnGlyphSetNumber10(),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","",""), new BaseGlyphSetNumber("","","","","","","","","","","","","","","",""),
THAI.BȍőnGlyphSetNumber36()), new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")),
RUNIC(new BaseGlyphSetNumber("","","","","","","","","",""), RUNIC(new BaseGlyphSetNumber("","","","","","","","","",""),
LATIN_BASIC.BȍőnGlyphSetNumber16(),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")),
RUNIC_HEX(RUNIC.BȍőnGlyphSetNumber10(),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","",""), new BaseGlyphSetNumber("","","","","","","","","","","","","","","",""),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")),
RUNIC_TOPHEX(RUNIC.BȍőnGlyphSetNumber10(),
RUNIC.BȍőnGlyphSetNumber16().withAltGlyphSet(LATIN_TOP),
RUNIC.BȍőnGlyphSetNumber36()), RUNIC.BȍőnGlyphSetNumber36()),
RUNIC_TOPHEX(RUNIC_HEX.BȍőnGlyphSetNumber10(),
RUNIC_HEX.BȍőnGlyphSetNumber16().withAltGlyphSet(LATIN_TOP),
RUNIC_HEX.BȍőnGlyphSetNumber36()),
KOREAN(new BaseGlyphSetNumber("","","","","","","","","",""), KOREAN(new BaseGlyphSetNumber("","","","","","","","","",""),
LATIN_BASIC.BȍőnGlyphSetNumber16(),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")),
KOREAN_HEX(KOREAN.BȍőnGlyphSetNumber10(),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","",""), new BaseGlyphSetNumber("","","","","","","","","","","","","","","",""),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")),
KOREAN_TOPHEX(KOREAN.BȍőnGlyphSetNumber10(),
KOREAN.BȍőnGlyphSetNumber16().withAltGlyphSet(LATIN_TOP),
KOREAN.BȍőnGlyphSetNumber36()), KOREAN.BȍőnGlyphSetNumber36()),
KOREAN_TOPHEX(KOREAN_HEX.BȍőnGlyphSetNumber10(),
KOREAN_HEX.BȍőnGlyphSetNumber16().withAltGlyphSet(LATIN_TOP),
KOREAN_HEX.BȍőnGlyphSetNumber36()),
CHINA( CHINA(
new BaseGlyphSetNumber("","","","","","","","","",""), LATIN_BASIC.BȍőnGlyphSetNumber16(), null), new BaseGlyphSetNumber("","","","","","","","","",""), LATIN_BASIC.BȍőnGlyphSetNumber16(), null),
@ -101,6 +80,9 @@ public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ<BaseGlyphSet> {
JAPAN_FORMAL( JAPAN_FORMAL(
new BaseGlyphSetNumber("","","","","","","","","",""), LATIN_BASIC.BȍőnGlyphSetNumber16(), null), new BaseGlyphSetNumber("","","","","","","","","",""), LATIN_BASIC.BȍőnGlyphSetNumber16(), null),
CYRILLIC(new BaseGlyphSetNumber("Ф","А","В","Г","Д","Є","Ѕ","З","И","Ѳ"),
LATIN_BASIC.BȍőnGlyphSetNumber16(),
new BaseGlyphSetNumber("А","В","Г","Д","Є","Ѕ","З","И","Ѳ","І","К","Л","М","Н","Ѯ","Ѻ","П","Ч","Р","С","Т","Ѵ","Ф","Х","Ѱ","Ѿ","Ц")),
ARABIC(new BaseGlyphSetNumber("٠","١","٢","٣","٤","٥","٦","٧","٨","٩"), ARABIC(new BaseGlyphSetNumber("٠","١","٢","٣","٤","٥","٦","٧","٨","٩"),
LATIN_BASIC.BȍőnGlyphSetNumber16(), LATIN_BASIC.BȍőnGlyphSetNumber16(),
new BaseGlyphSetNumber("ا","ب","ج","د","ه","و","ز","ح","ط","ي","ك","ل","م","ن","س","ع","ف","ص","ق","ر","ش","ت","ث","خ","ذ","ض","ظ")), new BaseGlyphSetNumber("ا","ب","ج","د","ه","و","ز","ح","ط","ي","ك","ل","م","ن","س","ع","ف","ص","ق","ر","ش","ت","ث","خ","ذ","ض","ظ")),

View file

@ -6,6 +6,7 @@ import imgui.ImFontConfig;
import imgui.ImFontGlyphRangesBuilder; import imgui.ImFontGlyphRangesBuilder;
import imgui.ImGui; import imgui.ImGui;
import imgui.ImGuiIO; import imgui.ImGuiIO;
import imgui.ImGuiStyle;
import imgui.gl3.ImGuiImplGl3; import imgui.gl3.ImGuiImplGl3;
import imgui.glfw.ImGuiImplGlfw; import imgui.glfw.ImGuiImplGlfw;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@ -31,8 +32,14 @@ public class ImGuiSetup {
imGuiImp.init(windowHandle, true); imGuiImp.init(windowHandle, true);
imGuiGlImp.init("#version 140"); imGuiGlImp.init("#version 140");
ImGui.init(); ImGui.init();
initStyle();
ImGui.styleColorsLight(); }
private static void initStyle() {
ImGui.styleColorsDark();
ImGuiStyle style = ImGui.getStyle();
style.setWindowRounding(6f);
style.setScrollbarSize(22f);
} }
private static void initFonts(final ImGuiIO io) { private static void initFonts(final ImGuiIO io) {
@ -40,10 +47,10 @@ public class ImGuiSetup {
ImFontGlyphRangesBuilder fontBuilder = new ImFontGlyphRangesBuilder(); ImFontGlyphRangesBuilder fontBuilder = new ImFontGlyphRangesBuilder();
addRangeUnicodePlane0(fontBuilder); addRangeUnicodePlane0(fontBuilder);
final short[] glyphRanges = fontBuilder.buildRanges(); final short[] glyphRanges = fontBuilder.buildRanges();
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/code2000.ttf").readBytes(), 24, fontConfig, glyphRanges); io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/code2000.ttf").readBytes(), 22, fontConfig, glyphRanges);
fontConfig.setMergeMode(true); fontConfig.setMergeMode(true);
// note: merges 148 chars, just for 3 sub chars for SUBHEX, but still missing 2 chars from T12 alt1 clock // note: merges 148 chars, just for 3 sub chars for SUBHEX, but still missing 2 chars from T12 alt1 clock
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/free-sans.ttf").readBytes(), 24, fontConfig, glyphRanges); io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/free-sans.ttf").readBytes(), 22, fontConfig, glyphRanges);
fontConfig.destroy(); fontConfig.destroy();
} }

View file

@ -24,7 +24,7 @@ public class SystemBaseGlyphRenderer extends ImGuiRendererMain {
int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV; int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV;
ImGui.beginTable("base-part", 3, flags); ImGui.beginTable("base-part", 3, flags);
ImGui.tableSetupColumn("Language"); ImGui.tableSetupColumn("Script");
ImGui.tableSetupColumn("10Numbers"); ImGui.tableSetupColumn("10Numbers");
ImGui.tableSetupColumn("16Numbers"); ImGui.tableSetupColumn("16Numbers");
ImGui.tableHeadersRow(); ImGui.tableHeadersRow();

View file

@ -92,19 +92,19 @@ public class SystemBasePartRenderer extends ImGuiRendererMain {
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.TONE_SCRIPT)); ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.TONE_SCRIPT));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.KOREAN_HEX)); ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.KOREAN));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.LATIN_DTMF)); ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.LATIN_DTMF));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.TONE_SCRIPT)); ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.TONE_SCRIPT));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.KOREAN_HEX)); ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.KOREAN));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.LATIN_BASIC)); ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.LATIN_BASIC));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.TONE_SCRIPT)); ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.TONE_SCRIPT));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.KOREAN_HEX)); ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.KOREAN));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.LATIN_BASIC)); ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.LATIN_BASIC));
ImGui.tableNextColumn(); ImGui.tableNextColumn();