First poc unicode4d encoded chars created

This commit is contained in:
Willem Cazander 2022-02-19 16:40:47 +01:00
parent 3e40820a58
commit 9008ea2f22
21 changed files with 1145 additions and 111 deletions

View file

@ -31,6 +31,20 @@ public final class V009Tyte implements BaseNumberTyte<V009Tyte> {
values[2] = valueLow;
}
public short getValueNumber() {
short result = 0;
result += (getValue(T03PartTrit.PART_1).BȍőnRangTelNul() << 0);
result += (getValue(T03PartTrit.PART_2).BȍőnRangTelNul() << 3);
result += (getValue(T03PartTrit.PART_3).BȍőnRangTelNul() << 6);
return result;
}
public void setValueNumber(short number) {
setValue(T03PartTrit.PART_1, T08PartOctal.values()[(number >> 0) & 0b111]);
setValue(T03PartTrit.PART_2, T08PartOctal.values()[(number >> 3) & 0b111]);
setValue(T03PartTrit.PART_3, T08PartOctal.values()[(number >> 6) & 0b111]);
}
public T08PartOctal getValue(T03PartTrit part) {
return values[part.ordinal()];
}

View file

@ -36,6 +36,18 @@ public final class V018Tord implements BaseNumberTyte<V018Tord> {
setValue(T02PartBinary.PART_2, valueLow);
}
public int getValueNumber() {
int result = 0;
result += (getValue(T02PartBinary.PART_1).getValueNumber() << 0);
result += (getValue(T02PartBinary.PART_2).getValueNumber() << 9);
return result;
}
public void setValueNumber(int number) {
getValue(T02PartBinary.PART_1).setValueNumber((short) ((number >> 0) & 0b111111111));
getValue(T02PartBinary.PART_2).setValueNumber((short) ((number >> 9) & 0b111111111));
}
public V009Tyte getValue(T02PartBinary part) {
return values[part.ordinal()];
}

View file

@ -35,6 +35,18 @@ public final class V036Teger implements BaseNumberTyte<V036Teger> {
setValue(T02PartBinary.PART_2, valueLow);
}
public long getValueNumber() {
int result = 0;
result += (getValue(T02PartBinary.PART_1).getValueNumber() << 0);
result += (getValue(T02PartBinary.PART_2).getValueNumber() << 18);
return result;
}
public void setValueNumber(long number) {
getValue(T02PartBinary.PART_1).setValueNumber((int) ((number >> 0) & 0b111111111111111111));
getValue(T02PartBinary.PART_2).setValueNumber((int) ((number >> 18) & 0b111111111111111111));
}
public V018Tord getValue(T02PartBinary part) {
return values[part.ordinal()];
}

View file

