diff --git a/conv-font/package.json b/conv-font/package.json deleted file mode 100644 index 52c0680d..00000000 --- a/conv-font/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "conv-font", - "version": "0.0.1", - "description": "Convert font data to XML intermediate.", - "private": true, - "scripts": { - "start": "npm run-script conv0 && npm run-script conv1 && npm run-script conv2 && npm run-script conv3 && npm run-script conv4 && npm run-script conv5 && npm run-script conv6", - "conv0": "node conv-font.js ../main-gdxapp/assets/font/code-2000.ttf > bin/code-2000.xml", - "conv1": "node conv-font.js ../main-gdxapp/assets/font/free-sans.ttf > bin/free-sans.xml", - "conv2": "node conv-font.js ../main-gdxapp/assets/font/noto-sans-brahmi.ttf > bin/noto-sans-brahmi.xml", - "conv3": "node conv-font.js ../main-gdxapp/assets/font/new-gardiner-bmp.ttf > bin/new-gardiner-bmp.xml", - "conv4": "node conv-font.js ../main-gdxapp/assets/font/fa-solid-900.ttf > bin/fa-solid-900.xml", - "conv5": "node conv-font.js ../main-gdxapp/assets/font/code-2001.ttf > bin/code-2001.xml", - "conv6": "node conv-font.js ../main-gdxapp/assets/font/code-2002.ttf > bin/code-2002.xml", - "debug": "node conv-font.js ../main-gdxapp/assets/font/free-sans.ttf" - }, - "dependencies": { - "opentype.js": "1.3.4" - } -} diff --git a/gdxapp4d-boot-desktop/local-override.xml b/gdxapp4d-boot-desktop/local-override.xml index 50dbcd96..9f277d21 100644 --- a/gdxapp4d-boot-desktop/local-override.xml +++ b/gdxapp4d-boot-desktop/local-override.xml @@ -4,7 +4,7 @@ ../gdxapp4d-chain-sys-engine/src/main/chain ../gdxapp4d-chain-sys-engine-fuel/src/main/chain ../gdxapp4d-chain-dep-osgi-scr/src/main/chain - ../gdxapp4d-chain-sys-unicode4d/src/main/chain + ../gdxapp4d-chain-sys-unicode4d/target/chain ../gdxapp4d-app-calculator/src/main/chain ../gdxapp4d-app-calculator/target/classes diff --git a/gdxapp4d-chain-sys-unicode4d/pom.xml b/gdxapp4d-chain-sys-unicode4d/pom.xml index b4c2d46d..16736c89 100644 --- a/gdxapp4d-chain-sys-unicode4d/pom.xml +++ b/gdxapp4d-chain-sys-unicode4d/pom.xml @@ -7,4 +7,26 @@ gdxapp4d-chain-sys-unicode4d pom + + + + maven-antrun-plugin + + + package + + + + + + + + + run + + + + + + \ No newline at end of file diff --git a/gdxapp4d-chain-sys-unicode4d/src/main/chain/plane0/noto-sans-javanese.ttf b/gdxapp4d-chain-sys-unicode4d/src/main/chain/plane0/noto-sans-javanese.ttf new file mode 100644 index 00000000..82b5beeb Binary files /dev/null and b/gdxapp4d-chain-sys-unicode4d/src/main/chain/plane0/noto-sans-javanese.ttf differ diff --git a/gdxapp4d-chain-sys-unicode4d/src/main/chain/plane0/noto-sans-meetei-mayek.ttf b/gdxapp4d-chain-sys-unicode4d/src/main/chain/plane0/noto-sans-meetei-mayek.ttf new file mode 100644 index 00000000..37b3a220 Binary files /dev/null and b/gdxapp4d-chain-sys-unicode4d/src/main/chain/plane0/noto-sans-meetei-mayek.ttf differ diff --git a/gdxapp4d-chain-sys-unicode4d/src/main/chain/plane0/noto-sans-new-tai-lue.ttf b/gdxapp4d-chain-sys-unicode4d/src/main/chain/plane0/noto-sans-new-tai-lue.ttf new file mode 100644 index 00000000..b6fc6718 Binary files /dev/null and b/gdxapp4d-chain-sys-unicode4d/src/main/chain/plane0/noto-sans-new-tai-lue.ttf differ diff --git a/gdxapp4d-chain-sys-unicode4d/src/main/chain/plane0/noto-sans-syloti-nagri.ttf b/gdxapp4d-chain-sys-unicode4d/src/main/chain/plane0/noto-sans-syloti-nagri.ttf new file mode 100644 index 00000000..ba8d1459 Binary files /dev/null and b/gdxapp4d-chain-sys-unicode4d/src/main/chain/plane0/noto-sans-syloti-nagri.ttf differ diff --git a/gdxapp4d-chain-sys-unicode4d/src/main/chain/plane0/noto-sans-tai-viet.ttf b/gdxapp4d-chain-sys-unicode4d/src/main/chain/plane0/noto-sans-tai-viet.ttf new file mode 100644 index 00000000..7e1f1ac4 Binary files /dev/null and b/gdxapp4d-chain-sys-unicode4d/src/main/chain/plane0/noto-sans-tai-viet.ttf differ diff --git a/gdxapp4d-chain-sys-unicode4d/src/main/chain/warp-sea.xml b/gdxapp4d-chain-sys-unicode4d/src/main/chain/warp-sea.xml index e82523fe..7953a790 100644 --- a/gdxapp4d-chain-sys-unicode4d/src/main/chain/warp-sea.xml +++ b/gdxapp4d-chain-sys-unicode4d/src/main/chain/warp-sea.xml @@ -22,9 +22,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/conv-font/conv-font.js b/gdxapp4d-chain-sys-unicode4d/src/main/nodejs/conv-font.js similarity index 100% rename from conv-font/conv-font.js rename to gdxapp4d-chain-sys-unicode4d/src/main/nodejs/conv-font.js diff --git a/gdxapp4d-chain-sys-unicode4d/src/main/nodejs/conv-font.sh b/gdxapp4d-chain-sys-unicode4d/src/main/nodejs/conv-font.sh new file mode 100755 index 00000000..8a09b466 --- /dev/null +++ b/gdxapp4d-chain-sys-unicode4d/src/main/nodejs/conv-font.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +mkdir -p $2; + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +for FILE in `ls $1` +do + node $SCRIPT_DIR/conv-font.js $1/$FILE > $2/$FILE.xml +done \ No newline at end of file diff --git a/conv-font/package-lock.json b/gdxapp4d-chain-sys-unicode4d/src/main/nodejs/package-lock.json similarity index 98% rename from conv-font/package-lock.json rename to gdxapp4d-chain-sys-unicode4d/src/main/nodejs/package-lock.json index 03bdafe9..e80a78d7 100644 --- a/conv-font/package-lock.json +++ b/gdxapp4d-chain-sys-unicode4d/src/main/nodejs/package-lock.json @@ -5,8 +5,8 @@ "requires": true, "packages": { "": { + "name": "conv-font", "version": "0.0.1", - "license": "BSD-2-Clause", "dependencies": { "opentype.js": "1.3.4" } diff --git a/gdxapp4d-chain-sys-unicode4d/src/main/nodejs/package.json b/gdxapp4d-chain-sys-unicode4d/src/main/nodejs/package.json new file mode 100644 index 00000000..40fa643f --- /dev/null +++ b/gdxapp4d-chain-sys-unicode4d/src/main/nodejs/package.json @@ -0,0 +1,11 @@ +{ + "name": "conv-font", + "version": "0.0.1", + "description": "Convert font data to XML intermediate.", + "private": true, + "scripts": { + }, + "dependencies": { + "opentype.js": "1.3.4" + } +} 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 a01835fe..462512a6 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 @@ -31,16 +31,48 @@ public class TestConvFont { tcf.run(); } + // manually run; + // gdxapp4d-chain-sys-unicode4d/src/main/nodejs$ npm install + // gdxapp4d-chain-sys-unicode4d/src/main/nodejs$ ./conv-font.sh ../chain/plane0/ ../../../target/chain2/plane0/ + // gdxapp4d-chain-sys-unicode4d/src/main/nodejs$ ./conv-font.sh ../chain/plane1/ ../../../target/chain2/plane1/ + // gdxapp4d-chain-sys-unicode4d/src/main/nodejs$ ./conv-font.sh ../chain/plane2/ ../../../target/chain2/plane2/ + public void run() { + System.out.println("Starting conversion."); try { // NOTE: Are in order like the FontAtlas of ImGui - //conf("Code2000", new File("../conv-font/bin/code-2000.xml"), new File("../main-gdxapp/assets/font/code-2000.xml")); - //conf("Code2001", new File("../conv-font/bin/code-2001.xml"), new File("../main-gdxapp/assets/font/code-2001.xml")); - //conf("Code2002", new File("../conv-font/bin/code-2002.xml"), new File("../main-gdxapp/assets/font/code-2002.xml")); - //conf("Free Sans", new File("../conv-font/bin/free-sans.xml"), new File("../main-gdxapp/assets/font/free-sans.xml")); - conf("New Gardiner BMP", new File("../conv-font/bin/new-gardiner-bmp.xml"), new File("../main-gdxapp/assets/font/new-gardiner-bmp.xml")); - conf("Font Awesome", new File("../conv-font/bin/fa-solid-900.xml"), new File("../main-gdxapp/assets/font/fa-solid-900.xml")); - conf("Noto Sans Brahmi", new File("../conv-font/bin/noto-sans-brahmi.xml"), new File("../main-gdxapp/assets/font/noto-sans-brahmi.xml")); + String in = "../gdxapp4d-chain-sys-unicode4d/target/chain2/"; + String out = "../gdxapp4d-chain-sys-unicode4d/target/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("code-2002", new File(in+"plane2/code-2002.ttf.xml"), new File(out+"plane2/code-2002.ttf4d")); } catch (Exception e) { // TODO Auto-generated catch block @@ -49,8 +81,6 @@ public class TestConvFont { } public void conf(String fontName, File input, File output) throws Exception { - System.out.println("START WITH: "+input); - SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser parser = factory.newSAXParser(); XMLReader reader = parser.getXMLReader(); @@ -67,7 +97,7 @@ public class TestConvFont { FontAtlasDriver.newInstance().createWriter().writeFile(fontAtlas, output); - System.out.println("END WITH: "+output+" wrote: "+fontContentHandler.getGlyphCounter()); + System.out.println("Done: "+output+" wrote: "+fontContentHandler.getGlyphCounter()); } class FontContentHandler implements ContentHandler { diff --git a/gdxapp4d-lib-unicodezd/src/test/java/love/distributedrebirth/unicode4d/TestSwingPlane.java b/gdxapp4d-lib-unicodezd/src/test/java/love/distributedrebirth/unicode4d/TestSwingPlane.java new file mode 100644 index 00000000..742e88ff --- /dev/null +++ b/gdxapp4d-lib-unicodezd/src/test/java/love/distributedrebirth/unicode4d/TestSwingPlane.java @@ -0,0 +1,66 @@ +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; + +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()) { + if (plane.name().contains("SUPPLE")) { + continue; + } + if (plane.name().contains("EXTEN")) { + continue; + } + data[x][0] = plane.name(); + StringBuilder buf = new StringBuilder(); + int offset = 33; + for (int i=plane.getStart()+offset;i