From 3d17c77cc5f73a6dccb086fdd926280114c36dc9 Mon Sep 17 00:00:00 2001 From: Willem Cazander Date: Sat, 12 Mar 2022 23:20:56 +0100 Subject: [PATCH] font wip --- gdxapp4d-chain-sys-unicode4d/src/main/nodejs/package.json | 3 +-- .../numberxd/base2t/Base2Terminator.java | 2 ++ .../unicode4d/atlas/FontAtlasStoreGlyph.java | 8 ++++---- .../love/distributedrebirth/unicode4d/TestConvFont.java | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gdxapp4d-chain-sys-unicode4d/src/main/nodejs/package.json b/gdxapp4d-chain-sys-unicode4d/src/main/nodejs/package.json index 40fa643f..01679d75 100644 --- a/gdxapp4d-chain-sys-unicode4d/src/main/nodejs/package.json +++ b/gdxapp4d-chain-sys-unicode4d/src/main/nodejs/package.json @@ -3,8 +3,7 @@ "version": "0.0.1", "description": "Convert font data to XML intermediate.", "private": true, - "scripts": { - }, + "scripts": {}, "dependencies": { "opentype.js": "1.3.4" } diff --git a/gdxapp4d-lib-numberxd/src/main/java/love/distributedrebirth/numberxd/base2t/Base2Terminator.java b/gdxapp4d-lib-numberxd/src/main/java/love/distributedrebirth/numberxd/base2t/Base2Terminator.java index 94d70cd1..9954e84c 100644 --- a/gdxapp4d-lib-numberxd/src/main/java/love/distributedrebirth/numberxd/base2t/Base2Terminator.java +++ b/gdxapp4d-lib-numberxd/src/main/java/love/distributedrebirth/numberxd/base2t/Base2Terminator.java @@ -120,6 +120,7 @@ public enum Base2Terminator implements DefaultEnumInstanceᴶᴹˣ data, OutputStream output) throws IOException { int totalBytes = Bãß2Write(data, output); + output.flush(); writeV072TongInvokes.increment(); writeV072TongByteReads.increment(totalBytes); writeV072TongTypeWrites.increment(data.size()); @@ -129,6 +130,7 @@ public enum Base2Terminator implements DefaultEnumInstanceᴶᴹˣ data, OutputStream output) throws IOException { int totalBytes = Bãß2Write(data, output); + output.flush(); writeV144ToctaInvokes.increment(); writeV144ToctaBytesReads.increment(totalBytes); writeV144ToctaTypeWrites.increment(data.size()); diff --git a/gdxapp4d-lib-unicodezd/src/main/java/love/distributedrebirth/unicode4d/atlas/FontAtlasStoreGlyph.java b/gdxapp4d-lib-unicodezd/src/main/java/love/distributedrebirth/unicode4d/atlas/FontAtlasStoreGlyph.java index 81b1e8bb..c0871092 100644 --- a/gdxapp4d-lib-unicodezd/src/main/java/love/distributedrebirth/unicode4d/atlas/FontAtlasStoreGlyph.java +++ b/gdxapp4d-lib-unicodezd/src/main/java/love/distributedrebirth/unicode4d/atlas/FontAtlasStoreGlyph.java @@ -34,7 +34,7 @@ public class FontAtlasStoreGlyph { this.tongs.add(glyph); } - public List getOct64() { + public List theOct64() { List result = new ArrayList<>(); BaseAppenderOctal appender = new BaseAppenderOctal(result); for (V072Tong tong: tongs) { @@ -43,7 +43,7 @@ public class FontAtlasStoreGlyph { return result; } - public void setOct64(List data) { + public void doOct64(List data) { BaseIteratorOctalAdapter adapter = new BaseIteratorOctalAdapter(data.iterator()); List result = new ArrayList<>(); while (adapter.hasNext()) { @@ -52,7 +52,7 @@ public class FontAtlasStoreGlyph { tongs = result; } - public byte[] getByte64() { + public byte[] theByte64() { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { Base2Terminator.INSTANCE.Bãß2WriteTong(tongs, baos); @@ -62,7 +62,7 @@ public class FontAtlasStoreGlyph { return baos.toByteArray(); } - public void setByte64(byte[] decodedBytes) { + public void doByte64(byte[] decodedBytes) { ByteArrayInputStream bais = new ByteArrayInputStream(decodedBytes); try { List result = new ArrayList<>(); diff --git a/gdxapp4d-lib-unicodezd/src/test/java/love/distributedrebirth/unicode4d/TestConvFont.java b/gdxapp4d-lib-unicodezd/src/test/java/love/distributedrebirth/unicode4d/TestConvFont.java index 4c3a9289..09a380a8 100644 --- a/gdxapp4d-lib-unicodezd/src/test/java/love/distributedrebirth/unicode4d/TestConvFont.java +++ b/gdxapp4d-lib-unicodezd/src/test/java/love/distributedrebirth/unicode4d/TestConvFont.java @@ -146,7 +146,7 @@ public class TestConvFont { System.out.println("Converted: "+Integer.toHexString(unicode)); FontAtlasStoreGlyph baseGlyph2 = new FontAtlasStoreGlyph(); - baseGlyph2.setByte64(baseGlyph.getByte64()); + baseGlyph2.doByte64(baseGlyph.theByte64()); int unicode2 = CodePointᶻᴰ.INSTANCE.searchUnicode(baseGlyph2.getTongs()); System.out.println("Converted2: "+Integer.toHexString(unicode2));