From a7ad3fb463c508a166f3709db310829fc004d078 Mon Sep 17 00:00:00 2001 From: Willem Date: Thu, 3 Feb 2022 23:16:25 +0100 Subject: [PATCH] Added secondCharGlyphSet --- .../numberxd/base2t/glyph/BaseGlyphSet.java | 31 +++++++++++-------- .../base2t/glyph/BaseGlyphSetNumber16.java | 10 ++++++ .../numberxd/base2t/part/BãßBȍőnPartʸᴰ.java | 16 +++++++--- 3 files changed, 40 insertions(+), 17 deletions(-) diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/glyph/BaseGlyphSet.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/glyph/BaseGlyphSet.java index 053535ad..355bbeaf 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/glyph/BaseGlyphSet.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/glyph/BaseGlyphSet.java @@ -17,9 +17,25 @@ public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ { BURMESE(new BaseGlyphSetNumber10("\u1040","\u1041","\u1042","\u1043","\u1044","\u1045","\u1046","\u1047","\u1048","\u1049")), BENGALI(new BaseGlyphSetNumber10("০","১","২","৩","৪","৫","৬","৭","৮","৯")), SINHALA(new BaseGlyphSetNumber10("෦","෧","෨","෩","෪","෫","෬","෭","෮","෯")), - + + CHINA_FINANCIAL_T(new BaseGlyphSetNumber10("零","壹","貳","參","肆","伍","陸","柒","捌","玖")), + CHINA_FINANCIAL_S(new BaseGlyphSetNumber10("零","壹","贰","叁","肆","伍","陆","柒","捌","玖")), + CHINA_NORMAL_T(new BaseGlyphSetNumber10("零","一","二","三","四","五","六","七","八","九")), + CHINA_NORMAL_S(new BaseGlyphSetNumber10("〇","一","二","三","四","五","六","七","八","九"), + new BaseGlyphSetNumber16("氫","氦","鋰","鈹","硼","碳","氮","氧","氟","氖","鈉","鎂","鋁","矽","磷","硫")), + + LATIN_DTMF(new BaseGlyphSetNumber10("zero","one","two","three","four","five","six","seven","eight","nine").withSeperator(" "), + new BaseGlyphSetNumber16("1","2","3","A","4","5","6","B","7","8","9","C","*","0","#","D")), + LATIN_SUPER(new BaseGlyphSetNumber10("⁰","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹"), + new BaseGlyphSetNumber16("⁰","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹","ᵃ","ᵇ","ᶜ","ᵈ","ᵉ","ᶠ")), + LATIN_SUB(new BaseGlyphSetNumber10("₀","₁","₂","₃","₄","₅","₆","₇","₈","₉"), + new BaseGlyphSetNumber16("₀","₁","₂","₃","₄","₅","₆","₇","₈","₉","ₐ","₆","꜀","ₔ","ₑ","բ")), + LATIN_BASIC(new BaseGlyphSetNumber10("0","1","2","3","4","5","6","7","8","9"), + new BaseGlyphSetNumber16("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"), + new BaseGlyphSetNumber36("1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R")), + TONE_LETTER(new BaseGlyphSetNumber10("˥","˦","˧","˨","˩","꜒","꜓","꜔","꜕","꜖"), - new BaseGlyphSetNumber16("˧˥˩","˧˩˥","˧˥˦","˧˩˨","˧˦˦","˧˨˨","˧˥˥","˧˩˩","˥˩˧","˩˥˧","˥˦˧","˩˨˧","˦˦˧","˨˨˧","˥˥˧","˩˩˧"), + new BaseGlyphSetNumber16("˧˥˩","˧˩˥","˧˥˦","˧˩˨","˧˦˦","˧˨˨","˧˥˥","˧˩˩","˥˩˧","˩˥˧","˥˦˧","˩˨˧","˦˦˧","˨˨˧","˥˥˧","˩˩˧").withSecondCharGlyphSet(BaseGlyphSet.LATIN_SUPER), new BaseGlyphSetNumber36("꜊꜈","꜊꜉","꜊꜋","꜊꜌","꜊꜍","꜊꜎","꜊꜏","꜊꜐","꜊꜑","˧˥","˧˦","˧˨","˧˩","˧꜒","˧꜓","˧꜔","˧꜕","˧꜖","꜏˥","꜏˦","꜏˧","꜏˨","꜏˩","꜏꜍","꜏꜎","꜏꜐","꜏꜑")), GREEK(new BaseGlyphSetNumber10("ō","α","β","γ","δ","ε","ϝ","ζ","η","θ"), @@ -30,17 +46,6 @@ public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ { new BaseGlyphSetNumber16("ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅘ","ㅙ","ㅚ","ㅛ","ㅜ","ㅝ","ㅞ"), new BaseGlyphSetNumber36("ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ","ㄵ","ㄶ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ")), - LATIN_BASIC(new BaseGlyphSetNumber10("0","1","2","3","4","5","6","7","8","9"), - new BaseGlyphSetNumber16("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"), - new BaseGlyphSetNumber36("1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R")), - - LATIN_DTMF(new BaseGlyphSetNumber10("zero","one","two","three","four","five","six","seven","eight","nine").withSeperator(" "), - new BaseGlyphSetNumber16("1","2","3","A","4","5","6","B","7","8","9","C","*","0","#","D")), - LATIN_SUPER(new BaseGlyphSetNumber10("⁰","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹"), - new BaseGlyphSetNumber16("⁰","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹","ᵃ","ᵇ","ᶜ","ᵈ","ᵉ","ᶠ")), - LATIN_SUB(new BaseGlyphSetNumber10("₀","₁","₂","₃","₄","₅","₆","₇","₈","₉"), - new BaseGlyphSetNumber16("₀","₁","₂","₃","₄","₅","₆","₇","₈","₉","ₐ","₆","꜀","ₔ","ₑ","բ")), - HEBREW(new BaseGlyphSetNumber10("אֶפֶס","אֶחָד","שְׁתַּיִם","שְׁלֹשָׁה","אַרְבַּע‎","חֲמִשָּׁה‎","שֵׁשׁ‎","שִׁבְעָה","שְׁמוֹנֶה","תִּשְׁעָה‎").withSeperator(" "), new BaseGlyphSetNumber36("א","ב","ג","ד","ה","ו","ז","ח","ט","י","כ","ל","מ","נ","ס ","ע","פ","צ","ק","ר","ש","ת","ך","ם","ן","ף","ץ")), ARABIC(new BaseGlyphSetNumber10("٠","١","٢","٣","٤","٥","٦","٧","٨","٩"), diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/glyph/BaseGlyphSetNumber16.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/glyph/BaseGlyphSetNumber16.java index 5e76e1ff..967bc4cc 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/glyph/BaseGlyphSetNumber16.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/glyph/BaseGlyphSetNumber16.java @@ -7,6 +7,7 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; public final class BaseGlyphSetNumber16 implements BaseGlyphSetNumber { private String charSeperator; + private BaseGlyphSet secondCharGlyphSet; private final String char0; private final String char1; private final String char2; @@ -51,6 +52,11 @@ public final class BaseGlyphSetNumber16 implements BaseGlyphSetNumber { return this; } + public BaseGlyphSetNumber16 withSecondCharGlyphSet(BaseGlyphSet secondCharGlyphSet) { + this.secondCharGlyphSet = secondCharGlyphSet; + return this; + } + @Override public String BȍőnCharFor(int number) { switch (number) { @@ -91,6 +97,10 @@ public final class BaseGlyphSetNumber16 implements BaseGlyphSetNumber { } } + public BaseGlyphSet BȍőnSecondCharGlyphSet() { + return secondCharGlyphSet; + } + @Override public String BȍőnCharSeperator() { return charSeperator; diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/BãßBȍőnPartʸᴰ.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/BãßBȍőnPartʸᴰ.java index fa05968a..890a8212 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/BãßBȍőnPartʸᴰ.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/BãßBȍőnPartʸᴰ.java @@ -62,13 +62,21 @@ public interface BãßBȍőnPartʸᴰ> extends } else if (values.length <= 256) { buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor(BȍőnRangTelNul() >> 4)); buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharSeperator()); - buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor(BȍőnRangTelNul() & 0x0F)); + BaseGlyphSet secondGlyphSet = glyphSet.BȍőnGlyphSetNumber16().BȍőnSecondCharGlyphSet(); + if (secondGlyphSet == null) { + secondGlyphSet = glyphSet; + } + buf.append(secondGlyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor(BȍőnRangTelNul() & 0x0F)); } else if (values.length <= 0xFFF+1) { buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor((BȍőnRangTelNul() >> 8) & 0x0F)); buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharSeperator()); - buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor((BȍőnRangTelNul() >> 4) & 0x0F)); - buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharSeperator()); - buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor(BȍőnRangTelNul() & 0x0F)); + BaseGlyphSet secondGlyphSet = glyphSet.BȍőnGlyphSetNumber16().BȍőnSecondCharGlyphSet(); + if (secondGlyphSet == null) { + secondGlyphSet = glyphSet; + } + buf.append(secondGlyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor((BȍőnRangTelNul() >> 4) & 0x0F)); + buf.append(secondGlyphSet.BȍőnGlyphSetNumber16().BȍőnCharSeperator()); + buf.append(secondGlyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor(BȍőnRangTelNul() & 0x0F)); } else { throw new IllegalStateException("Can't handle more than 0xFFF values."); }