Easter cleaning git
This commit is contained in:
commit
d0529bfadf
500 changed files with 116670 additions and 0 deletions
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Copyright ©Δ∞ 仙上主天
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package love.distributedrebirth.unicode4d;
|
||||
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public enum CodePointCommandᶻᴰ {
|
||||
/// TODO: This is TTF outline drawing, replace with filled stroke drawing schema.
|
||||
NOP,
|
||||
START_LR, // PART_1 = modifier
|
||||
START_RL,
|
||||
START_TB,
|
||||
START_BT,
|
||||
/// TODO: One unicode1 single glyph can be sequence of code points.
|
||||
UNICODE,
|
||||
NUMBER,
|
||||
ADVANCE,
|
||||
XY_MIN,
|
||||
XY_MAX,
|
||||
@Deprecated // NO COLORS IN TEXT, no color flags no color smiles
|
||||
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,
|
||||
;
|
||||
}
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
/*
|
||||
* Copyright ©Δ∞ 仙上主天
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package love.distributedrebirth.unicode4d;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ.T002ᖟ;
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᒢᓫᑊᐣᑊ.ᔿᓫᒻᓫᓫ.V036Teger;
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᒢᓫᑊᐣᑊ.ᔿᓫᒻᓫᓫ.V072Tong;
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public enum CodePointᶻᴰ {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
private static final int MASK_CMD = 0b111000000000000000;
|
||||
private static final int MASK_SIGN = 0b000100000000000000;
|
||||
private static final int MASK_ARGU = 0b000011111111111111;
|
||||
|
||||
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, T002ᖟ part) {
|
||||
int value = teger.legoᐧtuneᐧᗅᗷᗷᗅ(part).smurfᐧnativeᐧint();
|
||||
int result = value & MASK_ARGU;
|
||||
if ((value & MASK_SIGN) != 0) {
|
||||
result |= 0xFFFFC000;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setArgument(V036Teger teger, T002ᖟ part, int number) {
|
||||
int value = teger.legoᐧtuneᐧᗅᗷᗷᗅ(part).smurfᐧnativeᐧint();
|
||||
int result = (value & MASK_CMD) + ((number >> 17) & MASK_SIGN) + (number & MASK_ARGU);
|
||||
teger.legoᐧtuneᐧᗅᗷᗷᗅ(part).smurfᐧnativeᐧint(result);
|
||||
}
|
||||
|
||||
public int getArgumentUnicode(V036Teger teger) {
|
||||
int unicode = 0;
|
||||
unicode += (teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1).smurfᐧnativeᐧint() & MASK_ARGU+MASK_SIGN) << 15;
|
||||
unicode += (teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2).smurfᐧnativeᐧint() & MASK_ARGU+MASK_SIGN) << 0;
|
||||
return unicode;
|
||||
}
|
||||
|
||||
public void setArgumentUnicode(V036Teger teger, int unicode) {
|
||||
int value1 = teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1).smurfᐧnativeᐧint();
|
||||
int value2 = teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2).smurfᐧnativeᐧint();
|
||||
value1 = (value1 & MASK_CMD) + ((unicode >> 15) & MASK_ARGU+MASK_SIGN);
|
||||
value2 = (value2 & MASK_CMD) + ((unicode >> 0) & MASK_ARGU+MASK_SIGN);
|
||||
teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1).smurfᐧnativeᐧint(value1);
|
||||
teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2).smurfᐧnativeᐧint(value2);
|
||||
}
|
||||
|
||||
public CodePointCommandᶻᴰ getCommand(V036Teger teger) {
|
||||
int mode = 0;
|
||||
mode += (teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1).smurfᐧnativeᐧint() >> 15) << 3;
|
||||
mode += (teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2).smurfᐧnativeᐧint() >> 15) << 0;
|
||||
return CodePointCommandᶻᴰ.values()[mode];
|
||||
}
|
||||
|
||||
public void setCommand(V036Teger teger, CodePointCommandᶻᴰ command) {
|
||||
int mode = command.ordinal();
|
||||
int value1 = teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1).smurfᐧnativeᐧint();
|
||||
int value2 = teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2).smurfᐧnativeᐧint();
|
||||
teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1).smurfᐧnativeᐧint(value1 | (((mode >> 3) << 15)) & MASK_CMD);
|
||||
teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2).smurfᐧnativeᐧint(value2 | (((mode >> 0) << 15)) & MASK_CMD);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides legacy access to the unicode number definition.
|
||||
*/
|
||||
public int searchUnicode(List<V072Tong> tongs) {
|
||||
for (V072Tong tong:tongs) {
|
||||
if (CodePointCommandᶻᴰ.UNICODE.equals(CodePointᶻᴰ.INSTANCE.getCommand(tong.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1)))) {
|
||||
return CodePointᶻᴰ.INSTANCE.getArgumentUnicode(tong.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1));
|
||||
}
|
||||
if (CodePointCommandᶻᴰ.UNICODE.equals(CodePointᶻᴰ.INSTANCE.getCommand(tong.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2)))) {
|
||||
return CodePointᶻᴰ.INSTANCE.getArgumentUnicode(tong.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2));
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides number access so that 0123456789 is equal in all languages/fonts.
|
||||
* TODO: Add support for the other number ranges to like: base10,base16,base27,etc.
|
||||
*/
|
||||
public int searchNumber(List<V072Tong> tongs) {
|
||||
for (V072Tong tong:tongs) {
|
||||
if (CodePointCommandᶻᴰ.NUMBER.equals(CodePointᶻᴰ.INSTANCE.getCommand(tong.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1)))) {
|
||||
return CodePointᶻᴰ.INSTANCE.getArgumentUnicode(tong.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1));
|
||||
}
|
||||
if (CodePointCommandᶻᴰ.NUMBER.equals(CodePointᶻᴰ.INSTANCE.getCommand(tong.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2)))) {
|
||||
return CodePointᶻᴰ.INSTANCE.getArgumentUnicode(tong.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2));
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides access to vocal tone expression, so "A" and "a" and many other "a"'s have an equal tone expression.
|
||||
* TODO: And add support for invisible voice glue letters/commands so text-to-speech is correct.
|
||||
*/
|
||||
public int searchVocalTone(List<V072Tong> tongs) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
/*
|
||||
* Copyright ©Δ∞ 仙上主天
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package love.distributedrebirth.unicode4d;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ.T002ᖟ;
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᒢᓫᑊᐣᑊ.ᔿᓫᒻᓫᓫ.V036Teger;
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᒢᓫᑊᐣᑊ.ᔿᓫᒻᓫᓫ.V072Tong;
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public class Stringᶻᴰ {
|
||||
|
||||
private List<V072Tong> string;
|
||||
|
||||
protected Stringᶻᴰ(List<V072Tong> tongs) { // redo this unused class
|
||||
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.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1);
|
||||
} else {
|
||||
return tong.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2);
|
||||
}
|
||||
}
|
||||
|
||||
public int charSize() {
|
||||
int result = 0;
|
||||
for (V072Tong points:string) {
|
||||
CodePointCommandᶻᴰ cmd = CodePointᶻᴰ.INSTANCE.getCommand(points.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1));
|
||||
if (cmd == CodePointCommandᶻᴰ.START_LR) {
|
||||
result++;
|
||||
} else if (cmd == CodePointCommandᶻᴰ.START_RL) {
|
||||
result++;
|
||||
} else if (cmd == CodePointCommandᶻᴰ.START_TB) {
|
||||
result++;
|
||||
} else if (cmd == CodePointCommandᶻᴰ.START_BT) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* Copyright ©Δ∞ 仙上主天
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package love.distributedrebirth.unicode4d.atlas;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public class FontAtlas {
|
||||
|
||||
private Map<String, FontAtlasStore> stores = new HashMap<>();
|
||||
|
||||
public FontAtlas() {
|
||||
}
|
||||
|
||||
public FontAtlasStore getStoreByName(String name) {
|
||||
return stores.get(name);
|
||||
}
|
||||
|
||||
public Collection<FontAtlasStore> getStores() {
|
||||
return stores.values();
|
||||
}
|
||||
|
||||
public void setStores(Collection<FontAtlasStore> planes) {
|
||||
for (FontAtlasStore plane:planes) {
|
||||
addStore(plane);
|
||||
}
|
||||
}
|
||||
|
||||
public void addStore(FontAtlasStore plane) {
|
||||
this.stores.put(plane.getName(), plane);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Copyright ©Δ∞ 仙上主天
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package love.distributedrebirth.unicode4d.atlas;
|
||||
|
||||
import org.x4o.xml.X4ODriver;
|
||||
import org.x4o.xml.X4ODriverManager;
|
||||
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public class FontAtlasDriver extends X4ODriver<FontAtlas> {
|
||||
|
||||
static final public String LANGUAGE_NAME = "unicode4d-atlas";
|
||||
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 FontAtlasDriver newInstance() {
|
||||
return (FontAtlasDriver)X4ODriverManager.getX4ODriver(LANGUAGE_NAME);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* Copyright ©Δ∞ 仙上主天
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package love.distributedrebirth.unicode4d.atlas;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public class FontAtlasStore {
|
||||
|
||||
private String name;
|
||||
private List<FontAtlasStoreGlyph> glyphs = new ArrayList<>();
|
||||
|
||||
public FontAtlasStore() {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<FontAtlasStoreGlyph> getGlyphs() {
|
||||
return glyphs;
|
||||
}
|
||||
|
||||
public void setGlyphs(List<FontAtlasStoreGlyph> glyphs) {
|
||||
for (FontAtlasStoreGlyph baseGlyph:glyphs) {
|
||||
addGlyph(baseGlyph);
|
||||
}
|
||||
}
|
||||
|
||||
public void addGlyph(FontAtlasStoreGlyph baseGlyph) {
|
||||
this.glyphs.add(baseGlyph);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* Copyright ©Δ∞ 仙上主天
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package love.distributedrebirth.unicode4d.atlas;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᒢᓫᑊᐣᑊ.ᔿᓫᒻᓫᓫ.V072Tong;
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public class FontAtlasStoreGlyph {
|
||||
|
||||
private List<V072Tong> tongs = new ArrayList<>();
|
||||
|
||||
public FontAtlasStoreGlyph() {
|
||||
}
|
||||
|
||||
public List<V072Tong> getTongs() {
|
||||
return tongs;
|
||||
}
|
||||
|
||||
public void setTongs(List<V072Tong> glyph) {
|
||||
this.tongs = glyph;
|
||||
}
|
||||
|
||||
public void addTong(V072Tong glyph) {
|
||||
this.tongs.add(glyph);
|
||||
}
|
||||
|
||||
// TODO: this is quick hack not the proper way in x4o
|
||||
public String getGlyphX9() {
|
||||
return V072Tong.亞.gearsᐧbuildᐧhinarīᐧχ9ᐧfromᐧbricks(tongs);
|
||||
}
|
||||
|
||||
public void setGlyphX9(String hinary9) {
|
||||
tongs = V072Tong.亞.gearsᐧbuildᐧbricksᐧfromᐧhinarī(hinary9);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,225 @@
|
|||
/*
|
||||
* Copyright ©Δ∞ 仙上主天
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package love.distributedrebirth.unicode4d.draw;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import love.distributedrebirth.unicode4d.CodePointCommandᶻᴰ;
|
||||
import love.distributedrebirth.unicode4d.CodePointᶻᴰ;
|
||||
import love.distributedrebirth.unicode4d.draw.DrawGlyphContour.ImGlyphPoint;
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ.T002ᖟ;
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᒢᓫᑊᐣᑊ.ᔿᓫᒻᓫᓫ.V036Teger;
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᒢᓫᑊᐣᑊ.ᔿᓫᒻᓫᓫ.V072Tong;
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public class DrawCharacter {
|
||||
private final List<V072Tong> tongs;
|
||||
private final List<DrawGlyphContour> contours = new ArrayList<>();
|
||||
private final DrawGlyphPath glyphPath;
|
||||
private DrawGlyphContour currentContour;
|
||||
private int unicode;
|
||||
private int xMax;
|
||||
private int yMax;
|
||||
private int xMin;
|
||||
private int yMin;
|
||||
private int advanceWidth;
|
||||
private int leftSideBearing;
|
||||
private boolean leftToRight;
|
||||
|
||||
public DrawCharacter(List<V072Tong> tongs) {
|
||||
this.tongs = tongs;
|
||||
for (V072Tong tong: tongs) {
|
||||
processCodePoint(tong.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1));
|
||||
processCodePoint(tong.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2));
|
||||
}
|
||||
if (currentContour != null) {
|
||||
contours.add(currentContour);
|
||||
}
|
||||
this.glyphPath = createGlyphPath();
|
||||
}
|
||||
|
||||
private void processCodePoint(V036Teger codePoint) {
|
||||
CodePointCommandᶻᴰ cmd = CodePointᶻᴰ.INSTANCE.getCommand(codePoint);
|
||||
if (CodePointCommandᶻᴰ.NOP.equals(cmd)) {
|
||||
return;
|
||||
}
|
||||
if (CodePointCommandᶻᴰ.START_LR.equals(cmd)) {
|
||||
leftToRight = true;
|
||||
return;
|
||||
}
|
||||
if (CodePointCommandᶻᴰ.START_RL.equals(cmd)) {
|
||||
leftToRight = false;
|
||||
return;
|
||||
}
|
||||
if (CodePointCommandᶻᴰ.UNICODE.equals(cmd)) {
|
||||
unicode = CodePointᶻᴰ.INSTANCE.getArgumentUnicode(codePoint);
|
||||
return;
|
||||
}
|
||||
if (CodePointCommandᶻᴰ.XY_MAX.equals(cmd)) {
|
||||
xMax = CodePointᶻᴰ.INSTANCE.getArgument(codePoint, T002ᖟ.PART_1);
|
||||
yMax = CodePointᶻᴰ.INSTANCE.getArgument(codePoint, T002ᖟ.PART_2);
|
||||
return;
|
||||
}
|
||||
if (CodePointCommandᶻᴰ.XY_MIN.equals(cmd)) {
|
||||
xMin = CodePointᶻᴰ.INSTANCE.getArgument(codePoint, T002ᖟ.PART_1);
|
||||
yMin = CodePointᶻᴰ.INSTANCE.getArgument(codePoint, T002ᖟ.PART_2);
|
||||
return;
|
||||
}
|
||||
if (CodePointCommandᶻᴰ.ADVANCE.equals(cmd)) {
|
||||
advanceWidth = CodePointᶻᴰ.INSTANCE.getArgument(codePoint, T002ᖟ.PART_1);
|
||||
leftSideBearing = CodePointᶻᴰ.INSTANCE.getArgument(codePoint, T002ᖟ.PART_2);
|
||||
return;
|
||||
}
|
||||
if (CodePointCommandᶻᴰ.XY_ON_CURVE_START.equals(cmd)) {
|
||||
if (currentContour != null) {
|
||||
contours.add(currentContour);
|
||||
}
|
||||
int x = CodePointᶻᴰ.INSTANCE.getArgument(codePoint, T002ᖟ.PART_1);
|
||||
int y = CodePointᶻᴰ.INSTANCE.getArgument(codePoint, T002ᖟ.PART_2);
|
||||
currentContour = new DrawGlyphContour();
|
||||
currentContour.point(x, y, true);
|
||||
return;
|
||||
}
|
||||
if (CodePointCommandᶻᴰ.XY_OFF_CURVE_START.equals(cmd)) {
|
||||
if (currentContour != null) {
|
||||
contours.add(currentContour);
|
||||
}
|
||||
int x = CodePointᶻᴰ.INSTANCE.getArgument(codePoint, T002ᖟ.PART_1);
|
||||
int y = CodePointᶻᴰ.INSTANCE.getArgument(codePoint, T002ᖟ.PART_2);
|
||||
currentContour = new DrawGlyphContour();
|
||||
currentContour.point(x, y, true);
|
||||
return;
|
||||
}
|
||||
if (CodePointCommandᶻᴰ.XY_ON_CURVE.equals(cmd)) {
|
||||
int x = CodePointᶻᴰ.INSTANCE.getArgument(codePoint, T002ᖟ.PART_1);
|
||||
int y = CodePointᶻᴰ.INSTANCE.getArgument(codePoint, T002ᖟ.PART_2);
|
||||
currentContour.point(x, y, true);
|
||||
return;
|
||||
}
|
||||
if (CodePointCommandᶻᴰ.XY_OFF_CURVE.equals(cmd)) {
|
||||
int x = CodePointᶻᴰ.INSTANCE.getArgument(codePoint, T002ᖟ.PART_1);
|
||||
int y = CodePointᶻᴰ.INSTANCE.getArgument(codePoint, T002ᖟ.PART_2);
|
||||
currentContour.point(x, y, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private DrawGlyphPath createGlyphPath() {
|
||||
// source function getPath(points): opentype.js/src/tables/glyf.js
|
||||
DrawGlyphPath p = new DrawGlyphPath();
|
||||
|
||||
for (DrawGlyphContour contour: contours) {
|
||||
//ImGlyphPoint prev = null;
|
||||
ImGlyphPoint curr = contour.getPoints().get(contour.getPoints().size() - 1);
|
||||
ImGlyphPoint next = contour.getPoints().get(0);
|
||||
|
||||
if (curr.onCurve) {
|
||||
p.moveTo(curr.x, curr.y);
|
||||
} else {
|
||||
if (next.onCurve) {
|
||||
p.moveTo(next.x, next.y);
|
||||
} else {
|
||||
int x = (curr.x + next.x) / 2;
|
||||
int y = (curr.y + next.y) / 2;
|
||||
p.moveTo(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
Iterator<ImGlyphPoint> pointIt = contour.getPoints().iterator();
|
||||
pointIt.next(); // Remove first as that is 'next'
|
||||
while (pointIt.hasNext()) {
|
||||
//prev = curr;
|
||||
curr = next;
|
||||
next = pointIt.next();
|
||||
|
||||
if (curr.onCurve) {
|
||||
p.lineTo(curr.x, curr.y);
|
||||
} else {
|
||||
int x = next.x;
|
||||
int y = next.y;
|
||||
if (next.onCurve) {
|
||||
x = (curr.x + next.x) / 2;
|
||||
y = (curr.y + next.y) / 2;
|
||||
}
|
||||
p.quadCurveTo(curr.x, curr.y, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
p.closePath();
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
public List<V072Tong> getTongs() {
|
||||
return tongs;
|
||||
}
|
||||
|
||||
public List<DrawGlyphContour> getContours() {
|
||||
return contours;
|
||||
}
|
||||
|
||||
public DrawGlyphPath getGlyphPath() {
|
||||
return glyphPath;
|
||||
}
|
||||
|
||||
public int getUnicode() {
|
||||
return unicode;
|
||||
}
|
||||
|
||||
public int getxMax() {
|
||||
return xMax;
|
||||
}
|
||||
|
||||
public int getyMax() {
|
||||
return yMax;
|
||||
}
|
||||
|
||||
public int getxMin() {
|
||||
return xMin;
|
||||
}
|
||||
|
||||
public int getyMin() {
|
||||
return yMin;
|
||||
}
|
||||
|
||||
public int getAdvanceWidth() {
|
||||
return advanceWidth;
|
||||
}
|
||||
|
||||
public int getLeftSideBearing() {
|
||||
return leftSideBearing;
|
||||
}
|
||||
|
||||
public boolean isLeftToRight() {
|
||||
return leftToRight;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* Copyright ©Δ∞ 仙上主天
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package love.distributedrebirth.unicode4d.draw;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public class DrawGlyphContour {
|
||||
private final List<ImGlyphPoint> points = new ArrayList<>();
|
||||
|
||||
public class ImGlyphPoint {
|
||||
int x;
|
||||
int y;
|
||||
boolean onCurve;
|
||||
|
||||
public ImGlyphPoint(int x, int y, boolean onCurve) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.onCurve = onCurve;
|
||||
}
|
||||
}
|
||||
|
||||
public void point(int x, int y, boolean onCurve) {
|
||||
points.add(new ImGlyphPoint(x,y, onCurve));
|
||||
}
|
||||
|
||||
public List<ImGlyphPoint> getPoints() {
|
||||
return points;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,226 @@
|
|||
/*
|
||||
* Copyright ©Δ∞ 仙上主天
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package love.distributedrebirth.unicode4d.draw;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public class DrawGlyphPath {
|
||||
private final List<ImGlyphPathCommand> commands = new ArrayList<>();
|
||||
|
||||
public interface ImGlyphPathCommand {
|
||||
int getX();
|
||||
int getY();
|
||||
default boolean isImGlyphMoveTo() {
|
||||
return this instanceof ImGlyphMoveTo;
|
||||
}
|
||||
default boolean isImGlyphLineTo() {
|
||||
return this instanceof ImGlyphLineTo;
|
||||
}
|
||||
default boolean isImGlyphCurveTo() {
|
||||
return this instanceof ImGlyphCurveTo;
|
||||
}
|
||||
default boolean isImGlyphQuadCurveTo() {
|
||||
return this instanceof ImGlyphQuadCurveTo;
|
||||
}
|
||||
default boolean isImGlyphClosePath() {
|
||||
return this instanceof ImGlyphClosePath;
|
||||
}
|
||||
default ImGlyphMoveTo toImGlyphMoveTo() {
|
||||
return ImGlyphMoveTo.class.cast(this);
|
||||
}
|
||||
default ImGlyphLineTo toImGlyphLineTo() {
|
||||
return ImGlyphLineTo.class.cast(this);
|
||||
}
|
||||
default ImGlyphCurveTo toImGlyphCurveTo() {
|
||||
return ImGlyphCurveTo.class.cast(this);
|
||||
}
|
||||
default ImGlyphQuadCurveTo toImGlyphQuadCurveTo() {
|
||||
return ImGlyphQuadCurveTo.class.cast(this);
|
||||
}
|
||||
default ImGlyphClosePath toImGlyphClosePath() {
|
||||
return ImGlyphClosePath.class.cast(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final class ImGlyphMoveTo implements ImGlyphPathCommand {
|
||||
private final int x;
|
||||
private final int y;
|
||||
|
||||
public ImGlyphMoveTo(int x, int y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
}
|
||||
|
||||
public final class ImGlyphLineTo implements ImGlyphPathCommand {
|
||||
private final int x;
|
||||
private final int y;
|
||||
|
||||
public ImGlyphLineTo(int x, int y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
}
|
||||
|
||||
public final class ImGlyphCurveTo implements ImGlyphPathCommand {
|
||||
private final int x1;
|
||||
private final int y1;
|
||||
private final int x2;
|
||||
private final int y2;
|
||||
private final int x;
|
||||
private final int y;
|
||||
|
||||
public ImGlyphCurveTo(int x1, int y1,int x2, int y2,int x, int y) {
|
||||
this.x1 = x1;
|
||||
this.y1 = y1;
|
||||
this.x2 = x2;
|
||||
this.y2 = y2;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public int getX1() {
|
||||
return x1;
|
||||
}
|
||||
|
||||
public int getY1() {
|
||||
return y1;
|
||||
}
|
||||
|
||||
public int getX2() {
|
||||
return x2;
|
||||
}
|
||||
|
||||
public int getY2() {
|
||||
return y2;
|
||||
}
|
||||
}
|
||||
|
||||
public final class ImGlyphQuadCurveTo implements ImGlyphPathCommand {
|
||||
private final int x1;
|
||||
private final int y1;
|
||||
private final int x;
|
||||
private final int y;
|
||||
|
||||
public ImGlyphQuadCurveTo(int x1, int y1,int x, int y) {
|
||||
this.x1 = x1;
|
||||
this.y1 = y1;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public int getX1() {
|
||||
return x1;
|
||||
}
|
||||
|
||||
public int getY1() {
|
||||
return y1;
|
||||
}
|
||||
}
|
||||
|
||||
public class ImGlyphClosePath implements ImGlyphPathCommand {
|
||||
|
||||
@Override
|
||||
public int getX() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getY() {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public void moveTo(int x, int y) {
|
||||
commands.add(new ImGlyphMoveTo(x,y));
|
||||
}
|
||||
|
||||
public void lineTo(int x, int y) {
|
||||
commands.add(new ImGlyphLineTo(x,y));
|
||||
}
|
||||
|
||||
public void curveTo(int x1, int y1,int x2, int y2,int x, int y) {
|
||||
commands.add(new ImGlyphCurveTo(x1,y1,x2,y2,x,y));
|
||||
}
|
||||
|
||||
public void quadCurveTo(int x1, int y1,int x, int y) {
|
||||
commands.add(new ImGlyphQuadCurveTo(x1,y1,x,y));
|
||||
}
|
||||
|
||||
public void closePath() {
|
||||
commands.add(new ImGlyphClosePath());
|
||||
}
|
||||
|
||||
public List<ImGlyphPathCommand> getPath() {
|
||||
return commands;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
/*
|
||||
* Copyright ©Δ∞ 仙上主天
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package love.distributedrebirth.unicode4d.draw;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
import imgui.ImColor;
|
||||
import imgui.ImDrawList;
|
||||
import imgui.ImGui;
|
||||
import imgui.ImVec2;
|
||||
import imgui.flag.ImGuiStyleVar;
|
||||
import imgui.flag.ImGuiWindowFlags;
|
||||
import love.distributedrebirth.unicode4d.draw.DrawGlyphPath.ImGlyphLineTo;
|
||||
import love.distributedrebirth.unicode4d.draw.DrawGlyphPath.ImGlyphPathCommand;
|
||||
import love.distributedrebirth.unicode4d.draw.DrawGlyphPath.ImGlyphQuadCurveTo;
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public class ImCharacter {
|
||||
|
||||
public static final float HEIGHT = 26f;
|
||||
public static final float WIDTH = 22f;
|
||||
public static final float MARGIN_MENUBAR = 4f;
|
||||
private static final ImVec2 SIZE = new ImVec2(WIDTH, HEIGHT);
|
||||
private static final int DEFAULT_COLOR = ImColor.intToColor(255, 255, 255, 255);
|
||||
|
||||
public static void render(String childId, String text, int fallbackChar, Function<Integer, DrawCharacter> letterResolver) {
|
||||
ImGui.pushStyleVar(ImGuiStyleVar.ItemSpacing, 0f, 0f);
|
||||
// workaround for error; Too many vertices in ImDrawList using 16-bit indices.
|
||||
// hard coded height to fix line height and row0 height + no scoll to disable mouse scroll
|
||||
ImGui.beginChild(childId, 0f, ImCharacter.HEIGHT, false, ImGuiWindowFlags.NoScrollWithMouse);
|
||||
// NOTE: java never ever use String class its shit, just rename length() to length16BitShit() and break all buggy fake unicode loops.
|
||||
// codePoints() is the only valid iterator, all methods should be removed from String, humans are not allowed to write code,
|
||||
text.codePoints().forEach(unicodeChar -> {
|
||||
DrawCharacter drawChar = letterResolver.apply(unicodeChar);
|
||||
if (drawChar == null) {
|
||||
drawChar = letterResolver.apply(fallbackChar);
|
||||
}
|
||||
render(drawChar);
|
||||
ImGui.sameLine();
|
||||
});
|
||||
ImGui.endChild();
|
||||
ImGui.popStyleVar();
|
||||
}
|
||||
|
||||
public static void render(DrawCharacter drawChar) {
|
||||
ImGui.invisibleButton("canvas", SIZE.x, SIZE.y);
|
||||
ImVec2 p0 = ImGui.getItemRectMin();
|
||||
ImVec2 p1 = ImGui.getItemRectMax();
|
||||
ImDrawList drawList = ImGui.getWindowDrawList();
|
||||
drawList.pushClipRect(p0.x, p0.y, p1.x, p1.y);
|
||||
drawUnicode4D(drawChar, p0.x, p0.y, DEFAULT_COLOR, drawList);
|
||||
drawList.popClipRect();
|
||||
}
|
||||
|
||||
public static void drawUnicode4D(DrawCharacter drawChar, float posX, float posY, int color, ImDrawList drawList) {
|
||||
drawUnicode4D(drawChar, posX, posY, color, drawList, 1f);
|
||||
}
|
||||
public static void drawUnicode4D(DrawCharacter drawChar, float posX, float posY, int color, ImDrawList drawList, float scaleOffset) {
|
||||
float xOff = posX;
|
||||
float yOff = posY + 19f;
|
||||
float yFlip = -1f;
|
||||
float scale = 0.0199f;
|
||||
if (drawChar.getyMax() > 900) {
|
||||
scale = 0.0100f;
|
||||
}
|
||||
scale = scale * scaleOffset;
|
||||
ImGlyphPathCommand first = null;
|
||||
ImGlyphPathCommand prev = null;
|
||||
for (ImGlyphPathCommand cmd: drawChar.getGlyphPath().getPath()) {
|
||||
if (cmd.isImGlyphMoveTo()) {
|
||||
first = cmd;
|
||||
prev = cmd;
|
||||
continue;
|
||||
}
|
||||
if (cmd.isImGlyphLineTo()) {
|
||||
ImGlyphLineTo lineTo = cmd.toImGlyphLineTo();
|
||||
drawList.addLine(
|
||||
xOff+prev.getX()*scale,
|
||||
yOff+prev.getY()*scale*yFlip,
|
||||
xOff+lineTo.getX()*scale,
|
||||
yOff+lineTo.getY()*scale*yFlip,
|
||||
color);
|
||||
prev = cmd;
|
||||
continue;
|
||||
}
|
||||
if (cmd.isImGlyphQuadCurveTo()) {
|
||||
ImGlyphQuadCurveTo quadCurveTo = cmd.toImGlyphQuadCurveTo();
|
||||
drawList.addBezierQuadratic(
|
||||
xOff+prev.getX()*scale,
|
||||
yOff+prev.getY()*scale*yFlip,
|
||||
xOff+quadCurveTo.getX1()*scale,
|
||||
yOff+quadCurveTo.getY1()*scale*yFlip,
|
||||
xOff+quadCurveTo.getX()*scale,
|
||||
yOff+quadCurveTo.getY()*scale*yFlip,
|
||||
color,
|
||||
1);
|
||||
prev = cmd;
|
||||
continue;
|
||||
}
|
||||
if (cmd.isImGlyphClosePath()) {
|
||||
drawList.addLine(
|
||||
xOff+prev.getX()*scale,
|
||||
yOff+prev.getY()*scale*yFlip,
|
||||
xOff+first.getX()*scale,
|
||||
yOff+first.getY()*scale*yFlip,
|
||||
color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?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="unicode4d-atlas.x4o.distributedrebirth.love" providerName="FontAtlas Glyph Store"
|
||||
id="unicode4d-atlas-module">
|
||||
|
||||
<eld:classBindingHandler id="FontAtlas-FontAtlasStore"
|
||||
parentClass="love.distributedrebirth.unicode4d.atlas.FontAtlas"
|
||||
childClass="love.distributedrebirth.unicode4d.atlas.FontAtlasStore"
|
||||
addMethod="addStore" getMethod="getStores" />
|
||||
<eld:classBindingHandler id="FontAtlasStore-FontAtlasStoreGlyph"
|
||||
parentClass="love.distributedrebirth.unicode4d.atlas.FontAtlasStore"
|
||||
childClass="love.distributedrebirth.unicode4d.atlas.FontAtlasStoreGlyph"
|
||||
addMethod="addGlyph" getMethod="getGlyphs" />
|
||||
<!--
|
||||
<eld:classBindingHandler id="FontAtlasStoreGlyph-V072Tong"
|
||||
parentClass="love.distributedrebirth.unicode4d.atlas.FontAtlasStoreGlyph"
|
||||
childClass="love.distributedrebirth.numberxd.base2t.type.V072Tong"
|
||||
addMethod="addTong" getMethod="getTongs" />
|
||||
-->
|
||||
|
||||
<eld:namespace
|
||||
uri="http://unicode4d-atlas.x4o.distributedrebirth.love/xml/ns/unicode4d-atlas-root"
|
||||
schemaUri="http://unicode4d-atlas.x4o.distributedrebirth.love/xml/ns/unicode4d-atlas-root-1.0.xsd"
|
||||
schemaResource="unicode4d-atlas-root-1.0.xsd" schemaPrefix="r"
|
||||
description="Namespace to have single root."
|
||||
name="UnicodePlane Root Namespace" languageRoot="true" id="r">
|
||||
<eld:element tag="a" objectClass="love.distributedrebirth.unicode4d.atlas.FontAtlas">
|
||||
<eld:description>The font atlas to store all fonts.</eld:description>
|
||||
</eld:element>
|
||||
</eld:namespace>
|
||||
|
||||
<eld:namespace
|
||||
uri="http://unicode4d-atlas.x4o.distributedrebirth.love/xml/ns/unicode4d-atlas-lang"
|
||||
schemaUri="http://unicode4d-atlas.x4o.distributedrebirth.love/xml/ns/unicode4d-atlas-lang-1.0.xsd"
|
||||
schemaResource="unicode4d-atlas-lang-1.0.xsd" schemaPrefix="l"
|
||||
description="Namespace to store glyphs."
|
||||
name="UnicodePlane Language Namespace" id="l">
|
||||
<eld:element tag="s" objectClass="love.distributedrebirth.unicode4d.atlas.FontAtlasStore">
|
||||
<eld:description>The font atlas to store all characters in.</eld:description>
|
||||
</eld:element>
|
||||
<eld:element tag="g" objectClass="love.distributedrebirth.unicode4d.atlas.FontAtlasStoreGlyph">
|
||||
<eld:description>The unicode4D character data.</eld:description>
|
||||
</eld:element>
|
||||
</eld:namespace>
|
||||
</root:module>
|
||||
|
|
@ -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>unicode4d-atlas-lang.eld</eld-resource>
|
||||
</language>
|
||||
</modules>
|
||||
|
|
@ -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="unicode4d-atlas" className="love.distributedrebirth.unicode4d.atlas.FontAtlasDriver"/>
|
||||
</drivers>
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* Copyright ©Δ∞ 仙上主天
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package love.distributedrebirth.unicode4d;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ.T002ᖟ;
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᒢᓫᑊᐣᑊ.ᔿᓫᒻᓫᓫ.V036Teger;
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public class CodePointTest {
|
||||
|
||||
@Test
|
||||
public void testCommand() {
|
||||
V036Teger teger = new V036Teger();
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(teger, T002ᖟ.PART_1, 0);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(teger, T002ᖟ.PART_2, 12345);
|
||||
for (CodePointCommandᶻᴰ cmd:CodePointCommandᶻᴰ.values()) {
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(teger, cmd);
|
||||
int value1 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T002ᖟ.PART_1);
|
||||
int value2 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T002ᖟ.PART_2);
|
||||
Assertions.assertEquals(0, value1);
|
||||
Assertions.assertEquals(12345, value2);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNegativeArguments() {
|
||||
V036Teger teger = new V036Teger();
|
||||
for (int i=-16384;i<16384;i++) {
|
||||
for (CodePointCommandᶻᴰ cmd:CodePointCommandᶻᴰ.values()) {
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(teger, T002ᖟ.PART_1, i);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(teger, T002ᖟ.PART_2, i);
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(teger, cmd);
|
||||
int value1 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T002ᖟ.PART_1);
|
||||
int value2 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T002ᖟ.PART_2);
|
||||
Assertions.assertEquals(i, value1);
|
||||
Assertions.assertEquals(i, value2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnicode() {
|
||||
V036Teger teger = new V036Teger();
|
||||
for (int i=0;i<244000;i++) {
|
||||
for (CodePointCommandᶻᴰ cmd:CodePointCommandᶻᴰ.values()) {
|
||||
CodePointᶻᴰ.INSTANCE.setArgumentUnicode(teger, i);
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(teger, cmd);
|
||||
int value = CodePointᶻᴰ.INSTANCE.getArgumentUnicode(teger);
|
||||
Assertions.assertEquals(i, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,336 @@
|
|||
/*
|
||||
* Copyright ©Δ∞ 仙上主天
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
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.unicode4d.atlas.FontAtlas;
|
||||
import love.distributedrebirth.unicode4d.atlas.FontAtlasDriver;
|
||||
import love.distributedrebirth.unicode4d.atlas.FontAtlasStore;
|
||||
import love.distributedrebirth.unicode4d.atlas.FontAtlasStoreGlyph;
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᐪᓫᕽᐪ.ᓑᣕᣳᒼᐤᒄᓫ.UnicodePlane;
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ.T002ᖟ;
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᒢᓫᑊᐣᑊ.ᔿᓫᒻᓫᓫ.V072Tong;
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public class TestConvFont {
|
||||
|
||||
public static void main(String[] args) {
|
||||
TestConvFont tcf = new TestConvFont();
|
||||
tcf.run();
|
||||
}
|
||||
|
||||
// manually run;
|
||||
// gdxapp4d-chain-font-unicode4d/src/main/nodejs$ npm install
|
||||
// gdxapp4d-chain-font-unicode4d/src/main/nodejs$ ./conv-font.sh ../chain/plane0/ ../../../target/chain2/plane0/
|
||||
// gdxapp4d-chain-font-unicode4d/src/main/nodejs$ ./conv-font.sh ../chain/plane1/ ../../../target/chain2/plane1/
|
||||
// gdxapp4d-chain-font-unicode4d/src/main/nodejs$ ./conv-font.sh ../chain/plane2/ ../../../target/chain2/plane2/
|
||||
//
|
||||
// Than run this file
|
||||
public void run() {
|
||||
System.out.println("Starting conversion;");
|
||||
try {
|
||||
// NOTE: Are in order like the FontAtlas of ImGui
|
||||
String in = "../gdxapp4d-chain-font-unicode4d/target/chain2/";
|
||||
String out = "../gdxapp4d-chain-font-unicode4d/src/main/chain/";
|
||||
|
||||
conf("code-2000", new File(in+"plane0/code-2000.ttf.xml"), new File(out+"plane0/code-2000.ttf4d"));
|
||||
conf("fa-solid-900", new File(in+"plane0/fa-solid-900.ttf.xml"), new File(out+"plane0/fa-solid-900.ttf4d"));
|
||||
conf("free-sans", new File(in+"plane0/free-sans.ttf.xml"), new File(out+"plane0/free-sans.ttf4d"));
|
||||
conf("new-gardiner-bmp", new File(in+"plane0/new-gardiner-bmp.ttf.xml"), new File(out+"plane0/new-gardiner-bmp.ttf4d"));
|
||||
conf("noto-sans-balinese", new File(in+"plane0/noto-sans-balinese.ttf.xml"), new File(out+"plane0/noto-sans-balinese.ttf4d"));
|
||||
conf("noto-sans-bamum", new File(in+"plane0/noto-sans-bamum.ttf.xml"), new File(out+"plane0/noto-sans-bamum.ttf4d"));
|
||||
conf("noto-sans-batak", new File(in+"plane0/noto-sans-batak.ttf.xml"), new File(out+"plane0/noto-sans-batak.ttf4d"));
|
||||
conf("noto-sans-glagolitic", new File(in+"plane0/noto-sans-glagolitic.ttf.xml"), new File(out+"plane0/noto-sans-glagolitic.ttf4d"));
|
||||
conf("noto-sans-javanese", new File(in+"plane0/noto-sans-javanese.ttf.xml"), new File(out+"plane0/noto-sans-javanese.ttf4d"));
|
||||
conf("noto-sans-lepcha", new File(in+"plane0/noto-sans-lepcha.ttf.xml"), new File(out+"plane0/noto-sans-lepcha.ttf4d"));
|
||||
conf("noto-sans-lisu", new File(in+"plane0/noto-sans-lisu.ttf.xml"), new File(out+"plane0/noto-sans-lisu.ttf4d"));
|
||||
conf("noto-sans-meetei-mayek", new File(in+"plane0/noto-sans-meetei-mayek.ttf.xml"), new File(out+"plane0/noto-sans-meetei-mayek.ttf4d"));
|
||||
conf("noto-sans-new-tai-lue", new File(in+"plane0/noto-sans-new-tai-lue.ttf.xml"), new File(out+"plane0/noto-sans-new-tai-lue.ttf4d"));
|
||||
conf("noto-sans-samaritan", new File(in+"plane0/noto-sans-samaritan.ttf.xml"), new File(out+"plane0/noto-sans-samaritan.ttf4d"));
|
||||
conf("noto-sans-sinhala", new File(in+"plane0/noto-sans-sinhala.ttf.xml"), new File(out+"plane0/noto-sans-sinhala.ttf4d"));
|
||||
conf("noto-sans-sundanese", new File(in+"plane0/noto-sans-sundanese.ttf.xml"), new File(out+"plane0/noto-sans-sundanese.ttf4d"));
|
||||
conf("noto-sans-syloti-nagri", new File(in+"plane0/noto-sans-syloti-nagri.ttf.xml"), new File(out+"plane0/noto-sans-syloti-nagri.ttf4d"));
|
||||
conf("noto-sans-tagalog", new File(in+"plane0/noto-sans-tagalog.ttf.xml"), new File(out+"plane0/noto-sans-tagalog.ttf4d"));
|
||||
conf("noto-sans-tagbanwa", new File(in+"plane0/noto-sans-tagbanwa.ttf.xml"), new File(out+"plane0/noto-sans-tagbanwa.ttf4d"));
|
||||
conf("noto-sans-tai-le", new File(in+"plane0/noto-sans-tai-le.ttf.xml"), new File(out+"plane0/noto-sans-tai-le.ttf4d"));
|
||||
conf("noto-sans-tai-tham", new File(in+"plane0/noto-sans-tai-tham.ttf.xml"), new File(out+"plane0/noto-sans-tai-tham.ttf4d"));
|
||||
conf("noto-sans-tai-viet", new File(in+"plane0/noto-sans-tai-viet.ttf.xml"), new File(out+"plane0/noto-sans-tai-viet.ttf4d"));
|
||||
conf("noto-serif-tibetan", new File(in+"plane0/noto-serif-tibetan.ttf.xml"), new File(out+"plane0/noto-serif-tibetan.ttf4d"));
|
||||
|
||||
conf("code-2001", new File(in+"plane1/code-2001.ttf.xml"), new File(out+"plane1/code-2001.ttf4d"));
|
||||
conf("new-gardiner-smp", new File(in+"plane1/new-gardiner-smp.ttf.xml"), new File(out+"plane1/new-gardiner-smp.ttf4d"));
|
||||
conf("noto-sans-brahmi", new File(in+"plane1/noto-sans-brahmi.ttf.xml"), new File(out+"plane1/noto-sans-brahmi.ttf4d"));
|
||||
conf("noto-sans-carian", new File(in+"plane1/noto-sans-carian.ttf.xml"), new File(out+"plane1/noto-sans-carian.ttf4d"));
|
||||
conf("noto-sans-elbasan", new File(in+"plane1/noto-sans-elbasan.ttf.xml"), new File(out+"plane1/noto-sans-elbasan.ttf4d"));
|
||||
conf("noto-sans-kaithi", new File(in+"plane1/noto-sans-kaithi.ttf.xml"), new File(out+"plane1/noto-sans-kaithi.ttf4d"));
|
||||
conf("noto-sans-lycian", new File(in+"plane1/noto-sans-lycian.ttf.xml"), new File(out+"plane1/noto-sans-lycian.ttf4d"));
|
||||
conf("noto-sans-old-sogdian", new File(in+"plane1/noto-sans-old-sogdian.ttf.xml"), new File(out+"plane1/noto-sans-old-sogdian.ttf4d"));
|
||||
conf("noto-sans-osage", new File(in+"plane1/noto-sans-osage.ttf.xml"), new File(out+"plane1/noto-sans-osage.ttf4d"));
|
||||
conf("noto-sans-psalter-pahlavi", new File(in+"plane1/noto-sans-psalter-pahlavi.ttf.xml"), new File(out+"plane1/noto-sans-psalter-pahlavi.ttf4d"));
|
||||
conf("noto-sans-sogdian", new File(in+"plane1/noto-sans-sogdian.ttf.xml"), new File(out+"plane1/noto-sans-sogdian.ttf4d"));
|
||||
conf("noto-serif-yezidi", new File(in+"plane1/noto-serif-yezidi.ttf.xml"), new File(out+"plane1/noto-serif-yezidi.ttf4d"));
|
||||
|
||||
conf("noto-sans-avestan", new File(in+"plane1/noto-sans-avestan.ttf.xml"), new File(out+"plane1/noto-sans-avestan.ttf4d"));
|
||||
conf("noto-sans-chakma", new File(in+"plane1/noto-sans-chakma.ttf.xml"), new File(out+"plane1/noto-sans-chakma.ttf4d"));
|
||||
conf("noto-sans-grantha", new File(in+"plane1/noto-sans-grantha.ttf.xml"), new File(out+"plane1/noto-sans-grantha.ttf4d"));
|
||||
conf("noto-sans-hanifi-rohingya", new File(in+"plane1/noto-sans-hanifi-rohingya.ttf.xml"), new File(out+"plane1/noto-sans-hanifi-rohingya.ttf4d"));
|
||||
conf("noto-sans-inscriptional-parthian", new File(in+"plane1/noto-sans-inscriptional-parthian.ttf.xml"), new File(out+"plane1/noto-sans-inscriptional-parthian.ttf4d"));
|
||||
conf("noto-sans-kharoshthi", new File(in+"plane1/noto-sans-kharoshthi.ttf.xml"), new File(out+"plane1/noto-sans-kharoshthi.ttf4d"));
|
||||
conf("noto-sans-khojki", new File(in+"plane1/noto-sans-khojki.ttf.xml"), new File(out+"plane1/noto-sans-khojki.ttf4d"));
|
||||
conf("noto-sans-khudawadi", new File(in+"plane1/noto-sans-khudawadi.ttf.xml"), new File(out+"plane1/noto-sans-khudawadi.ttf4d"));
|
||||
conf("noto-sans-linear-a", new File(in+"plane1/noto-sans-linear-a.ttf.xml"), new File(out+"plane1/noto-sans-linear-a.ttf4d"));
|
||||
conf("noto-sans-lydian", new File(in+"plane1/noto-sans-lydian.ttf.xml"), new File(out+"plane1/noto-sans-lydian.ttf4d"));
|
||||
conf("noto-sans-mahajani", new File(in+"plane1/noto-sans-mahajani.ttf.xml"), new File(out+"plane1/noto-sans-mahajani.ttf4d"));
|
||||
conf("noto-sans-manichaean", new File(in+"plane1/noto-sans-manichaean.ttf.xml"), new File(out+"plane1/noto-sans-manichaean.ttf4d"));
|
||||
conf("noto-sans-meroitic", new File(in+"plane1/noto-sans-meroitic.ttf.xml"), new File(out+"plane1/noto-sans-meroitic.ttf4d"));
|
||||
conf("noto-sans-multani", new File(in+"plane1/noto-sans-multani.ttf.xml"), new File(out+"plane1/noto-sans-multani.ttf4d"));
|
||||
conf("noto-sans-nabataean", new File(in+"plane1/noto-sans-nabataean.ttf.xml"), new File(out+"plane1/noto-sans-nabataean.ttf4d"));
|
||||
conf("noto-sans-newa", new File(in+"plane1/noto-sans-newa.ttf.xml"), new File(out+"plane1/noto-sans-newa.ttf4d"));
|
||||
conf("noto-sans-old-hungarian", new File(in+"plane1/noto-sans-old-hungarian.ttf.xml"), new File(out+"plane1/noto-sans-old-hungarian.ttf4d"));
|
||||
conf("noto-sans-old-north-arabian", new File(in+"plane1/noto-sans-old-north-arabian.ttf.xml"), new File(out+"plane1/noto-sans-old-north-arabian.ttf4d"));
|
||||
conf("noto-sans-old-south-arabian", new File(in+"plane1/noto-sans-old-south-arabian.ttf.xml"), new File(out+"plane1/noto-sans-old-south-arabian.ttf4d"));
|
||||
conf("noto-sans-old-turkic", new File(in+"plane1/noto-sans-old-turkic.ttf.xml"), new File(out+"plane1/noto-sans-old-turkic.ttf4d"));
|
||||
conf("noto-sans-palmyrene", new File(in+"plane1/noto-sans-palmyrene.ttf.xml"), new File(out+"plane1/noto-sans-palmyrene.ttf4d"));
|
||||
conf("noto-sans-phoenician", new File(in+"plane1/noto-sans-phoenician.ttf.xml"), new File(out+"plane1/noto-sans-phoenician.ttf4d"));
|
||||
conf("noto-sans-sharada", new File(in+"plane1/noto-sans-sharada.ttf.xml"), new File(out+"plane1/noto-sans-sharada.ttf4d"));
|
||||
conf("noto-sans-sora-sompeng", new File(in+"plane1/noto-sans-sora-sompeng.ttf.xml"), new File(out+"plane1/noto-sans-sora-sompeng.ttf4d"));
|
||||
conf("noto-sans-tirhuta", new File(in+"plane1/noto-sans-tirhuta.ttf.xml"), new File(out+"plane1/noto-sans-tirhuta.ttf4d"));
|
||||
|
||||
conf("code-2002", new File(in+"plane2/code-2002.ttf.xml"), new File(out+"plane2/code-2002.ttf4d"));
|
||||
|
||||
System.out.println("Done conversion.");
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void conf(String fontName, File input, File output) throws Exception {
|
||||
SAXParserFactory factory = SAXParserFactory.newInstance();
|
||||
SAXParser parser = factory.newSAXParser();
|
||||
XMLReader reader = parser.getXMLReader();
|
||||
|
||||
FontAtlas fontAtlas = new FontAtlas();
|
||||
FontAtlasStore fontStore = new FontAtlasStore();
|
||||
fontStore.setName(fontName);
|
||||
fontAtlas.addStore(fontStore);
|
||||
FontContentHandler fontContentHandler = new FontContentHandler(fontStore, input.getName());
|
||||
reader.setContentHandler(fontContentHandler);
|
||||
|
||||
InputSource inputSource = new InputSource(new FileInputStream(input));
|
||||
reader.parse(inputSource);
|
||||
|
||||
FontAtlasDriver.newInstance().createWriter().writeFile(fontAtlas, output);
|
||||
|
||||
System.out.println("Done: "+output+" wrote: "+fontContentHandler.getGlyphCounter());
|
||||
}
|
||||
|
||||
class FontContentHandler implements ContentHandler {
|
||||
|
||||
private FontAtlasStore fontStore;
|
||||
private int glyphCounter;
|
||||
private List<V072Tong> tongs;
|
||||
private boolean startPoint = false;
|
||||
private V072Tong point = null;
|
||||
private int unicode = -1;
|
||||
private UnicodePlane unicodePlane2;
|
||||
|
||||
|
||||
public FontContentHandler(FontAtlasStore fontStore, String inputName) {
|
||||
this.fontStore = fontStore;
|
||||
}
|
||||
|
||||
public int getGlyphCounter() {
|
||||
return glyphCounter;
|
||||
}
|
||||
|
||||
@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.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1))) {
|
||||
tongs.add(point);
|
||||
}
|
||||
glyphCounter++;
|
||||
FontAtlasStoreGlyph baseGlyph = new FontAtlasStoreGlyph();
|
||||
baseGlyph.setTongs(tongs);
|
||||
fontStore.addGlyph(baseGlyph);
|
||||
|
||||
} 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)) {
|
||||
tongs = new ArrayList<>();
|
||||
point = new V072Tong();
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(point.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1), CodePointCommandᶻᴰ.NOP);
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(point.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2), CodePointCommandᶻᴰ.NOP);
|
||||
|
||||
String unicodeStr = atts.getValue("unicode");
|
||||
if (unicodeStr.startsWith("0000, ")) {
|
||||
unicodeStr = unicodeStr.substring(7);
|
||||
}
|
||||
unicode = Integer.parseInt(unicodeStr, 16);
|
||||
unicodePlane2 = UnicodePlane.valueOfUnicode(unicode);
|
||||
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();
|
||||
|
||||
if (unicodePlane2.isLeftToRight()) {
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(v0.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1), CodePointCommandᶻᴰ.START_LR);
|
||||
} else {
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(v0.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1), CodePointCommandᶻᴰ.START_RL);
|
||||
}
|
||||
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(v0.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2), CodePointCommandᶻᴰ.UNICODE);
|
||||
CodePointᶻᴰ.INSTANCE.setArgumentUnicode(v0.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2), unicode);
|
||||
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(v1.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1), CodePointCommandᶻᴰ.XY_MAX);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(v1.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1), T002ᖟ.PART_1, xMax);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(v1.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1), T002ᖟ.PART_2, yMax);
|
||||
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(v1.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2), CodePointCommandᶻᴰ.XY_MIN);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(v1.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2), T002ᖟ.PART_1, xMin);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(v1.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2), T002ᖟ.PART_2, yMin);
|
||||
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(v2.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1), CodePointCommandᶻᴰ.ADVANCE);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(v2.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1), T002ᖟ.PART_1, advanceWidth);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(v2.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1), T002ᖟ.PART_2, leftSideBearing);
|
||||
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(v2.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2), CodePointCommandᶻᴰ.NOP);
|
||||
|
||||
tongs.add(v0);
|
||||
tongs.add(v1);
|
||||
tongs.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"));
|
||||
|
||||
T002ᖟ part = T002ᖟ.PART_1;
|
||||
if (CodePointCommandᶻᴰ.NOP != CodePointᶻᴰ.INSTANCE.getCommand(point.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1))) {
|
||||
part = T002ᖟ.PART_2;
|
||||
}
|
||||
if (onCurve) {
|
||||
if (startPoint) {
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(point.legoᐧtuneᐧᗅᗷᗷᗅ(part), CodePointCommandᶻᴰ.XY_ON_CURVE_START);
|
||||
} else {
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(point.legoᐧtuneᐧᗅᗷᗷᗅ(part), CodePointCommandᶻᴰ.XY_ON_CURVE);
|
||||
}
|
||||
} else {
|
||||
if (startPoint) {
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(point.legoᐧtuneᐧᗅᗷᗷᗅ(part), CodePointCommandᶻᴰ.XY_OFF_CURVE_START);
|
||||
} else {
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(point.legoᐧtuneᐧᗅᗷᗷᗅ(part), CodePointCommandᶻᴰ.XY_OFF_CURVE);
|
||||
}
|
||||
}
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(point.legoᐧtuneᐧᗅᗷᗷᗅ(part), T002ᖟ.PART_1, x);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(point.legoᐧtuneᐧᗅᗷᗷᗅ(part), T002ᖟ.PART_2, y);
|
||||
if (part == T002ᖟ.PART_2) {
|
||||
tongs.add(point);
|
||||
point = new V072Tong();
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(point.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1), CodePointCommandᶻᴰ.NOP);
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(point.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2), CodePointCommandᶻᴰ.NOP);
|
||||
}
|
||||
if (startPoint) {
|
||||
startPoint = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startPrefixMapping(String arg0, String arg1) throws SAXException {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* Copyright ©Δ∞ 仙上主天
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package love.distributedrebirth.unicode4d;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.GridLayout;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᐪᓫᕽᐪ.ᓑᣕᣳᒼᐤᒄᓫ.UnicodePlane;
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public class TestSwingPlane extends JPanel {
|
||||
|
||||
private static final long serialVersionUID = 4146160826151405548L;
|
||||
|
||||
public TestSwingPlane() {
|
||||
super(new GridLayout(1, 0));
|
||||
|
||||
String[] columnNames = { "Plane", "Example"};
|
||||
|
||||
Object[][] data = new Object[UnicodePlane.values().length][2];
|
||||
|
||||
int x=0;
|
||||
for (UnicodePlane plane:UnicodePlane.values()) {
|
||||
data[x][0] = plane.name();
|
||||
StringBuilder buf = new StringBuilder();
|
||||
int offset = 33;
|
||||
for (int i=plane.getStart()+offset;i<plane.getStart()+33+offset;i++) {
|
||||
buf.append((char)i);
|
||||
buf.append(" ");
|
||||
}
|
||||
data[x][1] = buf.toString();
|
||||
x++;
|
||||
}
|
||||
final JTable table = new JTable(data, columnNames);
|
||||
table.setPreferredScrollableViewportSize(new Dimension(500, 70));
|
||||
table.setFillsViewportHeight(true);
|
||||
JScrollPane scrollPane = new JScrollPane(table);
|
||||
add(scrollPane);
|
||||
}
|
||||
|
||||
static public void main(String[] args) {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
createAndShowGUI();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void createAndShowGUI() {
|
||||
JFrame frame = new JFrame("SimpleTableDemo");
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
TestSwingPlane newContentPane = new TestSwingPlane();
|
||||
newContentPane.setOpaque(true); // content panes must be opaque
|
||||
frame.setContentPane(newContentPane);
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue