wip bug hunt

This commit is contained in:
Willem Cazander 2022-03-12 20:59:21 +01:00
parent c6c5c0fa8f
commit c60f7cca65
18 changed files with 290 additions and 97 deletions

View file

@ -36,16 +36,16 @@ public enum CodePointᶻᴰ {
public int getArgumentUnicode(V036Teger teger) {
int unicode = 0;
unicode += teger.getValue(T02PartBinary.PART_1).getValueNumber();
unicode += teger.getValue(T02PartBinary.PART_2).getValueNumber() << 18;
unicode += getArgument(teger, T02PartBinary.PART_1);
unicode += getArgument(teger, T02PartBinary.PART_2) << 15;
return unicode;
}
public void setArgumentUnicode(V036Teger teger, int unicode) {
teger.getValue(T02PartBinary.PART_1).setValueNumber(unicode);
teger.getValue(T02PartBinary.PART_2).setValueNumber(unicode >> 18);
setArgument(teger, T02PartBinary.PART_1, unicode);
setArgument(teger, T02PartBinary.PART_2, unicode >> 15);
}
/*
public long getArgumentNumber(V036Teger teger) {
return teger.getValueNumber();
}
@ -53,11 +53,11 @@ public enum CodePointᶻᴰ {
public void setArgumentNumber(V036Teger teger, long number) {
teger.setValueNumber(number);
}
*/
public CodePointCommandᶻᴰ getCommand(V036Teger teger) {
int mode = 0;
mode += ((teger.getValue(T02PartBinary.PART_1).getValueNumber() >> 15) & 0b111) << 0;
mode += ((teger.getValue(T02PartBinary.PART_2).getValueNumber() >> 15) & 0b111) << 3;
mode += (teger.getValue(T02PartBinary.PART_1).getValueNumber() >> 15) << 0;
mode += (teger.getValue(T02PartBinary.PART_2).getValueNumber() >> 15) << 3;
return CodePointCommandᶻᴰ.values()[mode];
}

View file

@ -2,7 +2,6 @@ package love.distributedrebirth.unicode4d.atlas;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@ -23,7 +22,7 @@ public class FontAtlas {
return stores.values();
}
public void setStores(List<FontAtlasStore> planes) {
public void setStores(Collection<FontAtlasStore> planes) {
for (FontAtlasStore plane:planes) {
addStore(plane);
}

View file

@ -9,6 +9,9 @@ import java.util.List;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.numberxd.base2t.Base2Terminator;
import love.distributedrebirth.numberxd.base2t.BaseAppenderOctal;
import love.distributedrebirth.numberxd.base2t.BaseIteratorOctalAdapter;
import love.distributedrebirth.numberxd.base2t.part.T08PartOctal;
import love.distributedrebirth.numberxd.base2t.type.V072Tong;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
@ -30,6 +33,45 @@ public class FontAtlasStoreGlyph {
public void addTong(V072Tong glyph) {
this.tongs.add(glyph);
}
public List<T08PartOctal> getOct64() {
List<T08PartOctal> result = new ArrayList<>();
BaseAppenderOctal appender = new BaseAppenderOctal(result);
for (V072Tong tong: tongs) {
tong.fillOctalsByClone(appender);
}
return result;
}
public void setOct64(List<T08PartOctal> data) {
BaseIteratorOctalAdapter adapter = new BaseIteratorOctalAdapter(data.iterator());
List<V072Tong> result = new ArrayList<>();
while (adapter.hasNext()) {
result.add(new V072Tong(adapter));
}
tongs = result;
}
public byte[] getByte64() {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
Base2Terminator.INSTANCE.Bãß2WriteTong(tongs, baos);
} catch (IOException e) {
throw new RuntimeException(e);
}
return baos.toByteArray();
}
public void setByte64(byte[] decodedBytes) {
ByteArrayInputStream bais = new ByteArrayInputStream(decodedBytes);
try {
List<V072Tong> result = new ArrayList<>();
Base2Terminator.INSTANCE.Bãß2ReadTong(bais, result);
tongs = result;
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public String getBase64() {
ByteArrayOutputStream baos = new ByteArrayOutputStream();

View file

@ -73,7 +73,8 @@ public class TestConvFont {
conf("noto-sans-brahmi", new File(in+"plane1/noto-sans-brahmi.ttf.xml"), new File(out+"plane1/noto-sans-brahmi.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();
@ -141,6 +142,15 @@ public class TestConvFont {
baseGlyph.setTongs(tongs);
fontStore.addGlyph(baseGlyph);
int unicode = CodePointᶻᴰ.INSTANCE.searchUnicode(baseGlyph.getTongs());
System.out.println("Converted: "+Integer.toHexString(unicode));
FontAtlasStoreGlyph baseGlyph2 = new FontAtlasStoreGlyph();
baseGlyph2.setByte64(baseGlyph.getByte64());
int unicode2 = CodePointᶻᴰ.INSTANCE.searchUnicode(baseGlyph2.getTongs());
System.out.println("Converted2: "+Integer.toHexString(unicode2));
} else if ("contour".equals(qName)) {
}