Moved all chains to chain prefix modules

This commit is contained in:
Willem Cazander 2022-03-14 22:37:21 +01:00
parent 38d9a514c8
commit 26d33c1ec7
68 changed files with 96 additions and 105 deletions

View file

@ -0,0 +1,32 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>gdxapp4d-chain-font-unicode4d</artifactId>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<copy todir="target/chain">
<fileset dir="src/main/chain" />
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<root:ocean xmlns:root="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root"
xmlns:link="http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-link"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root-1.0.xsd">
<link:sea name="System Unicode4D" provider="gdxapp4d.system" author="willemtsade">
<link:magic file="plane0/code-2000.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/free-sans.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/new-gardiner-bmp.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/fa-solid-900.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-samaritan.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-sinhala.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-serif-tibetan.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-tagalog.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-tagbanwa.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-tai-le.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-tai-tham.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-batak.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-lepcha.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-balinese.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-sundanese.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-lisu.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-bamum.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-glagolitic.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-javanese.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-new-tai-lue.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-tai-viet.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-syloti-nagri.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane0/noto-sans-meetei-mayek.ttf" mime="application/x-font-ttf-plane0"/>
<link:magic file="plane1/code-2001.ttf" mime="application/x-font-ttf-plane1"/>
<link:magic file="plane1/new-gardiner-smp.ttf" mime="application/x-font-ttf-plane1"/>
<link:magic file="plane1/noto-sans-brahmi.ttf" mime="application/x-font-ttf-plane1"/>
<link:magic file="plane2/code-2002.ttf" mime="application/x-font-ttf-plane2"/>
<link:magic file="plane0/code-2000.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/free-sans.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/new-gardiner-bmp.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/fa-solid-900.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-samaritan.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-sinhala.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-serif-tibetan.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-tagalog.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-tagbanwa.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-tai-le.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-tai-tham.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-batak.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-lepcha.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-balinese.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-sundanese.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-lisu.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-bamum.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-glagolitic.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-javanese.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-new-tai-lue.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-tai-viet.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-syloti-nagri.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane0/noto-sans-meetei-mayek.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane1/code-2001.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane1/new-gardiner-smp.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane1/noto-sans-brahmi.ttf4d" mime="application/x-font-ttf4d"/>
<link:magic file="plane2/code-2002.ttf4d" mime="application/x-font-ttf4d"/>
</link:sea>
</root:ocean>

View file

@ -0,0 +1,47 @@
const opentype = require('opentype.js');
const args = process.argv.slice(2);
const font = opentype.loadSync(args[0]);
function formatUnicode(unicode) {
unicode = unicode.toString(16);
if (unicode.length > 4) {
return ("000000" + unicode.toUpperCase()).substr(-6)
} else {
return ("0000" + unicode.toUpperCase()).substr(-4)
}
}
console.log("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
console.log("<opentype>");
let num = font.numGlyphs;
for(let glyphIndex = 0; glyphIndex < num; glyphIndex++) {
let glyph = font.glyphs.get(glyphIndex);
// JS NOTE: without calling xMin the getContours returns empty set.... :''(
glyph.xMin;
var contours = glyph.getContours();
if (contours.length === 0) {
continue; // TODO: add compound support
}
if (glyph.unicodes.length === 0) {
continue; // with cmds, these are compound glyphs by index base only
}
let uni = glyph.unicodes.map(formatUnicode).join(', ');
console.log("\t<glyph unicode=\""+uni+"\" name=\""+glyph.name+"\" advanceWidth=\""+glyph.advanceWidth+"\" "+
"xMin=\""+glyph.xMin+"\" xMax=\""+glyph.xMax+"\" yMin=\""+glyph.yMin+"\" yMax=\""+glyph.yMax+"\" "+
"leftSideBearing=\""+glyph.leftSideBearing+"\">");
for (let contourIndex = 0; contourIndex < contours.length; ++contourIndex) {
const contour = contours[contourIndex];
console.log("\t\t<contour>");
for (let i = 0; i < contour.length; ++i) {
let curr = contour[i];
console.log("\t\t\t<point x=\""+curr.x+"\" y=\""+curr.y+"\" onCurve=\""+curr.onCurve+"\"/>");
}
console.log("\t\t</contour>");
}
console.log("\t</glyph>");
}
console.log("</opentype>");

View file

@ -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

View file

@ -0,0 +1,61 @@
{
"name": "conv-font",
"version": "0.0.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "conv-font",
"version": "0.0.1",
"dependencies": {
"opentype.js": "1.3.4"
}
},
"node_modules/opentype.js": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/opentype.js/-/opentype.js-1.3.4.tgz",
"integrity": "sha512-d2JE9RP/6uagpQAVtJoF0pJJA/fgai89Cc50Yp0EJHk+eLp6QQ7gBoblsnubRULNY132I0J1QKMJ+JTbMqz4sw==",
"dependencies": {
"string.prototype.codepointat": "^0.2.1",
"tiny-inflate": "^1.0.3"
},
"bin": {
"ot": "bin/ot"
},
"engines": {
"node": ">= 8.0.0"
}
},
"node_modules/string.prototype.codepointat": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz",
"integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg=="
},
"node_modules/tiny-inflate": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz",
"integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw=="
}
},
"dependencies": {
"opentype.js": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/opentype.js/-/opentype.js-1.3.4.tgz",
"integrity": "sha512-d2JE9RP/6uagpQAVtJoF0pJJA/fgai89Cc50Yp0EJHk+eLp6QQ7gBoblsnubRULNY132I0J1QKMJ+JTbMqz4sw==",
"requires": {
"string.prototype.codepointat": "^0.2.1",
"tiny-inflate": "^1.0.3"
}
},
"string.prototype.codepointat": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz",
"integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg=="
},
"tiny-inflate": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz",
"integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw=="
}
}
}

View file

@ -0,0 +1,10 @@
{
"name": "conv-font",
"version": "0.0.1",
"description": "Convert font data to XML intermediate.",
"private": true,
"scripts": {},
"dependencies": {
"opentype.js": "1.3.4"
}
}