Added missing fonts and wip chain build
This commit is contained in:
parent
81aee053dd
commit
69c081ae48
16 changed files with 192 additions and 33 deletions
|
|
@ -7,4 +7,26 @@
|
|||
</parent>
|
||||
<artifactId>gdxapp4d-chain-sys-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>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -22,9 +22,42 @@
|
|||
<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>
|
||||
|
|
|
|||
47
gdxapp4d-chain-sys-unicode4d/src/main/nodejs/conv-font.js
Normal file
47
gdxapp4d-chain-sys-unicode4d/src/main/nodejs/conv-font.js
Normal 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>");
|
||||
10
gdxapp4d-chain-sys-unicode4d/src/main/nodejs/conv-font.sh
Executable file
10
gdxapp4d-chain-sys-unicode4d/src/main/nodejs/conv-font.sh
Executable 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
|
||||
61
gdxapp4d-chain-sys-unicode4d/src/main/nodejs/package-lock.json
generated
Normal file
61
gdxapp4d-chain-sys-unicode4d/src/main/nodejs/package-lock.json
generated
Normal 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=="
|
||||
}
|
||||
}
|
||||
}
|
||||
11
gdxapp4d-chain-sys-unicode4d/src/main/nodejs/package.json
Normal file
11
gdxapp4d-chain-sys-unicode4d/src/main/nodejs/package.json
Normal file
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue