Added dirty raw mode code in unicode display methods
This commit is contained in:
parent
4122e24ad4
commit
d528e8dd8c
|
@ -70,21 +70,27 @@ import org.x4o.o2o.octal.PrimordialOctalOrangeJuiceCord;
|
|||
public class FourCornerUnicodeDisplay {
|
||||
|
||||
private boolean renderHiddenControls = false;
|
||||
private boolean renderLookup = true;
|
||||
private String renderSeperator = null;
|
||||
private final Map<Integer, List<Integer>> int18To21 = new HashMap<>();
|
||||
|
||||
private FourCornerUnicodeDisplay(boolean renderHiddenControls, String renderSeperator) {
|
||||
private FourCornerUnicodeDisplay(boolean renderHiddenControls, boolean renderLookup, String renderSeperator) {
|
||||
this.renderHiddenControls = renderHiddenControls;
|
||||
this.renderLookup = renderLookup;
|
||||
this.renderSeperator = renderSeperator;
|
||||
mapPoints();
|
||||
}
|
||||
|
||||
static FourCornerUnicodeDisplay text() {
|
||||
return text(false);
|
||||
return text(false, true);
|
||||
}
|
||||
|
||||
static FourCornerUnicodeDisplay text(boolean renderHiddenControls) {
|
||||
return new FourCornerUnicodeDisplay(renderHiddenControls, null);
|
||||
static FourCornerUnicodeDisplay raw() {
|
||||
return text(true, false);
|
||||
}
|
||||
|
||||
static FourCornerUnicodeDisplay text(boolean renderHiddenControls, boolean renderLookup) {
|
||||
return new FourCornerUnicodeDisplay(renderHiddenControls, renderLookup, null);
|
||||
}
|
||||
|
||||
// static FourCornerUnicodeDisplay mixedᐧEskimo() {
|
||||
|
@ -201,13 +207,20 @@ public class FourCornerUnicodeDisplay {
|
|||
} else {
|
||||
buf.append(FCDotCDC1604DashP6.escapeSignUnicode(FCDotCDC1604DashP6.__PIN.ordinal()));
|
||||
}
|
||||
buf.appendCodePoint(FCDotCDC1604DashP6.indexOf(numberMode).codePoints()[0]);
|
||||
if (renderLookup) { // is already printed when disabled
|
||||
buf.appendCodePoint(FCDotCDC1604DashP6.indexOf(numberMode).codePoints()[0]);
|
||||
}
|
||||
}
|
||||
if (numberMode < FCDotCDC1604DashP6.NX01_A.ordinal()) {
|
||||
cdcPoint = numberMode; // print char
|
||||
numberMode = null; // illegal number mode
|
||||
if (renderLookup) {
|
||||
if (numberMode != null && numberMode < FCDotCDC1604DashP6.NX01_A.ordinal()) {
|
||||
cdcPoint = numberMode; // print char
|
||||
numberMode = null; // illegal number mode
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
cdcPoint = numberMode; // print char
|
||||
numberMode = null; // disable lookup
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -315,6 +328,9 @@ public class FourCornerUnicodeDisplay {
|
|||
if (!renderHiddenControls) {
|
||||
buf.append(FCDotCDC1604DashP6.escapeSignUnicode(FCDotCDC1604DashP6.__ESC6.ordinal()));
|
||||
}
|
||||
if (!renderLookup) {
|
||||
return checkChr;
|
||||
}
|
||||
FCDotPIE9CDash26 lowCode = FCDotPIE9CDash26.values()[idx];
|
||||
Arrays.stream(lowCode.codePoints()).forEach(v -> buf.appendCodePoint(v));
|
||||
return null;
|
||||
|
|
|
@ -82,7 +82,7 @@ public class FourCornerUnicodeDisplayTest {
|
|||
cdc.add(FCDotCDC1604DashP6.NX15_O);
|
||||
|
||||
Assertions.assertEquals("ab B␃cD.jklmO", FourCornerUnicodeDisplay.text().renderFromX06(cdc));
|
||||
Assertions.assertEquals("␁Za␁Zb B␃cD.␁Zjklm␃␃O", FourCornerUnicodeDisplay.text(true).renderFromX06(cdc));
|
||||
Assertions.assertEquals("␁ZA␁ZB B␃CD.␁ZJKLM␃␃O", FourCornerUnicodeDisplay.raw().renderFromX06(cdc));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in a new issue