@ -105,13 +105,13 @@ public enum BaseGlyphSet implements DefaultEnumSetᴶᴹˣ<BaseGlyphSet,BãßBȍ
new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")),
KOREAN(
new BaseGlyphSetNumber("","","","","","","","","",""),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","",""),
new BaseGlyphSetNumber("𝍠","𝍡","𝍢","𝍣","𝍤","𝍥","𝍦","𝍧","𝍨","𝍩","𝍪","𝍫","𝍬","𝍭","𝍮","𝍯"),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")),
CHINA(
new BaseGlyphSetNumber("","","","","","","","","",""),
null,
null),
KOREAN.BȍőnNumber16(),
new BaseGlyphSetNumber("𝌁","𝌂","𝌃","𝌄","𝌅","𝌆","𝌇","𝌈","𝌉","𝌊","𝌋","𝌌","𝌍","𝌎","𝌏","𝌐","𝌑","𝌒","𝌓","𝌔","𝌕","𝌖","𝌗","𝌘","𝌙","𝌚","𝌛")),
CHINA_FORMAL(
new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnChinaKey()))),
null,
@ -122,7 +122,7 @@ public enum BaseGlyphSet implements DefaultEnumSetᴶᴹˣ<BaseGlyphSet,BãßBȍ
null),
JAPAN(
CHINA.BȍőnNumber10(),
null,
KOREAN.BȍőnNumber16(),
null),
JAPAN_FORMAL(
new BaseGlyphSetNumber("","","","","","","","","",""),

View file

@ -21,6 +21,9 @@ import love.distributedrebirth.numberxd.base2t.part.T03PartTrit;
import love.distributedrebirth.numberxd.base2t.type.V006Tixte;
import love.distributedrebirth.numberxd.base2t.type.V009Tyte;
import love.distributedrebirth.numberxd.base2t.type.V018Tord;
import love.distributedrebirth.numberxd.base2t.type.V036Teger;
import love.distributedrebirth.numberxd.base2t.type.V072Tong;
import love.distributedrebirth.numberxd.base2t.type.V144Tocta;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class NumberXDModuleLoader implements X4OLanguageModuleLoader {
@ -61,13 +64,22 @@ public class NumberXDModuleLoader implements X4OLanguageModuleLoader {
ElementClass ec = null;
ec = createElementClass(language,"v006",V006Tixte.class,null,"Defines an V006Tixte number.");
configBãßBȍőnPartAttributes(language, ec, T02PartBinary.PART_1);
//configBãßBȍőnPartAttributes(language, ec, T02PartBinary.PART_1);
ec = createElementClass(language,"v009",V009Tyte.class,null,"Defines an V009Tyte number.");
configBãßBȍőnPartAttributes(language, ec, T03PartTrit.PART_1);
//configBãßBȍőnPartAttributes(language, ec, T03PartTrit.PART_1);
ec = createElementClass(language,"v018",V018Tord.class,null,"Defines an V018Tord number.");
configBãßBȍőnPartAttributes(language, ec, T02PartBinary.PART_1);
//configBãßBȍőnPartAttributes(language, ec, T02PartBinary.PART_1);
ec = createElementClass(language,"v036",V036Teger.class,null,"Defines an V036Teger number.");
//configBãßBȍőnPartAttributes(language, ec, T02PartBinary.PART_1);
ec = createElementClass(language,"v072",V072Tong.class,null,"Defines an V072Tong number.");
//configBãßBȍőnPartAttributes(language, ec, T02PartBinary.PART_1);
ec = createElementClass(language,"v072",V144Tocta.class,null,"Defines an V144Tocta number.");
//configBãßBȍőnPartAttributes(language, ec, T02PartBinary.PART_1);
namespace.addElementClass(ec);
}

View file

@ -4,7 +4,5 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://language.x4o.org/xml/ns/drivers http://language.x4o.org/xml/ns/drivers-1.0.xsd"
>
<!--
<defaultDriver language="numberxd"/>
-->
</drivers>

View file

@ -0,0 +1,20 @@
package love.distributedrebirth.unicode4d;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public enum CodePointCommandᶻᴰ {
NOP,
START, // PART_1 = modifier, PART_2 = direction
UNICODE,
NUMBER,
ADVANCE,
XY_MIN,
XY_MAX,
XY_COLOR, // PART_1 = 64 colors, PART_2 = 5 contrast levels
XY_ON_CURVE_START,
XY_OFF_CURVE_START,
XY_ON_CURVE,
XY_OFF_CURVE,
XY_SPACE
}

View file

@ -1,69 +1,68 @@
package love.distributedrebirth.unicode4d;
import love.distributedrebirth.numberxd.base2t.type.V072Tong;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.numberxd.base2t.part.T02PartBinary;
import love.distributedrebirth.numberxd.base2t.type.V036Teger;
public class CodePointᶻᴰ {
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public enum CodePointᶻᴰ {
private final V072Tong value;
INSTANCE;
public CodePointᶻᴰ(V072Tong value) {
this.value = value;
private static final int MASK_CMD = 0b111000000000000000;
private static final int MASK_ARGU = 0b000111111111111111;
public static final int MODIFIER_STRIKE_HIGH = 0b000000000000000001;
public static final int MODIFIER_STRIKE_MID = 0b000000000000000010;
public static final int MODIFIER_STRIKE_LOW = 0b000000000000000100;
public static final int MODIFIER_STRIKE_UNDER = 0b000000000000001000;
public static final int MODIFIER_ITALIC_LR = 0b000000000000010000;
public static final int MODIFIER_ITALIC_RL = 0b000000000000100000;
public static final int MODIFIER_SCRIPT_TOP = 0b000000000001000000;
public static final int MODIFIER_SCRIPT_SUB = 0b000000000010000000;
public static final int MODIFIER_ENVELOP = 0b000000000100000000;
public int getArgument(V036Teger teger, T02PartBinary part) {
return teger.getValue(part).getValueNumber() & MASK_ARGU;
}
enum TegerSplitMode {
NOP,
UNICODE, // + direction
ADVANCE,
XY_SET,
XY_MIN,
XY_MAX,
NUMBER,
MOD_COLOR, // color = 4b+2b + mod 2x2b darker
// MODIFIER;
// STRIKE_HIGH,
// STRIKE_MID,
// STRIKE_LOW,
// STRIKE_UNDER,
// ITALIC_LR,
// ITALIC_RL,
// SCRIPT_TOP,
// SCRIPT_SUB,
// INVISIBLE
FREE_B4, // envelop
FREE_B3,
FREE_B2,
FREE_B1,
FREE_A4,
FREE_A3,
FREE_A2,
FREE_A1,
public void setArgument(V036Teger teger, T02PartBinary part, int number) {
int value = teger.getValue(part).getValueNumber();
teger.getValue(part).setValueNumber((value & MASK_CMD) + (number & MASK_ARGU));
}
/**
* 72 bits (8x tyte)
*
*
* V036Teger is point: x+y of 4 digits + sign + boolean
* x=2xtyte=tord=18bit
* y=tord-3=15b + mode
*
* V072Tong - 0
* cmd0 unicode="011000"
* cmd1 advanceWidth="183" leftSideBearing="10"
*
* V072Tong - 1
* cmd0 xMin="10" yMin="480"
* cmd1 xMax="134" yMax="616"
*
* V072Tong - 2
* cmd0 x="10" y="548" onCurve="true" start
* cmd1 color select
*
* V072Tong - 3
* cmd0 x="10" y="548" onCurve="true" end
* cmd1 nop padding.
*/
public int getArgumentUnicode(V036Teger teger) {
int unicode = 0;
unicode += teger.getValue(T02PartBinary.PART_1).getValueNumber();
unicode += teger.getValue(T02PartBinary.PART_2).getValueNumber() << 18;
return unicode;
}
public void setArgumentUnicode(V036Teger teger, int unicode) {
teger.getValue(T02PartBinary.PART_1).setValueNumber(unicode);
teger.getValue(T02PartBinary.PART_2).setValueNumber(unicode >> 18);
}
public long getArgumentNumber(V036Teger teger) {
return teger.getValueNumber();
}
public void setArgumentNumber(V036Teger teger, long number) {
teger.setValueNumber(number);
}
public CodePointCommandᶻᴰ getCommand(V036Teger teger) {
int mode = 0;
mode += ((teger.getValue(T02PartBinary.PART_1).getValueNumber() >> 15) & 0b111) << 0;
mode += ((teger.getValue(T02PartBinary.PART_2).getValueNumber() >> 15) & 0b111) << 3;
return CodePointCommandᶻᴰ.values()[mode];
}
public void setCommand(V036Teger teger, CodePointCommandᶻᴰ command) {
int mode = command.ordinal();
int value1 = teger.getValue(T02PartBinary.PART_1).getValueNumber();
int value2 = teger.getValue(T02PartBinary.PART_2).getValueNumber();
teger.getValue(T02PartBinary.PART_1).setValueNumber((value1 & MASK_ARGU) + (((mode >> 0) & 0b111) << 15));
teger.getValue(T02PartBinary.PART_2).setValueNumber((value2 & MASK_ARGU) + (((mode >> 3) & 0b111) << 15));
}
}

View file

@ -1,5 +1,50 @@
package love.distributedrebirth.unicode4d;
import java.util.ArrayList;
import java.util.List;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.numberxd.base2t.part.T02PartBinary;
import love.distributedrebirth.numberxd.base2t.type.V036Teger;
import love.distributedrebirth.numberxd.base2t.type.V072Tong;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class Stringᶻᴰ {
private List<V072Tong> string;
public Stringᶻᴰ(List<V072Tong> tongs) {
this.string = tongs;
}
public int codePointSize() {
return string.size() * 2;
}
public V036Teger getCodePointByIndex(int index) {
V072Tong tong = string.get(index >> 1);
if ((index & 1) == 0) {
return tong.getValue(T02PartBinary.PART_1);
} else {
return tong.getValue(T02PartBinary.PART_2);
}
}
public int charSize() {
int result = 0;
for (V072Tong points:string) {
CodePointCommandᶻᴰ cmd = CodePointᶻᴰ.INSTANCE.getCommand(points.getValue(T02PartBinary.PART_1));
if (cmd == CodePointCommandᶻᴰ.START) {
result++;
}
}
return result;
}
public Stringᶻᴰ concat(Stringᶻᴰ argu) {
List<V072Tong> data = new ArrayList<>(string.size());
data.addAll(string);
data.addAll(argu.string);
return new Stringᶻᴰ(data);
}
}

View file

@ -0,0 +1,35 @@
package love.distributedrebirth.unicode4d.base;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class UnicodePlane {
private Map<String, UnicodePlaneBase> planes = new HashMap<>();
public UnicodePlane() {
}
public UnicodePlaneBase getPlaneByName(String name) {
return planes.get(name);
}
public Collection<UnicodePlaneBase> getPlanes() {
return planes.values();
}
public void setPlanes(List<UnicodePlaneBase> planes) {
for (UnicodePlaneBase plane:planes) {
addPlane(plane);
}
}
public void addPlane(UnicodePlaneBase plane) {
this.planes.put(plane.getName(), plane);
}
}

View file

@ -0,0 +1,44 @@
package love.distributedrebirth.unicode4d.base;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class UnicodePlaneBase {
private String name;
private Map<String, UnicodePlaneBaseGlyph> baseGlyphs = new HashMap<>();
public UnicodePlaneBase() {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public UnicodePlaneBaseGlyph getBaseGlyphByUnicode(String unicode) {
return baseGlyphs.get(unicode);
}
public Collection<UnicodePlaneBaseGlyph> getBaseGlyphs() {
return baseGlyphs.values();
}
public void setBaseGlyphs(List<UnicodePlaneBaseGlyph> baseGlyphs) {
for (UnicodePlaneBaseGlyph baseGlyph:baseGlyphs) {
addBaseGlyph(baseGlyph);
}
}
public void addBaseGlyph(UnicodePlaneBaseGlyph baseGlyph) {
this.baseGlyphs.put(baseGlyph.getUnicode(),baseGlyph);
}
}

View file

@ -0,0 +1,64 @@
package love.distributedrebirth.unicode4d.base;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.numberxd.base2t.Base2Terminator;
import love.distributedrebirth.numberxd.base2t.type.V072Tong;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class UnicodePlaneBaseGlyph {
private String unicode;
private List<V072Tong> glyph = new ArrayList<>();
public UnicodePlaneBaseGlyph() {
}
public String getUnicode() {
return unicode;
}
public void setUnicode(String unicode) {
this.unicode = unicode;
}
public List<V072Tong> getGlyph() {
return glyph;
}
public void setGlyph(List<V072Tong> glyph) {
this.glyph = glyph;
}
public void addGlyph(V072Tong glyph) {
this.glyph.add(glyph);
}
public String getBase64() {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
Base2Terminator.INSTANCE.Bãß2WriteTong(glyph, baos);
} catch (IOException e) {
throw new RuntimeException(e);
}
return Base64.getEncoder().encodeToString(baos.toByteArray());
}
public void setBase64(String base64) {
byte[] decodedBytes = Base64.getDecoder().decode(base64);
ByteArrayInputStream bais = new ByteArrayInputStream(decodedBytes);
try {
List<V072Tong> result = new ArrayList<>();
Base2Terminator.INSTANCE.Bãß2ReadTong(bais, result);
glyph = result;
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}

View file

@ -0,0 +1,27 @@
package love.distributedrebirth.unicode4d.base;
import org.x4o.xml.X4ODriver;
import org.x4o.xml.X4ODriverManager;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class UnicodePlaneDriver extends X4ODriver<UnicodePlane> {
static final public String LANGUAGE_NAME = "unicode-plane";
static final public String[] LANGUAGE_VERSIONS = new String[]{X4ODriver.DEFAULT_LANGUAGE_VERSION};
@Override
public String getLanguageName() {
return LANGUAGE_NAME;
}
@Override
public String[] getLanguageVersions() {
return LANGUAGE_VERSIONS;
}
static public UnicodePlaneDriver newInstance() {
return (UnicodePlaneDriver)X4ODriverManager.getX4ODriver(LANGUAGE_NAME);
}
}

View file

@ -0,0 +1,373 @@
package love.distributedrebirth.unicode4d.base;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public enum UnicodePlaneᶻᴰ {
// =========== PLANE 0
BASIC_LATIN(0x0000, 0x007F),
LATIN1_SUPPLEMENT(0x080,0x00FF),
LATIN_EXTENDED_A(0x0100,0x017F),
LATIN_EXTENDED_B(0x0180,0x024F),
IPA_EXTENSIONS(0x0250,0x02AF),
SPACING_MODIFIER_LETTERS(0x02B0,0x02FF),
COMBINING_DIACRITICAL_MARKS(0x0300,0x036F),
GREEK_AND_COPTIC(0x0370,0x03FF),
CYRILLIC(0x0400,0x04FF),
CYRILLIC_SUPPLEMENT(0x0500,0x052F),
ARMENIAN(0x0530,0x058F),
HEBREW(0x0590,0x05FF),
ARABIC(0x0600,0x06FF),
SYRIAC(0x0700,0x074F),
ARABIC_SUPPLEMENT(0x0750,0x077F),
THAANA(0x0780,0x07BF),
NKO(0x07C0,0x07FF),
SAMARITAN(0x0800,0x083F),
MANDAIC(0x0840,0x085F),
SYRIAC_SUPPLEMENT(0x0860,0x086F),
ARABIC_EXTENDED_B(0x0870,0x089F),
ARABIV_EXTENDED_A(0x08A0,0x08FF),
DEVANAGARI(0x0900,0x097F),
BENGALI(0x0980,0x09FF),
GURMUKHI(0x0A00,0x0A7F),
GUJARATI(0x0A80,0x0AFF),
ORIYA(0x0B00,0x0B7F),
TAMIL(0x0B80,0x0BFF),
TELUGU(0x0C00,0x0C7F),
KANNADA(0x0C80,0x0CFF),
MALAYALAM(0x0D00,0x0D7F),
SINHALA(0x0D80,0x0DFF),
THAI(0x0E00,0x0E7F),
LAO(0x0E80,0x0EFF),
TIBETAN(0x0F00,0x0FFF),
MYANMAR(0x1000,0x109F),
GEORGIAN(0x10A0,0x10FF),
HANGUL_JAMO(0x1100,0x11FF),
ETHIOPIC(0x1200,0x137F),
ETHIOPIC_SUPPLEMENT(0x1380,0x139F),
CHEROKEE(0x13A0,0x13FF),
UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS(0x1400,0x167F),
OGHAM(0x1680,0x169F),
RUNIC(0x16A0,0x16FF),
TAGALOG (0x1700,0x171F),
HANUNOO (0x1720,0x173F),
BUHID (0x1740,0x175F),
TAGBANWA (0x1760,0x177F),
KHMER (0x1780,0x17FF),
MONGOLIAN (0x1800,0x18AF),
UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED(0x18B0,0x18FF),
LIMBU(0x1900,0x194F),
TAI_LE (0x1950,0x197F),
NEW_TAI_LUE (0x1980,0x19DF),
KHMER_SYMBOLS (0x19E0,0x19FF),
BUGINESE (0x1A00,0x1A1F),
TAI_THAM (0x1A20,0x1AAF),
COMBINING_DIACRITICAL_MARKS_EXTENDED(0x1AB0,0x1AFF),
BALINESE (0x1B00,0x1B7F),
SUNDANESE (0x1B80,0x1BBF),
BATAK (0x1BC0,0x1BFF),
LEPCHA (0x1C00,0x1C4F),
OL_CHIKI (0x1C50,0x1C7F),
CYRILLIC_EXTENDED_C (0x1C80,0x1C8F),
GEORGIAN_EXTENDED (0x1C90,0x1CBF),
SUNDANESE_SUPPLEMENT (0x1CC0,0x1CCF),
VEDIC_EXTENSIONS (0x1CD0,0x1CFF),
PHONETIC_EXTENSIONS (0x1D00,0x1D7F),
PHONETIC_EXTENSIONS_SUPPLEMENT (0x1D80,0x1DBF),
COMBINING_DIACRITICAL_MARKS_SUPPLEMENT (0x1DC0,0x1DFF),
LATIN_EXTENDED_ADDITINAL (0x1E00,0x1EFF),
GREEK_EXTENDED (0x1F00,0x1FFF),
GENERAL_PUNCTUATION (0x2000,0x206F),
SUPERSCRIPTS_AND_SUBSCRIPTS (0x2070,0x209F),
CURRENCY_SYMBOLS (0x20A0,0x20CF),
COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS (0x20D0,0x20FF),
LETTERLIKE_SYMBOLS (0x2100,0x214F),
NUMBER_FORMS (0x2150,0x218F),
ARROWS (0x2190,0x21FF),
MATHEMATICAL_OPERATORS (0x2200,0x22FF),
MISCELLANEOUS_TECHNICAL (0x2300,0x23FF),
CONTROL_PICTURES (0x2400,0x243F),
OPTICAL_CHARACTER_RECOGNITION (0x2440,0x245F),
ENCLOSED_ALPHANUMERICS (0x2460,0x24FF),
BOX_DRAWING (0x2500,0x257F),
BLOCK_ELEMENTS (0x2580,0x259F),
GEOMETRIC_SHAPES (0x25A0,0x25FF),
MISCELLANEOUS_SYMBOLS (0x2600,0x26FF),
DINGBATS (0x2700,0x27BF),
MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A (0x27C0,0x27EF),
SUPPLEMENTAL_ARROWS_A (0x27F0,0x27FF),
BRAILLE_PATTERNS (0x2800,0x28FF),
SUPPLEMENTAL_ARROWS_B (0x2900,0x297F),
MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B (0x2980,0x29FF),
SUPPLEMENTAL_MATHEMATICAL_OPERATORS (0x2A00,0x2AFF),
MISCELLANEOUS_SYMBOLS_AND_ARROWS (0x2B00,0x2BFF),
GLAGOLITIC (0x2C00,0x2C5F),
LATIN_EXTENDED_C (0x2C60,0x2C7F),
COPTIC (0x2C80,0x2CFF),
GEORGIAN_SUPPLEMENT (0x2D00,0x2D2F),
TIFINAGH (0x2D30,0x2D7F),
ETHIOPIC_EXTENDED (0x2D80,0x2DDF),
CYRILLIC_EXTENDED_A (0x2DE0,0x2DFF),
SUPPLEMENTAL_PUNCTUATION (0x2E00,0x2E7F),
CJK_RADICALS_SUPPLEMENT (0x2E80,0x2EFF),
KANGXI_RADICALS (0x2F00,0x2FDF),
IDEOGRAPHIC_DESCRIPTION_CHARACTERS (0x2FF0,0x2FFF),
CJK_SYMBOLS_AND_PUNCTUATION (0x3000,0x303F),
HIRAGANA (0x3040,0x309F),
KATAKANA (0x30A0,0x30FF),
BOPOMOFO (0x3100,0x312F),
HANGUL_COMPATIBILITY_JAMO (0x3130,0x318F),
KANBUN (0x3190,0x319F),
BOPOMOFO_EXTENDED (0x31A0,0x31BF),
CJK_STROKES (0x31C0,0x31EF),
KATAKANA_PHONETIC_EXTENSIONS (0x31F0,0x31FF),
ENCLOSED_CJK_LETTERS_AND_MONTHS (0x3200,0x32FF),
CJK_COMPATIBILITY (0x3300,0x33FF),
CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A (0x3400,0x4DBF),
YIJING_HEXAGRAM_SYMBOLS (0x4DC0,0x4DFF),
CJK_UNIFIED_IDEOGRAPHS (0x4E00,0x9FFF),
YI_SYLLABLES (0xA000,0xA48F),
YI_RADICALS (0xA490,0xA4CF),
LISU (0xA4D0,0xA4FF),
VAI (0xA500,0xA63F),
CYRILLIC_EXTENDED_B (0xA640,0xA69F),
BAMUM (0xA6A0,0xA6FF),
MODIFIER_TONE_LETTERS (0xA700,0xA71F),
LATIN_EXTENDED_D (0xA720,0xA7FF),
SYLOTI_NAGRI (0xA800,0xA82F),
COMMON_INDIC_NUMBER_FORMS (0xA830,0xA83F),
PHAGS_PA (0xA840,0xA87F),
SAURASHTRA (0xA880,0xA8DF),
DEVANAGARI_EXTENDED (0xA8E0,0xA8FF),
KAYAH_LI (0xA900,0xA92F),
REJANG (0xA930,0xA95F),
HANGUL_JAMO_EXTENDED_A (0xA960,0xA97F),
JAVANESE (0xA980,0xA9DF),
MYANMAR_EXTENDED_B (0xA9E0,0xA9FF),
CHAM (0xAA00,0xAA5F),
MYANMAR_EXTENDED_A (0xAA60,0xAA7F),
TAI_VIET (0xAA80,0xAADF),
MEETEI_MAYEK_EXTENSIONS (0xAAE0,0xAAFF),
ETHIOPIC_EXTENDED_A (0xAB00,0xAB2F),
LATIN_EXTENDED_E (0xAB30,0xAB6F),
CHEROKEE_SUPPLEMENT (0xAB70,0xABBF),
MEETEI_MAYEK (0xABC0,0xABFF),
HANGUL_SYLLABLES (0xAC00,0xD7AF),
HANGUL_JAMO_EXTENDED_B (0xD7B0,0xD7FF),
HIGH_SURROGATES (0xD800,0xDB7F),
HIGH_PRIVATE_USE_SURROGATES (0xDB80,0xDBFF),
LOW_SURROGATES (0xDC00,0xDFFF),
PRIVATE_USE_AREA (0xE000,0xF8FF),
CJK_COMPATIBILITY_IDEOGRAPHS (0xF900,0xFAFF),
ALPHABETIC_PRESENTATION_FORMS (0xFB00,0xFB4F),
ARABIC_PRESENTATION_FORMS_A (0xFB50,0xFDFF),
VARIATION_SELECTORS (0xFE00,0xFE0F),
VERTICAL_FORMS (0xFE10,0xFE1F),
COMBINING_HALF_MARKS (0xFE20,0xFE2F),
CJK_COMPATIBILITY_FORMS (0xFE30,0xFE4F),
SMALL_FORM_VARIANTS (0xFE50,0xFE6F),
ARABIC_PRESENTATION_FORMS_B (0xFE70,0xFEFF),
HALFWIDTH_AND_FULLWIDTH_FORMS (0xFF00,0xFFEF),
SPECIALS (0xFFF0,0xFFFF),
// =========== PLANE 1
LINEAR_B_SYLLABARY (0x10000,0x1007F),
LINEAR_B_IDEOGRAMS (0x10080,0x100FF),
AEGEAN_NUMBERS (0x10100,0x1013F),
ANCIENT_GREEK_NUMBERS (0x10140,0x1018F),
ANCIENT_SYMBOLS (0x10190,0x101CF),
PHAISTOS_DISC (0x101D0,0x101FF),
LYCIAN (0x10280,0x1029F),
CARIAN (0x102A0,0x102DF),
COPTIC_EPACT_NUMBERS (0x102E0,0x102FF),
OLD_ITALIC (0x10300,0x1032F),
GOTHIC (0x10330,0x1034F),
OLD_PERMIC (0x10350,0x1037F),
UGARITIC (0x10380,0x1039F),
OLD_PERSIAN (0x103A0,0x103DF),
DESERET (0x10400,0x1044F),
SHAVIAN (0x10450,0x1047F),
OSMANYA (0x10480,0x104AF),
OSAGE (0x104B0,0x104FF),
ELBASAN (0x10500,0x1052F),
CAUCASIAN_ALBANIAN (0x10530,0x1056F),
VITHKUQI (0x10570,0x105BF),
LINEAR_A (0x10600,0x1077F),
LATIN_EXTENDED_F (0x10780,0x107BF),
CYPRIOT_SYLLABARY (0x10800,0x1083F),
IMPERIAL_ARAMAIC (0x10840,0x1085F),
PALMYRENE (0x10860,0x1087F),
NABATAEAN (0x10880,0x108AF),
HATRAN (0x108E0,0x108FF),
PHOENICIAN (0x10900,0x1091F),
LYDIAN (0x10920,0x1093F),
MEROITIC_HIEROGLYPHS (0x10980,0x1099F),
MEROITIC_CURSIVE (0x109A0,0x109FF),
KHAROSHTHI (0x10A00,0x10A5F),
OLD_SOUTH_ARABIAN (0x10A60,0x10A7F),
OLD_NORTH_ARABIAN (0x10A80,0x10A9F),
MANICHAEAN (0x10AC0,0x10AFF),
AVESTAN (0x10B00,0x10B3F),
INSCRIPTIONAL_PARTHIAN (0x10B40,0x10B5F),
INSCRIPTIONAL_PAHLAVI (0x10B60,0x10B7F),
PSALTER_PAHLAVI (0x10B80,0x10BAF),
OLD_TURKIC (0x10C00,0x10C4F),
OLD_HUNGARIAN (0x10C80,0x10CFF),
HANIFI_ROHINGYA (0x10D00,0x10D3F),
RUMI_NUMERAL_SYMBOLS (0x10E60,0x10E7F),
YEZIDI (0x10E80,0x10EBF),
OLD_SOGDIAN (0x10F00,0x10F2F),
SOGDIAN (0x10F30,0x10F6F),
OLD_UYGHUR (0x10F70,0x10FAF),
CHORASMIAN (0x10FB0,0x10FDF),
ELYMAIC (0x10FE0,0x10FFF),
BRAHMI (0x11000,0x1107F),
KAITHI (0x11080,0x110CF),
SORA_SOMPENG (0x110D0,0x110FF),
CHAKMA (0x11100,0x1114F),
MAHAJANI (0x11150,0x1117F),
SHARADA (0x11180,0x111DF),
SINHALA_ARCHAIC_NUMBERS (0x111E0,0x111FF),
KHOJKI (0x11200,0x1124F),
MULTANI (0x11280,0x112AF),
KHUDAWADI (0x112B0,0x112FF),
GRANTHA (0x11300,0x1137F),
NEWA (0x11400,0x1147F),
TIRHUTA (0x11480,0x114DF),
SIDDHAM (0x11580,0x115FF),
MODI (0x11600,0x1165F),
MONGOLIAN_SUPPLEMENT (0x11660,0x1167F),
TAKRI (0x11680,0x116CF),
AHOM (0x11700,0x1174F),
DOGRA (0x11800,0x1184F),
WARANG_CITI (0x118A0,0x118FF),
DIVES_AKURU (0x11900,0x1195F),
NANDINAGARI (0x119A0,0x119FF),
ZANABAZAR_SQUARE (0x11A00,0x11A4F),
SOYOMBO (0x11A50,0x11AAF),
UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED_A (0X11AB0,0X11ABF),
PAU_CIN_HAU (0X11AC0,0X11AFF),
BHAIKSUKI (0X11C00,0X11C6F),
MARCHEN (0X11C70,0X11CBF),
MASARAM_GONDI (0X11D00,0X11D5F),
GUNJALA_GONDI (0X11D60,0X11DAF),
MAKASAR (0X11EE0,0X11EFF),
LISU_SUPPLEMENT (0X11FB0,0X11FBF),
TAMIL_SUPPLEMENT (0X11FC0,0X11FFF),
CUNEIFORM (0X12000,0X123FF),
CUNEIFORM_NUMBERS_AND_PUNCTUATION (0X12400,0X1247F),
EARLY_DYNASTIC_CUNEIFORM (0X12480,0X1254F),
CYPRO_MINOAN (0X12F90,0X12FFF),
EGYPTIAN_HIEROGLYPHS (0X13000,0X1342F),
EGYPTIAN_HIEROGLYPH_FORMAT_CONTROLS (0X13430,0X1343F),
ANATOLIAN_HIEROGLYPHS (0X14400,0X1467F),
BAMUM_SUPPLEMENT (0X16800,0X16A3F),
MRO (0X16A40,0X16A6F),
TANGSA (0X16A70,0X16ACF),
BASSA_VAH (0X16AD0,0X16AFF),
PAHAWH_HMONG (0X16B00,0X16B8F),
MEDEFAIDRIN (0X16E40,0X16E9F),
MIAO (0X16F00,0X16F9F),
IDEOGRAPHIC_SYMBOLS_AND_PUNCTUATION (0X16FE0,0X16FFF),
TANGUT (0X17000,0X187FF),
TANGUT_COMPONENTS (0X18800,0X18AFF),
KHITAN_SMALL_SCRIPT (0X18B00,0X18CFF),
TANGUT_SUPPLEMENT (0X18D00,0X18D7F),
KANA_EXTENDED_B (0X1AFF0,0X1AFFF),
KANA_SUPPLEMENT (0X1B000,0X1B0FF),
KANA_EXTENDED_A (0X1B100,0X1B12F),
SMALL_KANA_EXTENSION (0X1B130,0X1B16F),
NUSHU (0X1B170,0X1B2FF),
DUPLOYAN (0X1BC00,0X1BC9F),
SHORTHAND_FORMAT_CONTROLS (0X1BCA0,0X1BCAF),
ZNAMENNY_MUSICAL_NOTATION (0X1CF00,0X1CFCF),
BYZANTINE_MUSICAL_SYMBOLS (0X1D000,0X1D0FF),
MUSICAL_SYMBOLS (0X1D100,0X1D1FF),
ANCIENT_GREEK_MUSICAL_NOTATION (0X1D200,0X1D24F),
MAYAN_NUMERALS (0X1D2E0,0X1D2FF),
TAI_XUAN_JING_SYMBOLS (0X1D300,0X1D35F),
COUNTING_ROD_NUMERALS (0X1D360,0X1D37F),
MATHEMATICAL_ALPHANUMERIC_SYMBOLS (0X1D400,0X1D7FF),
SUTTON_SIGNWRITING (0X1D800,0X1DAAF),
LATIN_EXTENDED_G (0X1DF00,0X1DFFF),
GLAGOLITIC_SUPPLEMENT (0X1E000,0X1E02F),
NYIAKENG_PUACHUE_HMONG (0X1E100,0X1E14F),
TOTO (0X1E290,0X1E2BF),
WANCHO (0X1E2C0,0X1E2FF),
ETHIOPIC_EXTENDED_B (0X1E7E0,0X1E7FF),
MENDE_KIKAKUI (0X1E800,0X1E8DF),
ADLAM (0X1E900,0X1E95F),
INDIC_SIYAQ_NUMBERS (0X1EC70,0X1ECBF),
OTTOMAN_SIYAQ_NUMBERS (0X1ED00,0X1ED4F),
ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS (0X1EE00,0X1EEFF),
MAHJONG_TILES (0X1F000,0X1F02F),
DOMINO_TILES (0X1F030,0X1F09F),
PLAYING_CARDS (0X1F0A0,0X1F0FF),
ENCLOSED_ALPHANUMERIC_SUPPLEMENT (0X1F100,0X1F1FF),
ENCLOSED_IDEOGRAPHIC_SUPPLEMENT (0X1F200,0X1F2FF),
MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS (0X1F300,0X1F5FF),
EMOTICONS (0X1F600,0X1F64F),
ORNAMENTAL_DINGBATS (0X1F650,0X1F67F),
TRANSPORT_AND_MAP_SYMBOLS (0X1F680,0X1F6FF),
ALCHEMICAL_SYMBOLS (0X1F700,0X1F77F),
GEOMETRIC_SHAPES_EXTENDED (0X1F780,0X1F7FF),
SUPPLEMENTAL_ARROWS_C (0X1F800,0X1F8FF),
SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS (0X1F900,0X1F9FF),
CHESS_SYMBOLS (0X1FA00,0X1FA6F),
SYMBOLS_AND_PICTOGRAPHS_EXTENDED_A (0X1FA70,0X1FAFF),
SYMBOLS_FOR_LEGACY_COMPUTING (0X1FB00,0X1FBFF),
UNKNOWN(0X1FC00,0XFFFFF)
;
private final int start;
private final int stop;
private UnicodePlaneᶻᴰ(int start, int stop) {
this.start = start;
this.stop = stop;
}
public int getStart() {
return start;
}
public int getStop() {
return stop;
}
public static UnicodePlaneᶻᴰ valueOfUnicode(int unicode) {
for (UnicodePlaneᶻᴰ value:values()) {
if (unicode >= value.getStart() && unicode <= value.getStop()) {
return value;
}
}
return UnicodePlaneᶻᴰ.UNKNOWN;
}
}

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<root:module xmlns:root="http://eld.x4o.org/xml/ns/eld-root"
xmlns:eld="http://eld.x4o.org/xml/ns/eld-lang"
xmlns:conv="http://eld.x4o.org/xml/ns/eld-conv"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://eld.x4o.org/xml/ns/eld-root http://eld.x4o.org/xml/ns/eld-root-1.0.xsd"
providerHost="unicode-plane.x4o.distributedrebirth.love" providerName="UnicodePlane Encryption"
id="unicode-plane-module">
<eld:classBindingHandler id="UnicodePlane-UnicodePlaneBase"
parentClass="love.distributedrebirth.unicode4d.base.UnicodePlane"
childClass="love.distributedrebirth.unicode4d.base.UnicodePlaneBase"
addMethod="addPlane" getMethod="getPlanes" />
<eld:classBindingHandler id="UnicodePlaneBase-UnicodePlaneBaseGlyph"
parentClass="love.distributedrebirth.unicode4d.base.UnicodePlaneBase"
childClass="love.distributedrebirth.unicode4d.base.UnicodePlaneBaseGlyph"
addMethod="addBaseGlyph" getMethod="getBaseGlyphs" />
<eld:namespace
uri="http://unicode-plane.x4o.distributedrebirth.love/xml/ns/unicode-plane-root"
schemaUri="http://unicode-plane.x4o.distributedrebirth.love/xml/ns/unicode-plane-root-1.0.xsd"
schemaResource="unicode-plane-root-1.0.xsd" schemaPrefix="root"
description="Root namespace to have nice namespaceing."
name="UnicodePlane Root Namespace" languageRoot="true" id="root">
<eld:element tag="unicode"
objectClass="love.distributedrebirth.unicode4d.base.UnicodePlane"/>
</eld:namespace>
<eld:namespace
uri="http://unicode-plane.x4o.distributedrebirth.love/xml/ns/unicode-plane-lang"
schemaUri="http://unicode-plane.x4o.distributedrebirth.love/xml/ns/unicode-plane-lang-1.0.xsd"
schemaResource="unicode-plane-lang-1.0.xsd" schemaPrefix="l"
description="Language namespace to store unicode planes."
name="UnicodePlane Language Namespace" id="l">
<eld:element tag="plane"
objectClass="love.distributedrebirth.unicode4d.base.UnicodePlaneBase" />
<eld:element tag="glyph"
objectClass="love.distributedrebirth.unicode4d.base.UnicodePlaneBaseGlyph" />
</eld:namespace>
</root:module>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<modules version="1.0"
xmlns="http://language.x4o.org/xml/ns/modules"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://language.x4o.org/xml/ns/modules http://language.x4o.org/xml/ns/modules-1.0.xsd"
>
<language version="1.0">
<eld-resource>unicode-plane-lang.eld</eld-resource>
</language>
</modules>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<drivers version="1.0"
xmlns="http://language.x4o.org/xml/ns/drivers"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://language.x4o.org/xml/ns/drivers http://language.x4o.org/xml/ns/drivers-1.0.xsd"
>
<driver language="unicode-plane" className="love.distributedrebirth.unicode4d.base.UnicodePlaneDriver"/>
</drivers>

View file

@ -0,0 +1,292 @@
package love.distributedrebirth.unicode4d;
import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.numberxd.base2t.part.T02PartBinary;
import love.distributedrebirth.numberxd.base2t.type.V072Tong;
import love.distributedrebirth.unicode4d.base.UnicodePlane;
import love.distributedrebirth.unicode4d.base.UnicodePlaneBase;
import love.distributedrebirth.unicode4d.base.UnicodePlaneBaseGlyph;
import love.distributedrebirth.unicode4d.base.UnicodePlaneDriver;
import love.distributedrebirth.unicode4d.base.UnicodePlaneᶻᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class TestConvFont {
public static void main(String[] args) {
TestConvFont tcf = new TestConvFont();
tcf.run();
}
public void run() {
UnicodePlane unicodePlane = new UnicodePlane();
try {
List<FontContentResult> results = new ArrayList<>();
// NOTE: Are in order like the FontAtlas of ImGui
results.add(conf(unicodePlane, new File("../conv-font/bin/code-2000.xml")));
results.add(conf(unicodePlane, new File("../conv-font/bin/code-2001.xml")));
results.add(conf(unicodePlane, new File("../conv-font/bin/code-2002.xml")));
results.add(conf(unicodePlane, new File("../conv-font/bin/free-sans.xml")));
results.add(conf(unicodePlane, new File("../conv-font/bin/new-gardiner-bmp.xml")));
results.add(conf(unicodePlane, new File("../conv-font/bin/fa-solid-900.xml")));
results.add(conf(unicodePlane, new File("../conv-font/bin/noto-sans-brahmi.xml")));
int totalChars = 0;
for (FontContentResult result:results) {
totalChars += result.getGlyphCounter();
}
System.out.println("Writing export unicode4d with characters: "+totalChars);
UnicodePlaneDriver.newInstance().createWriter().writeFile(unicodePlane, "../main-gdxapp/assets/font/unicode4d.xml");
for (FontContentResult result:results) {
System.out.println("Glyphs import: "+result.getGlyphCounter()+" dropped: "+result.getGlyphDropped()+" from: "+result.getInputName());
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public FontContentResult conf(UnicodePlane unicodePlane, File input) throws Exception {
System.out.println("START WITH: "+input);
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
XMLReader reader = parser.getXMLReader();
FontContentHandler fontContentHandler = new FontContentHandler(unicodePlane, input.getName());
reader.setContentHandler(fontContentHandler);
InputSource inputSource = new InputSource(new FileInputStream(input));
reader.parse(inputSource);
return fontContentHandler.getResult();
}
class FontContentResult {
private final String inputName;
private int glyphCounter = 0;
private int glyphDropped = 0;
public FontContentResult(String inputName) {
this.inputName = inputName;
}
public String getInputName() {
return inputName;
}
public int getGlyphCounter() {
return glyphCounter;
}
public void incGlyphCounter() {
this.glyphCounter++;
}
public int getGlyphDropped() {
return glyphDropped;
}
public void incGlyphDropped() {
this.glyphDropped++;
}
}
class FontContentHandler implements ContentHandler {
private final UnicodePlane unicodePlane;
private final FontContentResult result;
private List<V072Tong> glyph;
private boolean startPoint = false;
private V072Tong point = null;
private int unicode = -1;
public FontContentHandler(UnicodePlane unicodePlane, String inputName) {
this.unicodePlane = unicodePlane;
this.result = new FontContentResult(inputName);
}
public FontContentResult getResult() {
return result;
}
@Override
public void characters(char[] arg0, int arg1, int arg2) throws SAXException {
}
@Override
public void endDocument() throws SAXException {
}
@Override
public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
if ("opentype".equals(qName)) {
} else if ("glyph".equals(qName)) {
if (CodePointCommandᶻᴰ.NOP != CodePointᶻᴰ.INSTANCE.getCommand(point.getValue(T02PartBinary.PART_1))) {
glyph.add(point);
}
UnicodePlaneᶻᴰ plane = UnicodePlaneᶻᴰ.valueOfUnicode(unicode);
UnicodePlaneBase planeBase = unicodePlane.getPlaneByName(plane.name());
if (planeBase == null) {
planeBase = new UnicodePlaneBase();
planeBase.setName(plane.name());
unicodePlane.addPlane(planeBase);
}
String unicodeHex = Integer.toHexString(unicode);
UnicodePlaneBaseGlyph baseGlyph = planeBase.getBaseGlyphByUnicode(unicodeHex);
if (baseGlyph != null) {
//System.out.println("============== DUP unicode: "+unicodeHex);
result.incGlyphDropped();
return;
}
result.incGlyphCounter();
baseGlyph = new UnicodePlaneBaseGlyph();
baseGlyph.setUnicode(unicodeHex);
baseGlyph.setGlyph(glyph);
planeBase.addBaseGlyph(baseGlyph);
//try {
//FileOutputStream out = new FileOutputStream("../conv-font/bin/test/"+unicode+".u4d");
//Base2Terminator.INSTANCE.Bãß2WriteTong(glyph, out);
//} catch (Exception e) {
// throw new SAXException(e);
//}
} else if ("contour".equals(qName)) {
}
}
@Override
public void endPrefixMapping(String arg0) throws SAXException {
}
@Override
public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException {
}
@Override
public void processingInstruction(String arg0, String arg1) throws SAXException {
}
@Override
public void setDocumentLocator(Locator arg0) {
}
@Override
public void skippedEntity(String arg0) throws SAXException {
}
@Override
public void startDocument() throws SAXException {
}
@Override
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
if ("opentype".equals(qName)) {
} else if ("glyph".equals(qName)) {
glyph = new ArrayList<>();
point = new V072Tong();
CodePointᶻᴰ.INSTANCE.setCommand(point.getValue(T02PartBinary.PART_1), CodePointCommandᶻᴰ.NOP);
CodePointᶻᴰ.INSTANCE.setCommand(point.getValue(T02PartBinary.PART_2), CodePointCommandᶻᴰ.NOP);
unicode = Integer.parseInt(atts.getValue("unicode"), 16);
int xMax = Integer.parseInt(atts.getValue("xMax"));
int yMax = Integer.parseInt(atts.getValue("yMax"));
int xMin = Integer.parseInt(atts.getValue("xMin"));
int yMin = Integer.parseInt(atts.getValue("yMin"));
int advanceWidth = Integer.parseInt(atts.getValue("advanceWidth"));
int leftSideBearing = Integer.parseInt(atts.getValue("leftSideBearing"));
V072Tong v0 = new V072Tong();
V072Tong v1 = new V072Tong();
V072Tong v2 = new V072Tong();
CodePointᶻᴰ.INSTANCE.setCommand(v0.getValue(T02PartBinary.PART_1), CodePointCommandᶻᴰ.START);
CodePointᶻᴰ.INSTANCE.setCommand(v0.getValue(T02PartBinary.PART_2), CodePointCommandᶻᴰ.UNICODE);
CodePointᶻᴰ.INSTANCE.setArgumentUnicode(v0.getValue(T02PartBinary.PART_2), unicode);
CodePointᶻᴰ.INSTANCE.setCommand(v1.getValue(T02PartBinary.PART_1), CodePointCommandᶻᴰ.XY_MAX);
CodePointᶻᴰ.INSTANCE.setArgument(v1.getValue(T02PartBinary.PART_1), T02PartBinary.PART_1, xMax);
CodePointᶻᴰ.INSTANCE.setArgument(v1.getValue(T02PartBinary.PART_1), T02PartBinary.PART_2, yMax);
CodePointᶻᴰ.INSTANCE.setCommand(v1.getValue(T02PartBinary.PART_2), CodePointCommandᶻᴰ.XY_MIN);
CodePointᶻᴰ.INSTANCE.setArgument(v1.getValue(T02PartBinary.PART_2), T02PartBinary.PART_1, xMin);
CodePointᶻᴰ.INSTANCE.setArgument(v1.getValue(T02PartBinary.PART_2), T02PartBinary.PART_2, yMin);
CodePointᶻᴰ.INSTANCE.setCommand(v2.getValue(T02PartBinary.PART_1), CodePointCommandᶻᴰ.ADVANCE);
CodePointᶻᴰ.INSTANCE.setArgument(v2.getValue(T02PartBinary.PART_1), T02PartBinary.PART_1, advanceWidth);
CodePointᶻᴰ.INSTANCE.setArgument(v2.getValue(T02PartBinary.PART_1), T02PartBinary.PART_2, leftSideBearing);
CodePointᶻᴰ.INSTANCE.setCommand(v2.getValue(T02PartBinary.PART_2), CodePointCommandᶻᴰ.NOP);
glyph.add(v0);
glyph.add(v1);
glyph.add(v2);
} else if ("contour".equals(qName)) {
startPoint = true;
} else if ("point".equals(qName)) {
boolean onCurve = Boolean.parseBoolean(atts.getValue("onCurve"));
int x = (int) Float.parseFloat(atts.getValue("x"));
int y = (int) Float.parseFloat(atts.getValue("y"));
T02PartBinary part = T02PartBinary.PART_1;
if (CodePointCommandᶻᴰ.NOP != CodePointᶻᴰ.INSTANCE.getCommand(point.getValue(T02PartBinary.PART_1))) {
part = T02PartBinary.PART_2;
}
if (onCurve) {
if (startPoint) {
CodePointᶻᴰ.INSTANCE.setCommand(point.getValue(part), CodePointCommandᶻᴰ.XY_ON_CURVE_START);
} else {
CodePointᶻᴰ.INSTANCE.setCommand(point.getValue(part), CodePointCommandᶻᴰ.XY_ON_CURVE);
}
} else {
if (startPoint) {
CodePointᶻᴰ.INSTANCE.setCommand(point.getValue(part), CodePointCommandᶻᴰ.XY_OFF_CURVE_START);
} else {
CodePointᶻᴰ.INSTANCE.setCommand(point.getValue(part), CodePointCommandᶻᴰ.XY_OFF_CURVE);
}
}
CodePointᶻᴰ.INSTANCE.setArgument(point.getValue(part), T02PartBinary.PART_1, x);
CodePointᶻᴰ.INSTANCE.setArgument(point.getValue(part), T02PartBinary.PART_2, y);
if (part == T02PartBinary.PART_2) {
glyph.add(point);
point = new V072Tong();
CodePointᶻᴰ.INSTANCE.setCommand(point.getValue(T02PartBinary.PART_1), CodePointCommandᶻᴰ.NOP);
CodePointᶻᴰ.INSTANCE.setCommand(point.getValue(T02PartBinary.PART_2), CodePointCommandᶻᴰ.NOP);
}
if (startPoint) {
startPoint = false;
}
}
}
@Override
public void startPrefixMapping(String arg0, String arg1) throws SAXException {
}
}
}

View file

@ -43,6 +43,8 @@ import love.distributedrebirth.numberxd.base2t.Base2PartsFactory;
import love.distributedrebirth.numberxd.base2t.Base2Terminator;
import love.distributedrebirth.numberxd.base2t.part.warp.TOSWarpCore;
import love.distributedrebirth.numberxd.glyph.BaseGlyphSet;
import love.distributedrebirth.unicode4d.base.UnicodePlane;
import love.distributedrebirth.unicode4d.base.UnicodePlaneDriver;
import love.distributedrebirth.warpme.TOSWarpCoreDriver;
import love.distributedrebirth.warpme.core.WaterBucket;
import net.spookygames.gdx.nativefilechooser.NativeFileChooser;
@ -64,6 +66,7 @@ public enum GDXAppMain implements DefaultEnumInstanceᴶᴹˣ<GDXAppMain,GDXAppM
public int viewWidth;
public int viewHeight;
public MusicManager music;
public UnicodePlane basePlane;
public ImBoolean showImGuiDemo = new ImBoolean(false);
private Map<Class<? extends Screen>,Screen> screens;
private DeskTopScreenMenu screenMenu;
@ -111,6 +114,9 @@ public enum GDXAppMain implements DefaultEnumInstanceᴶᴹˣ<GDXAppMain,GDXAppM
System.out.println("BãßBȍőnCoffinʸᴰ init done.");
try {
basePlane = UnicodePlaneDriver.newInstance().createReader().readString(Gdx.files.internal("font/unicode4d.xml").readString());
if (args.contains("warpcore-load")) {
System.out.println("warpcore-load: requested");
WaterBucket bucket = TOSWarpCoreDriver.newInstance().createReader().readFile("./warpcore.xml");

View file

@ -8,6 +8,7 @@ import com.badlogic.gdx.Gdx;
import imgui.ImGui;
import imgui.type.ImBoolean;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp.FontAwesomeIcons;
import love.distributedrebirth.gdxapp.GDXAppLauncher;
import love.distributedrebirth.gdxapp.GDXAppMain;
import love.distributedrebirth.gdxapp.desktop.apps.BasicConsoleApp;
@ -65,14 +66,14 @@ public class DeskTopScreenMenu {
}
private void renderSelfMenu(DeskTopScreen appScreen, DeskApp deskApp) {
if (ImGui.beginMenu(deskApp.getTitle())) {
if (ImGui.menuItem("Minimize", "", fileMinimizeSelected, deskApp != null )) {
if (ImGui.beginMenu(deskApp.getTitle())) {;
if (ImGui.menuItem(FontAwesomeIcons.FolderMinus + " Minimize", "", fileMinimizeSelected, deskApp != null )) {
fileMinimizeSelected.set(false);
if (deskApp != null) {
appScreen.getDeskAppScreen().setCurrentDeskApp(null);
}
}
if (ImGui.menuItem("Exit", "", fileCloseSelected, deskApp != null)) {
if (ImGui.menuItem(FontAwesomeIcons.WindowClose + " Exit", "", fileCloseSelected, deskApp != null)) {
fileCloseSelected.set(false);
if (deskApp != null) {
appScreen.getDeskAppScreen().removeDeskApp(deskApp);
@ -92,7 +93,7 @@ public class DeskTopScreenMenu {
if (fileNew == null && fileClose == null && fileSave == null && fileOption == null && filePrint == null) {
return;
}
if (ImGui.beginMenu("File")) {
if (ImGui.beginMenu(FontAwesomeIcons.File + " File")) {
if (fileNew != null) {
fileNew.render();
ImGui.separator();
@ -163,25 +164,25 @@ public class DeskTopScreenMenu {
}
private void renderVRGEM4Menu(DeskTopScreen appScreen) {
if (ImGui.beginMenu("vrGEM⁴")) {
if (ImGui.beginMenu(FontAwesomeIcons.Star + " vrGEM⁴")) {
String infix1 = "";
String infix2 = "";
String infix3 = "";
String infix4 = "";
if (appScreen instanceof ScreenDesktop1) {
infix1 = "=> ";
infix1 = FontAwesomeIcons.Wrench + " ";
}
if (appScreen instanceof ScreenDesktop2) {
infix2 = "=> ";
infix2 = FontAwesomeIcons.Wrench + " ";
}
if (appScreen instanceof ScreenDesktop3) {
infix3 = "=> ";
infix3 = FontAwesomeIcons.Wrench + " ";
}
if (appScreen instanceof ScreenDesktop4) {
infix4 = "=> ";
infix4 = FontAwesomeIcons.Wrench + " ";
}
if (ImGui.beginMenu(infix1+"Desktop1")) {
if (ImGui.menuItem("Main reality")) {
if (ImGui.menuItem(FontAwesomeIcons.Camera + " Main reality")) {
GDXAppMain.INSTANCE.selectScreen(ScreenDesktop1.class);
desktop1.getDeskAppScreen().setCurrentDeskApp(null);
}
@ -194,7 +195,7 @@ public class DeskTopScreenMenu {
ImGui.endMenu();
}
if (ImGui.beginMenu(infix2+"Desktop2")) {
if (ImGui.menuItem("Main reality")) {
if (ImGui.menuItem(FontAwesomeIcons.Camera + " Main reality")) {
GDXAppMain.INSTANCE.selectScreen(ScreenDesktop2.class);
desktop2.getDeskAppScreen().setCurrentDeskApp(null);
}
@ -207,7 +208,7 @@ public class DeskTopScreenMenu {
ImGui.endMenu();
}
if (ImGui.beginMenu(infix3+"Desktop3")) {
if (ImGui.menuItem("Main reality")) {
if (ImGui.menuItem(FontAwesomeIcons.Camera + " Main reality")) {
GDXAppMain.INSTANCE.selectScreen(ScreenDesktop3.class);
desktop3.getDeskAppScreen().setCurrentDeskApp(null);
}
@ -220,7 +221,7 @@ public class DeskTopScreenMenu {
ImGui.endMenu();
}
if (ImGui.beginMenu(infix4+"Desktop4")) {
if (ImGui.menuItem("Main reality")) {
if (ImGui.menuItem(FontAwesomeIcons.Camera + " Main reality")) {
GDXAppMain.INSTANCE.selectScreen(ScreenDesktop4.class);
desktop4.getDeskAppScreen().setCurrentDeskApp(null);
}
@ -233,7 +234,7 @@ public class DeskTopScreenMenu {
ImGui.endMenu();
}
ImGui.separator();
if (ImGui.beginMenu("Start App")) {
if (ImGui.beginMenu(FontAwesomeIcons.Plus + " Start App")) {
for (GDXAppLauncher launcher: apps) {
if (ImGui.menuItem(launcher.getName())) {
appScreen.getDeskAppScreen().addDeskApp(launcher.getLauncher().get());
@ -241,30 +242,31 @@ public class DeskTopScreenMenu {
}
ImGui.endMenu();
}
if (ImGui.menuItem("Run App")) {
if (ImGui.menuItem(FontAwesomeIcons.Terminal + " Run App")) {
}
ImGui.separator();
if (Gdx.graphics.isFullscreen()) {
if (ImGui.menuItem("Window Mode")) {
if (ImGui.menuItem(FontAwesomeIcons.Wheelchair + " Window Mode")) {
Gdx.graphics.setWindowedMode(GDXAppMain.INSTANCE.viewWidth, GDXAppMain.INSTANCE.viewHeight);
}
} else {
if (ImGui.menuItem("Full Screen")) {
if (ImGui.menuItem(FontAwesomeIcons.FighterJet + " Full Screen")) {
Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
}
}
ImGui.separator();
if (ImGui.menuItem("Credits")) {
if (ImGui.menuItem(FontAwesomeIcons.CreditCard + " Credits")) {
GDXAppMain.INSTANCE.selectScreen(ScreenCredits.class);
}
if (ImGui.menuItem("Help")) {
if (ImGui.menuItem(FontAwesomeIcons.HandsHelping + " Help")) {
GDXAppMain.INSTANCE.selectScreen(ScreenHelp.class);
}
ImGui.separator();
if (ImGui.menuItem("ImGui Demo")) {
if (ImGui.menuItem(FontAwesomeIcons.Trademark + " ImGui Demo")) {
GDXAppMain.INSTANCE.showImGuiDemo.set(true);
}
if (ImGui.menuItem("Shutdown")) {
if (ImGui.menuItem(FontAwesomeIcons.PowerOff + " Shutdown")) {
GDXAppMain.INSTANCE.dispose();
System.exit(0);
}

View file

@ -5,9 +5,12 @@ import imgui.ImDrawList;
import imgui.ImGui;
import imgui.ImVec2;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp.GDXAppMain;
import love.distributedrebirth.gdxapp.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp.desktop.DeskAppRenderer;
import love.distributedrebirth.unicode4d.base.UnicodePlaneBase;
import love.distributedrebirth.unicode4d.base.UnicodePlaneBaseGlyph;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class Unicode4DApp extends DefaultDeskApp implements DeskAppRenderer {
@ -20,29 +23,47 @@ public class Unicode4DApp extends DefaultDeskApp implements DeskAppRenderer {
@Override
public void render() {
ImGui.text("There is unicode and unicode4D");
ImVec2 size = new ImVec2(144f, 48f);
ImGui.invisibleButton("canvas", size.x, size.y);
ImVec2 p0 = ImGui.getItemRectMin();
ImVec2 p1 = ImGui.getItemRectMax(); // p1 = p0 + size
ImDrawList drawList = ImGui.getWindowDrawList();
drawList.pushClipRect(p0.x, p0.y, p1.x, p1.y);
// draw unicode4D
drawList.addQuad(p0.x, p0.y, p0.x+size.x, p0.y, p1.x, p1.y, p0.x, p0.y+size.y,
ImColor.intToColor(127, 127, 255, 255), 5f);
drawList.addLine(p0.x+10, p0.y+40, p0.x+20, p0.y+10, ImColor.intToColor(255, 127, 63, 255));
drawList.addLine(p0.x+30, p0.y+40, p0.x+20, p0.y+10, ImColor.intToColor(255, 127, 63, 255));
drawList.addLine(p0.x+13, p0.y+30, p0.x+27, p0.y+30, ImColor.intToColor(255, 127, 63, 255));
UnicodePlaneBase plane = GDXAppMain.INSTANCE.basePlane.getPlaneByName("MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A");
UnicodePlaneBaseGlyph glyph = plane.getBaseGlyphByUnicode("27d6");
drawList.popClipRect();
ImCharacter c = new ImCharacter(glyph);
//System.out.println("p0.x="+p0.x+" p0.y="+p0.y);
//System.out.println("p1.x="+p1.x+" p1.y="+p1.y);
c.render();
}
// for (int n = 0; n < (1.0f + Math.sin(ImGui.getTime() * 5.7f)) * 40.0f; n++) {
// drawList.addCircle(p0.x + size.x * 0.5f, p0.y + size.y * 0.5f, size.y * (0.01f + n * 0.03f),
// ImColor.intToColor(255, 140 - n * 4, n * 3, 255)
// );
// }
class ImCharacter {
private final UnicodePlaneBaseGlyph glyph;
public ImCharacter(UnicodePlaneBaseGlyph glyph) {
this.glyph = glyph;
}
public void render() {
ImVec2 size = new ImVec2(144f, 48f);
ImGui.invisibleButton("canvas", size.x, size.y);
ImVec2 p0 = ImGui.getItemRectMin();
ImVec2 p1 = ImGui.getItemRectMax(); // p1 = p0 + size
ImDrawList drawList = ImGui.getWindowDrawList();
drawList.pushClipRect(p0.x, p0.y, p1.x, p1.y);
// draw unicode4D
drawList.addQuad(p0.x, p0.y, p0.x+size.x, p0.y, p1.x, p1.y, p0.x, p0.y+size.y,
ImColor.intToColor(127, 127, 255, 255), 5f);
drawList.addLine(p0.x+10, p0.y+40, p0.x+20, p0.y+10, ImColor.intToColor(255, 127, 63, 255));
drawList.addLine(p0.x+30, p0.y+40, p0.x+20, p0.y+10, ImColor.intToColor(255, 127, 63, 255));
drawList.addLine(p0.x+13, p0.y+30, p0.x+27, p0.y+30, ImColor.intToColor(255, 127, 63, 255));
drawList.popClipRect();
//System.out.println("p0.x="+p0.x+" p0.y="+p0.y);
//System.out.println("p1.x="+p1.x+" p1.y="+p1.y);
// for (int n = 0; n < (1.0f + Math.sin(ImGui.getTime() * 5.7f)) * 40.0f; n++) {
// drawList.addCircle(p0.x + size.x * 0.5f, p0.y + size.y * 0.5f, size.y * (0.01f + n * 0.03f),
// ImColor.intToColor(255, 140 - n * 4, n * 3, 255)
// );
// }
}
}
}