Added secondCharGlyphSet

This commit is contained in:
Willem 2022-02-03 23:16:25 +01:00
parent da248482cd
commit a7ad3fb463
3 changed files with 40 additions and 17 deletions

View file

@ -18,8 +18,24 @@ public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ<BaseGlyphSet> {
BENGALI(new BaseGlyphSetNumber10("","","","","","","","","","")), BENGALI(new BaseGlyphSetNumber10("","","","","","","","","","")),
SINHALA(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("˥","˦","˧","˨","˩","","","","",""), TONE_LETTER(new BaseGlyphSetNumber10("˥","˦","˧","˨","˩","","","","",""),
new BaseGlyphSetNumber16("˧˥˩","˧˩˥","˧˥˦","˧˩˨","˧˦˦","˧˨˨","˧˥˥","˧˩˩","˥˩˧","˩˥˧","˥˦˧","˩˨˧","˦˦˧","˨˨˧","˥˥˧","˩˩˧"), new BaseGlyphSetNumber16("˧˥˩","˧˩˥","˧˥˦","˧˩˨","˧˦˦","˧˨˨","˧˥˥","˧˩˩","˥˩˧","˩˥˧","˥˦˧","˩˨˧","˦˦˧","˨˨˧","˥˥˧","˩˩˧").withSecondCharGlyphSet(BaseGlyphSet.LATIN_SUPER),
new BaseGlyphSetNumber36("꜊꜈","꜊꜉","꜊꜋","꜊꜌","꜊꜍","꜊꜎","꜊꜏","꜊꜐","꜊꜑","˧˥","˧˦","˧˨","˧˩","˧꜒","˧꜓","˧꜔","˧꜕","˧꜖","꜏˥","꜏˦","꜏˧","꜏˨","꜏˩","꜏꜍","꜏꜎","꜏꜐","꜏꜑")), new BaseGlyphSetNumber36("꜊꜈","꜊꜉","꜊꜋","꜊꜌","꜊꜍","꜊꜎","꜊꜏","꜊꜐","꜊꜑","˧˥","˧˦","˧˨","˧˩","˧꜒","˧꜓","˧꜔","˧꜕","˧꜖","꜏˥","꜏˦","꜏˧","꜏˨","꜏˩","꜏꜍","꜏꜎","꜏꜐","꜏꜑")),
GREEK(new BaseGlyphSetNumber10("ō","α","β","γ","δ","ε","ϝ","ζ","η","θ"), GREEK(new BaseGlyphSetNumber10("ō","α","β","γ","δ","ε","ϝ","ζ","η","θ"),
@ -30,17 +46,6 @@ public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ<BaseGlyphSet> {
new BaseGlyphSetNumber16("","","","","","","","","","","","","","","",""), new BaseGlyphSetNumber16("","","","","","","","","","","","","","","",""),
new BaseGlyphSetNumber36("","","","","","","","","","","","","","","","","","","","","","","","","","","")), 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(" "), HEBREW(new BaseGlyphSetNumber10("אֶפֶס","אֶחָד","שְׁתַּיִם","שְׁלֹשָׁה","אַרְבַּע‎","חֲמִשָּׁה‎","שֵׁשׁ‎","שִׁבְעָה","שְׁמוֹנֶה","תִּשְׁעָה‎").withSeperator(" "),
new BaseGlyphSetNumber36("א","ב","ג","ד","ה","ו","ז","ח","ט","י","כ","ל","מ","נ","ס ","ע","פ","צ","ק","ר","ש","ת","ך","ם","ן","ף","ץ")), new BaseGlyphSetNumber36("א","ב","ג","ד","ה","ו","ז","ח","ט","י","כ","ל","מ","נ","ס ","ע","פ","צ","ק","ר","ש","ת","ך","ם","ן","ף","ץ")),
ARABIC(new BaseGlyphSetNumber10("٠","١","٢","٣","٤","٥","٦","٧","٨","٩"), ARABIC(new BaseGlyphSetNumber10("٠","١","٢","٣","٤","٥","٦","٧","٨","٩"),

View file

@ -7,6 +7,7 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
public final class BaseGlyphSetNumber16 implements BaseGlyphSetNumber { public final class BaseGlyphSetNumber16 implements BaseGlyphSetNumber {
private String charSeperator; private String charSeperator;
private BaseGlyphSet secondCharGlyphSet;
private final String char0; private final String char0;
private final String char1; private final String char1;
private final String char2; private final String char2;
@ -51,6 +52,11 @@ public final class BaseGlyphSetNumber16 implements BaseGlyphSetNumber {
return this; return this;
} }
public BaseGlyphSetNumber16 withSecondCharGlyphSet(BaseGlyphSet secondCharGlyphSet) {
this.secondCharGlyphSet = secondCharGlyphSet;
return this;
}
@Override @Override
public String BȍőnCharFor(int number) { public String BȍőnCharFor(int number) {
switch (number) { switch (number) {
@ -91,6 +97,10 @@ public final class BaseGlyphSetNumber16 implements BaseGlyphSetNumber {
} }
} }
public BaseGlyphSet BȍőnSecondCharGlyphSet() {
return secondCharGlyphSet;
}
@Override @Override
public String BȍőnCharSeperator() { public String BȍőnCharSeperator() {
return charSeperator; return charSeperator;

View file

@ -62,13 +62,21 @@ public interface BãßBȍőnPartʸᴰ<T extends BãßBȍőnPartʸᴰ<T>> extends
} else if (values.length <= 256) { } else if (values.length <= 256) {
buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor(BȍőnRangTelNul() >> 4)); buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor(BȍőnRangTelNul() >> 4));
buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharSeperator()); 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) { } else if (values.length <= 0xFFF+1) {
buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor((BȍőnRangTelNul() >> 8) & 0x0F)); buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor((BȍőnRangTelNul() >> 8) & 0x0F));
buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharSeperator()); buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharSeperator());
buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor((BȍőnRangTelNul() >> 4) & 0x0F)); BaseGlyphSet secondGlyphSet = glyphSet.BȍőnGlyphSetNumber16().BȍőnSecondCharGlyphSet();
buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharSeperator()); if (secondGlyphSet == null) {
buf.append(glyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor(BȍőnRangTelNul() & 0x0F)); 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 { } else {
throw new IllegalStateException("Can't handle more than 0xFFF values."); throw new IllegalStateException("Can't handle more than 0xFFF values.");
} }