Moved naming like others to support to 999
This commit is contained in:
parent
87c119e5e3
commit
be5869a88e
84 changed files with 961 additions and 961 deletions
|
|
@ -3,7 +3,7 @@ package love.distributedrebirth.unicode4d;
|
|||
import java.util.List;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.numberxd.base2t.part.T02PartBinary;
|
||||
import love.distributedrebirth.numberxd.base2t.part.T002PartBinary;
|
||||
import love.distributedrebirth.numberxd.base2t.type.V036Teger;
|
||||
import love.distributedrebirth.numberxd.base2t.type.V072Tong;
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ public enum CodePointᶻᴰ {
|
|||
public static final int MODIFIER_SCRIPT_SUB = 0b000000000010000000;
|
||||
public static final int MODIFIER_ENVELOP = 0b000000000100000000;
|
||||
|
||||
public int getArgument(V036Teger teger, T02PartBinary part) {
|
||||
public int getArgument(V036Teger teger, T002PartBinary part) {
|
||||
int value = teger.getValue(part).getValueNumber();
|
||||
int result = value & MASK_ARGU;
|
||||
if ((value & MASK_SIGN) != 0) {
|
||||
|
|
@ -35,7 +35,7 @@ public enum CodePointᶻᴰ {
|
|||
return result;
|
||||
}
|
||||
|
||||
public void setArgument(V036Teger teger, T02PartBinary part, int number) {
|
||||
public void setArgument(V036Teger teger, T002PartBinary part, int number) {
|
||||
int value = teger.getValue(part).getValueNumber();
|
||||
int result = (value & MASK_CMD) + ((number >> 17) & MASK_SIGN) + (number & MASK_ARGU);
|
||||
teger.getValue(part).setValueNumber(result);
|
||||
|
|
@ -43,33 +43,33 @@ public enum CodePointᶻᴰ {
|
|||
|
||||
public int getArgumentUnicode(V036Teger teger) {
|
||||
int unicode = 0;
|
||||
unicode += teger.getValue(T02PartBinary.PART_1).getValueNumber() & MASK_ARGU+MASK_SIGN;
|
||||
unicode += (teger.getValue(T02PartBinary.PART_2).getValueNumber() & MASK_ARGU+MASK_SIGN) << 15;
|
||||
unicode += teger.getValue(T002PartBinary.PART_1).getValueNumber() & MASK_ARGU+MASK_SIGN;
|
||||
unicode += (teger.getValue(T002PartBinary.PART_2).getValueNumber() & MASK_ARGU+MASK_SIGN) << 15;
|
||||
return unicode;
|
||||
}
|
||||
|
||||
public void setArgumentUnicode(V036Teger teger, int unicode) {
|
||||
int value1 = teger.getValue(T02PartBinary.PART_1).getValueNumber();
|
||||
int value2 = teger.getValue(T02PartBinary.PART_2).getValueNumber();
|
||||
int value1 = teger.getValue(T002PartBinary.PART_1).getValueNumber();
|
||||
int value2 = teger.getValue(T002PartBinary.PART_2).getValueNumber();
|
||||
value1 = (value1 & MASK_CMD) + (unicode & MASK_ARGU+MASK_SIGN);
|
||||
value2 = (value2 & MASK_CMD) + ((unicode >> 15) & MASK_ARGU+MASK_SIGN);
|
||||
teger.getValue(T02PartBinary.PART_1).setValueNumber(value1);
|
||||
teger.getValue(T02PartBinary.PART_2).setValueNumber(value2);
|
||||
teger.getValue(T002PartBinary.PART_1).setValueNumber(value1);
|
||||
teger.getValue(T002PartBinary.PART_2).setValueNumber(value2);
|
||||
}
|
||||
|
||||
public CodePointCommandᶻᴰ getCommand(V036Teger teger) {
|
||||
int mode = 0;
|
||||
mode += (teger.getValue(T02PartBinary.PART_1).getValueNumber() >> 15) << 0;
|
||||
mode += (teger.getValue(T02PartBinary.PART_2).getValueNumber() >> 15) << 3;
|
||||
mode += (teger.getValue(T002PartBinary.PART_1).getValueNumber() >> 15) << 0;
|
||||
mode += (teger.getValue(T002PartBinary.PART_2).getValueNumber() >> 15) << 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 | (((mode >> 0) << 15)) & MASK_CMD);
|
||||
teger.getValue(T02PartBinary.PART_2).setValueNumber(value2 | (((mode >> 3) << 15)) & MASK_CMD);
|
||||
int value1 = teger.getValue(T002PartBinary.PART_1).getValueNumber();
|
||||
int value2 = teger.getValue(T002PartBinary.PART_2).getValueNumber();
|
||||
teger.getValue(T002PartBinary.PART_1).setValueNumber(value1 | (((mode >> 0) << 15)) & MASK_CMD);
|
||||
teger.getValue(T002PartBinary.PART_2).setValueNumber(value2 | (((mode >> 3) << 15)) & MASK_CMD);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -77,11 +77,11 @@ public enum CodePointᶻᴰ {
|
|||
*/
|
||||
public int searchUnicode(List<V072Tong> tongs) {
|
||||
for (V072Tong tong:tongs) {
|
||||
if (CodePointCommandᶻᴰ.UNICODE.equals(CodePointᶻᴰ.INSTANCE.getCommand(tong.getValue(T02PartBinary.PART_1)))) {
|
||||
return CodePointᶻᴰ.INSTANCE.getArgumentUnicode(tong.getValue(T02PartBinary.PART_1));
|
||||
if (CodePointCommandᶻᴰ.UNICODE.equals(CodePointᶻᴰ.INSTANCE.getCommand(tong.getValue(T002PartBinary.PART_1)))) {
|
||||
return CodePointᶻᴰ.INSTANCE.getArgumentUnicode(tong.getValue(T002PartBinary.PART_1));
|
||||
}
|
||||
if (CodePointCommandᶻᴰ.UNICODE.equals(CodePointᶻᴰ.INSTANCE.getCommand(tong.getValue(T02PartBinary.PART_2)))) {
|
||||
return CodePointᶻᴰ.INSTANCE.getArgumentUnicode(tong.getValue(T02PartBinary.PART_2));
|
||||
if (CodePointCommandᶻᴰ.UNICODE.equals(CodePointᶻᴰ.INSTANCE.getCommand(tong.getValue(T002PartBinary.PART_2)))) {
|
||||
return CodePointᶻᴰ.INSTANCE.getArgumentUnicode(tong.getValue(T002PartBinary.PART_2));
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
|
@ -93,11 +93,11 @@ public enum CodePointᶻᴰ {
|
|||
*/
|
||||
public int searchNumber(List<V072Tong> tongs) {
|
||||
for (V072Tong tong:tongs) {
|
||||
if (CodePointCommandᶻᴰ.NUMBER.equals(CodePointᶻᴰ.INSTANCE.getCommand(tong.getValue(T02PartBinary.PART_1)))) {
|
||||
return CodePointᶻᴰ.INSTANCE.getArgumentUnicode(tong.getValue(T02PartBinary.PART_1));
|
||||
if (CodePointCommandᶻᴰ.NUMBER.equals(CodePointᶻᴰ.INSTANCE.getCommand(tong.getValue(T002PartBinary.PART_1)))) {
|
||||
return CodePointᶻᴰ.INSTANCE.getArgumentUnicode(tong.getValue(T002PartBinary.PART_1));
|
||||
}
|
||||
if (CodePointCommandᶻᴰ.NUMBER.equals(CodePointᶻᴰ.INSTANCE.getCommand(tong.getValue(T02PartBinary.PART_2)))) {
|
||||
return CodePointᶻᴰ.INSTANCE.getArgumentUnicode(tong.getValue(T02PartBinary.PART_2));
|
||||
if (CodePointCommandᶻᴰ.NUMBER.equals(CodePointᶻᴰ.INSTANCE.getCommand(tong.getValue(T002PartBinary.PART_2)))) {
|
||||
return CodePointᶻᴰ.INSTANCE.getArgumentUnicode(tong.getValue(T002PartBinary.PART_2));
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import org.junit.jupiter.api.Assertions;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.numberxd.base2t.part.T02PartBinary;
|
||||
import love.distributedrebirth.numberxd.base2t.part.T002PartBinary;
|
||||
import love.distributedrebirth.numberxd.base2t.type.V036Teger;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
|
|
@ -13,12 +13,12 @@ public class CodePointTest {
|
|||
@Test
|
||||
public void testCommand() {
|
||||
V036Teger teger = new V036Teger();
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(teger, T02PartBinary.PART_1, 0);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(teger, T02PartBinary.PART_2, 12345);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(teger, T002PartBinary.PART_1, 0);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(teger, T002PartBinary.PART_2, 12345);
|
||||
for (CodePointCommandᶻᴰ cmd:CodePointCommandᶻᴰ.values()) {
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(teger, cmd);
|
||||
int value1 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T02PartBinary.PART_1);
|
||||
int value2 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T02PartBinary.PART_2);
|
||||
int value1 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T002PartBinary.PART_1);
|
||||
int value2 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T002PartBinary.PART_2);
|
||||
Assertions.assertEquals(0, value1);
|
||||
Assertions.assertEquals(12345, value2);
|
||||
}
|
||||
|
|
@ -29,11 +29,11 @@ public class CodePointTest {
|
|||
V036Teger teger = new V036Teger();
|
||||
for (int i=-16384;i<16384;i++) {
|
||||
for (CodePointCommandᶻᴰ cmd:CodePointCommandᶻᴰ.values()) {
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(teger, T02PartBinary.PART_1, i);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(teger, T02PartBinary.PART_2, i);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(teger, T002PartBinary.PART_1, i);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(teger, T002PartBinary.PART_2, i);
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(teger, cmd);
|
||||
int value1 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T02PartBinary.PART_1);
|
||||
int value2 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T02PartBinary.PART_2);
|
||||
int value1 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T002PartBinary.PART_1);
|
||||
int value2 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T002PartBinary.PART_2);
|
||||
Assertions.assertEquals(i, value1);
|
||||
Assertions.assertEquals(i, value2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import org.xml.sax.SAXException;
|
|||
import org.xml.sax.XMLReader;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.numberxd.base2t.part.T02PartBinary;
|
||||
import love.distributedrebirth.numberxd.base2t.part.T002PartBinary;
|
||||
import love.distributedrebirth.numberxd.base2t.type.V072Tong;
|
||||
import love.distributedrebirth.numberxd.unicode.UnicodePlane;
|
||||
import love.distributedrebirth.unicode4d.atlas.FontAtlas;
|
||||
|
|
@ -170,7 +170,7 @@ public class TestConvFont {
|
|||
|
||||
} else if ("glyph".equals(qName)) {
|
||||
|
||||
if (CodePointCommandᶻᴰ.NOP != CodePointᶻᴰ.INSTANCE.getCommand(point.getValue(T02PartBinary.PART_1))) {
|
||||
if (CodePointCommandᶻᴰ.NOP != CodePointᶻᴰ.INSTANCE.getCommand(point.getValue(T002PartBinary.PART_1))) {
|
||||
tongs.add(point);
|
||||
}
|
||||
glyphCounter++;
|
||||
|
|
@ -215,8 +215,8 @@ public class TestConvFont {
|
|||
} else if ("glyph".equals(qName)) {
|
||||
tongs = 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);
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(point.getValue(T002PartBinary.PART_1), CodePointCommandᶻᴰ.NOP);
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(point.getValue(T002PartBinary.PART_2), CodePointCommandᶻᴰ.NOP);
|
||||
|
||||
String unicodeStr = atts.getValue("unicode");
|
||||
if (unicodeStr.startsWith("0000, ")) {
|
||||
|
|
@ -236,27 +236,27 @@ public class TestConvFont {
|
|||
V072Tong v2 = new V072Tong();
|
||||
|
||||
if (unicodePlane2.isLeftToRight()) {
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(v0.getValue(T02PartBinary.PART_1), CodePointCommandᶻᴰ.START_LR);
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(v0.getValue(T002PartBinary.PART_1), CodePointCommandᶻᴰ.START_LR);
|
||||
} else {
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(v0.getValue(T02PartBinary.PART_1), CodePointCommandᶻᴰ.START_RL);
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(v0.getValue(T002PartBinary.PART_1), CodePointCommandᶻᴰ.START_RL);
|
||||
}
|
||||
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(v0.getValue(T02PartBinary.PART_2), CodePointCommandᶻᴰ.UNICODE);
|
||||
CodePointᶻᴰ.INSTANCE.setArgumentUnicode(v0.getValue(T02PartBinary.PART_2), unicode);
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(v0.getValue(T002PartBinary.PART_2), CodePointCommandᶻᴰ.UNICODE);
|
||||
CodePointᶻᴰ.INSTANCE.setArgumentUnicode(v0.getValue(T002PartBinary.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(T002PartBinary.PART_1), CodePointCommandᶻᴰ.XY_MAX);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(v1.getValue(T002PartBinary.PART_1), T002PartBinary.PART_1, xMax);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(v1.getValue(T002PartBinary.PART_1), T002PartBinary.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(v1.getValue(T002PartBinary.PART_2), CodePointCommandᶻᴰ.XY_MIN);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(v1.getValue(T002PartBinary.PART_2), T002PartBinary.PART_1, xMin);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(v1.getValue(T002PartBinary.PART_2), T002PartBinary.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(T002PartBinary.PART_1), CodePointCommandᶻᴰ.ADVANCE);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(v2.getValue(T002PartBinary.PART_1), T002PartBinary.PART_1, advanceWidth);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(v2.getValue(T002PartBinary.PART_1), T002PartBinary.PART_2, leftSideBearing);
|
||||
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(v2.getValue(T02PartBinary.PART_2), CodePointCommandᶻᴰ.NOP);
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(v2.getValue(T002PartBinary.PART_2), CodePointCommandᶻᴰ.NOP);
|
||||
|
||||
tongs.add(v0);
|
||||
tongs.add(v1);
|
||||
|
|
@ -270,9 +270,9 @@ public class TestConvFont {
|
|||
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;
|
||||
T002PartBinary part = T002PartBinary.PART_1;
|
||||
if (CodePointCommandᶻᴰ.NOP != CodePointᶻᴰ.INSTANCE.getCommand(point.getValue(T002PartBinary.PART_1))) {
|
||||
part = T002PartBinary.PART_2;
|
||||
}
|
||||
if (onCurve) {
|
||||
if (startPoint) {
|
||||
|
|
@ -287,13 +287,13 @@ public class TestConvFont {
|
|||
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) {
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(point.getValue(part), T002PartBinary.PART_1, x);
|
||||
CodePointᶻᴰ.INSTANCE.setArgument(point.getValue(part), T002PartBinary.PART_2, y);
|
||||
if (part == T002PartBinary.PART_2) {
|
||||
tongs.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);
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(point.getValue(T002PartBinary.PART_1), CodePointCommandᶻᴰ.NOP);
|
||||
CodePointᶻᴰ.INSTANCE.setCommand(point.getValue(T002PartBinary.PART_2), CodePointCommandᶻᴰ.NOP);
|
||||
}
|
||||
if (startPoint) {
|
||||
startPoint = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue