Compare commits
376 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
464ac151bd | ||
|
|
8f70306540 | ||
|
|
28166bb2ec | ||
|
|
ac85217998 | ||
|
|
44b2450fbf | ||
|
|
9221373c53 | ||
|
|
bfaa190e49 | ||
|
|
23c7ae15a2 | ||
|
|
077a832767 | ||
|
|
8c9e912491 | ||
|
|
8a7cf85982 | ||
|
|
bae9af79e9 | ||
|
|
374dc1dd66 | ||
|
|
2812460a9c | ||
|
|
83a885d214 | ||
|
|
0dbb32b575 | ||
|
|
4fea10583c | ||
|
|
ebdb0c499c | ||
|
|
4e6f473b6f | ||
|
|
7fdb7a7a91 | ||
|
|
f8a1c4cfdf | ||
|
|
afa59255cc | ||
|
|
23a5a8997f | ||
|
|
4e705e5c7d | ||
|
|
c57f8e191b | ||
|
|
ed97bafc41 | ||
|
|
eebff767ce | ||
|
|
baee9a62aa | ||
|
|
305dbb548c | ||
|
|
0ccdf67f1e | ||
|
|
60aad1b24d | ||
|
|
e31e088744 | ||
|
|
824f11412d | ||
|
|
1445404005 | ||
|
|
dd851cdbc9 | ||
|
|
7abfb2d2f0 | ||
|
|
5e7237fb17 | ||
|
|
0cba7b96be | ||
|
|
1705b2752e | ||
|
|
4614ffab92 | ||
|
|
225d908f70 | ||
|
|
09e7483389 | ||
|
|
57ab00b6e1 | ||
|
|
23b6be74e2 | ||
|
|
905a235a1b | ||
|
|
d6b1dbd1d6 | ||
|
|
e9c4f0723a | ||
|
|
ac6733469c | ||
|
|
a7ecba905a | ||
|
|
d7c48b1f88 | ||
|
|
0c74660396 | ||
|
|
b3c1327dc4 | ||
|
|
489da04d1d | ||
|
|
a58ad756ff | ||
|
|
702f1b2e2f | ||
|
|
f10413d9c4 | ||
|
|
80aa9d0e52 | ||
|
|
64c13571f9 | ||
|
|
a36c5df477 | ||
|
|
7c3069e8cf | ||
|
|
1e66cfec51 | ||
|
|
1e0a820817 | ||
|
|
4623975858 | ||
|
|
23aac0c1c1 | ||
|
|
54d983013a | ||
|
|
c7507a6357 | ||
|
|
0714581866 | ||
|
|
095b8e65fb | ||
|
|
e60652d705 | ||
|
|
f3aeba3d70 | ||
|
|
ee2b1027b7 | ||
|
|
3b05624de5 | ||
|
|
4c0582184f | ||
|
|
5e6b2363b7 | ||
|
|
dbe93a26eb | ||
|
|
b128312e2c | ||
|
|
07ca429483 | ||
|
|
9675c40216 | ||
|
|
0870856674 | ||
|
|
3c6f18efbf | ||
|
|
2fdc6f85f5 | ||
|
|
4ed2c26b35 | ||
|
|
3ef7410e45 | ||
|
|
ba730fafe3 | ||
|
|
ab925bc8c5 | ||
|
|
b1362f3a3b | ||
|
|
f60eb6b3fc | ||
|
|
88f013a304 | ||
|
|
ea9f8fae4c | ||
|
|
a6363131ac | ||
|
|
fc60356b8b | ||
|
|
755420d5b3 | ||
|
|
0200aa5f85 | ||
|
|
7dff623b75 | ||
|
|
49f5e649b7 | ||
|
|
1656e50c3b | ||
|
|
99a1648734 | ||
|
|
9672aa8e05 | ||
|
|
d72ecb5cfd | ||
|
|
39fccbe6cb | ||
|
|
84efb253cf | ||
|
|
4c63860dc1 | ||
|
|
36acc7e523 | ||
|
|
700397a995 | ||
|
|
dc6bd89497 | ||
|
|
c2ed83d511 | ||
|
|
0a41da1659 | ||
|
|
96e412414a | ||
|
|
483476b5fa | ||
|
|
ed8bcf7dc8 | ||
|
|
376c7cf9a4 | ||
|
|
05d34d563d | ||
|
|
e59db6954a | ||
|
|
9c05fb399b | ||
|
|
40d4bc41c6 | ||
|
|
1f9a79db48 | ||
|
|
0943d38926 | ||
|
|
5469b56841 | ||
|
|
d31730b5c3 | ||
|
|
bd36ee7399 | ||
|
|
b8f5f57878 | ||
|
|
63de646eae | ||
|
|
e70ee44a37 | ||
|
|
6ee66fdccc | ||
|
|
5ecffa1352 | ||
|
|
46efc42e24 | ||
|
|
35829ce982 | ||
|
|
756ef4fae5 | ||
|
|
ce31a5a6ef | ||
|
|
14ea4d8d84 | ||
|
|
f2eb1464f6 | ||
|
|
45b464ee13 | ||
|
|
c3f9ea47fd | ||
|
|
87012d7671 | ||
|
|
1fce4055d7 | ||
|
|
b83dd501fc | ||
|
|
94a40a4a87 | ||
|
|
2fa867ce44 | ||
|
|
4d1a599263 | ||
|
|
8641c95169 | ||
|
|
4f6584ac27 | ||
|
|
cb25c5bf56 | ||
|
|
5c534ed388 | ||
|
|
368bf0ee15 | ||
|
|
c9ccf3e7f8 | ||
|
|
0ced94cb57 | ||
|
|
b158e11e25 | ||
|
|
f4658daa9a | ||
|
|
56b4ccb848 | ||
|
|
2748eeb367 | ||
|
|
8647578802 | ||
|
|
3422c20322 | ||
|
|
4561b06428 | ||
|
|
652f239af3 | ||
|
|
c2428ff7c2 | ||
|
|
2d5e592622 | ||
|
|
3a569a2e2e | ||
|
|
f600764364 | ||
|
|
ab2669b555 | ||
|
|
f43a81de3f | ||
|
|
33ae3fa48a | ||
|
|
12fc3eee03 | ||
|
|
396954e0ee | ||
|
|
d65aaa6da6 | ||
|
|
ae67833cb2 | ||
|
|
4261652bdf | ||
|
|
49d83a297f | ||
|
|
b3a48b23ee | ||
|
|
b802f9b02e | ||
|
|
0afdb9c2cf | ||
|
|
c295430866 | ||
|
|
883375dc9b | ||
|
|
6a1208b45d | ||
|
|
25084b7a94 | ||
|
|
c325c9c30c | ||
|
|
d89409cc73 | ||
|
|
0ff564a192 | ||
|
|
930804cf48 | ||
|
|
699981d9a2 | ||
|
|
947c966660 | ||
|
|
554d9a5d0b | ||
|
|
45e5c39739 | ||
|
|
74e540cb61 | ||
|
|
c1ec50e166 | ||
|
|
58ce18f981 | ||
|
|
f1fa98880f | ||
|
|
0c754d09ed | ||
|
|
b40e4fcc26 | ||
|
|
a7bb33c3a0 | ||
|
|
c3930b2e08 | ||
|
|
979180860e | ||
|
|
61fb70975c | ||
|
|
1af9f7c915 | ||
|
|
810411de7e | ||
|
|
b9bf9ca10d | ||
|
|
526c16daa9 | ||
|
|
e58104d5b5 | ||
|
|
92aeb3c8aa | ||
|
|
3841611780 | ||
|
|
06bc8c9e2d | ||
|
|
21415c6f8d | ||
|
|
22c2a7aa52 | ||
|
|
0eb181f315 | ||
|
|
45b431f953 | ||
|
|
bbee554fec | ||
|
|
c4c67f489e | ||
|
|
4d867d6523 | ||
|
|
6620c11178 | ||
|
|
db06cab07c | ||
|
|
90b11cdd97 | ||
|
|
7bb92d1b4e | ||
|
|
b5dd744bd5 | ||
|
|
34903b10d4 | ||
|
|
0c5b7c8b70 | ||
|
|
cdffca98ef | ||
|
|
ce30d1d5fd | ||
|
|
ab067044f8 | ||
|
|
3e04b8bbe6 | ||
|
|
4556a9e244 | ||
|
|
e5d04de250 | ||
|
|
b7df181729 | ||
|
|
2fd3fcfd46 | ||
|
|
73251d70fa | ||
|
|
971f98beb3 | ||
|
|
abe1da35a0 | ||
|
|
29885f3ac9 | ||
|
|
56d2a98a5b | ||
|
|
43342fff00 | ||
|
|
51d4dec6d3 | ||
|
|
81dc38d242 | ||
|
|
863f9d91c8 | ||
|
|
4c99cca7ff | ||
|
|
b807b96b5f | ||
|
|
91c9a7a99c | ||
|
|
778e2b0afb | ||
|
|
c9055ef7b8 | ||
|
|
e60b95efb8 | ||
|
|
9ca70a601b | ||
|
|
6cacc56ea8 | ||
|
|
6d142f082c | ||
|
|
db3b13800b | ||
|
|
7fe0cc9527 | ||
|
|
b62fee89cb | ||
|
|
d88443814f | ||
|
|
dfeab56bb5 | ||
|
|
b623727b1a | ||
|
|
048b683cb2 | ||
|
|
35b384af53 | ||
|
|
cebfa27d59 | ||
|
|
c57de3a21f | ||
|
|
4ad5e47758 | ||
|
|
f06ed4529c | ||
|
|
8da321bdc2 | ||
|
|
920b11e3e9 | ||
|
|
d8dd88c6a7 | ||
|
|
ba28b6d10c | ||
|
|
50ae1789bf | ||
|
|
bd9784a516 | ||
|
|
0bafde9914 | ||
|
|
b3bfe6035f | ||
|
|
c3cf795e9a | ||
|
|
cefc7860b3 | ||
|
|
b8963cd3a9 | ||
|
|
32290dd504 | ||
|
|
2702f850c2 | ||
|
|
2e10249f27 | ||
|
|
04a375328c | ||
|
|
97ef1ddc27 | ||
|
|
4057d86176 | ||
|
|
654f7b9ac4 | ||
|
|
91afc4af31 | ||
|
|
1440908820 | ||
|
|
4ce58cf5d1 | ||
|
|
620794dc57 | ||
|
|
128eeec6b5 | ||
|
|
33468d5ded | ||
|
|
96e5bb9a7d | ||
|
|
6300b29ab5 | ||
|
|
a0e2cbf756 | ||
|
|
4a36d3e7f1 | ||
|
|
ab0d483cb1 | ||
|
|
cdd0514ca0 | ||
|
|
cf3091421f | ||
|
|
15fb3d15c0 | ||
|
|
45532ca9b7 | ||
|
|
6714bbb510 | ||
|
|
77f2314b24 | ||
|
|
dcd6390dbf | ||
|
|
ecac1dc8af | ||
|
|
b3174171c4 | ||
|
|
a0608bf032 | ||
|
|
c920eb1fe4 | ||
|
|
6cf1206716 | ||
|
|
dca8ed7392 | ||
|
|
55bdaef897 | ||
|
|
2cc9f0ba8c | ||
|
|
496c17276d | ||
|
|
6a54ea1cca | ||
|
|
3b79a5c93f | ||
|
|
f6e2a3b049 | ||
|
|
379c84c22e | ||
|
|
42e4ae298b | ||
|
|
f3b00c83ce | ||
|
|
fdcba3f6e6 | ||
|
|
24cb04cdef | ||
|
|
e47d2c91b1 | ||
|
|
ff0b574c45 | ||
|
|
279ca757d9 | ||
|
|
08d54e13c0 | ||
|
|
5aa6177b50 | ||
|
|
73c4e96359 | ||
|
|
cf1ac67cb0 | ||
|
|
0bb8133764 | ||
|
|
eb114d72f3 | ||
|
|
233d4ad054 | ||
|
|
6852ec1255 | ||
|
|
df51ca165b | ||
|
|
a59655d628 | ||
|
|
0aa0672815 | ||
|
|
1ecc83489b | ||
|
|
9bb5edd7d0 | ||
|
|
e084606ce8 | ||
|
|
e23c0090f4 | ||
|
|
4cd29b5230 | ||
|
|
3aba6aacc7 | ||
|
|
4723b864c4 | ||
|
|
0c61fa6c68 | ||
|
|
2d9642ff6f | ||
|
|
59ee8e5a48 | ||
|
|
e894471b0d | ||
|
|
b2fe8c3304 | ||
|
|
f2a0fc0d47 | ||
|
|
cdbfa1bab8 | ||
|
|
15bed6f696 | ||
|
|
318c4af68f | ||
|
|
c5004c3ff6 | ||
|
|
31c1adcee4 | ||
|
|
53f44f498c | ||
|
|
4258192f24 | ||
|
|
c59b3cdf27 | ||
|
|
687bc40097 | ||
|
|
ab211d6433 | ||
|
|
65108a0630 | ||
|
|
8c740a5062 | ||
|
|
8897c65b98 | ||
|
|
0a44d5c27a | ||
|
|
4cffd8e864 | ||
|
|
bff8bcf939 | ||
|
|
774982113a | ||
|
|
d1981c34e3 | ||
|
|
275e037ea2 | ||
|
|
3c85722c00 | ||
|
|
db4cd9bbbe | ||
|
|
b764aedb0c | ||
|
|
bfd648b34f | ||
|
|
8033d749c2 | ||
|
|
ddf2e28901 | ||
|
|
0e7e6ab934 | ||
|
|
f8da7923aa | ||
|
|
d3e58b823d | ||
|
|
f0ab3d0d79 | ||
|
|
316cb10ece | ||
|
|
f6f27986b2 | ||
|
|
5123218d6b | ||
|
|
3d4f430a6d | ||
|
|
bf13e341a4 | ||
|
|
26ca34ecde | ||
|
|
1689e39f6f | ||
|
|
ccc7be93f2 | ||
|
|
d603de9c69 | ||
|
|
f05c39b687 | ||
|
|
98ee3c97f8 | ||
|
|
db7c41e12a | ||
|
|
e75c81c071 | ||
|
|
9f8767f2b8 | ||
|
|
3fbc36a3e4 |
10
.gitattributes
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
*.psd filter=lfs diff=lfs merge=lfs -text
|
||||
*.ogg filter=lfs diff=lfs merge=lfs -text
|
||||
*.tga filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.opus filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.kra filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.wav filter=lfs diff=lfs merge=lfs -text
|
||||
13
.gitignore
vendored
Normal file → Executable file
@@ -1,2 +1,15 @@
|
||||
demo/out/*
|
||||
demo/lib/*
|
||||
demo/assets/*
|
||||
out/*
|
||||
lib/*
|
||||
Terrarum-sans-bitmap*.zip
|
||||
TerrarumSansBitmap*.jar
|
||||
Font*.jar
|
||||
tmp_*
|
||||
*~
|
||||
.tmp*
|
||||
tmp_*
|
||||
*.bak
|
||||
*-autosave.kra
|
||||
.directory
|
||||
|
||||
1
.idea/.name
generated
Executable file
@@ -0,0 +1 @@
|
||||
BuildJAR_TerrarumSansBitmap
|
||||
87
.idea/artifacts/FontDemoGDX.xml
generated
Executable file
@@ -0,0 +1,87 @@
|
||||
<component name="ArtifactManager">
|
||||
<artifact type="jar" name="FontDemoGDX">
|
||||
<output-path>$PROJECT_DIR$/</output-path>
|
||||
<root id="archive" name="FontDemoGDX.jar">
|
||||
<element id="module-output" name="FontTestGDX" />
|
||||
<element id="directory" name="META-INF">
|
||||
<element id="file-copy" path="$PROJECT_DIR$/FontTestGDX/META-INF/MANIFEST.MF" />
|
||||
</element>
|
||||
<element id="artifact" artifact-name="TerrarumSansBitmap" />
|
||||
<element id="extracted-dir" path="$KOTLIN_BUNDLED$/lib/kotlin-stdlib.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$KOTLIN_BUNDLED$/lib/kotlin-reflect.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$KOTLIN_BUNDLED$/lib/kotlin-test.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$KOTLIN_BUNDLED$/lib/kotlin-stdlib-jdk7.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$KOTLIN_BUNDLED$/lib/kotlin-stdlib-jdk8.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jnlp.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-1.10.0.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jinput-2.0.5.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jutils-1.0.0.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jorbis-0.0.17.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jlayer-1.0.1-gdx.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/TerrarumSansBitmap.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-1.10.0-javadoc.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-1.10.0-sources.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-platform-1.10.0.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-javadoc.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-sources.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jinput-2.0.5-javadoc.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jinput-2.0.5-sources.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jutils-1.0.0-javadoc.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jutils-1.0.0-sources.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jorbis-0.0.17-javadoc.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jorbis-0.0.17-sources.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jlayer-1.0.1-gdx-javadoc.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jlayer-1.0.1-gdx-sources.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-javadoc.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-sources.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-backend-lwjgl3-1.10.0.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-natives-linux.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-natives-macos.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-javadoc.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-sources.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-javadoc.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-sources.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-natives-windows.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-javadoc.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-sources.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-natives-linux.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-natives-macos.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-natives-linux-arm32.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-natives-linux-arm64.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-natives-windows-x86.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-natives-windows.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-natives-linux.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-natives-macos.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-natives-linux.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-natives-macos.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-backend-lwjgl3-1.10.0-javadoc.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-backend-lwjgl3-1.10.0-sources.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jinput-platform-2.0.5-natives-osx.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-natives-linux.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-natives-macos.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-natives-windows.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-natives-windows.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-platform-1.10.0-natives-desktop.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jinput-platform-2.0.5-natives-linux.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-natives-linux-arm32.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-natives-linux-arm64.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-natives-windows-x86.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-natives-windows.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jinput-platform-2.0.5-natives-windows.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-natives-linux-arm32.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-natives-linux-arm64.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-natives-windows-x86.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-natives-linux-arm32.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-natives-linux-arm64.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-natives-windows-x86.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-natives-linux-arm32.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-natives-linux-arm64.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-natives-windows-x86.jar" path-in-jar="/" />
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
||||
12
.idea/artifacts/TerrarumSansBitmap.xml
generated
Executable file
@@ -0,0 +1,12 @@
|
||||
<component name="ArtifactManager">
|
||||
<artifact type="jar" name="TerrarumSansBitmap">
|
||||
<output-path>$PROJECT_DIR$/lib</output-path>
|
||||
<root id="archive" name="TerrarumSansBitmap.jar">
|
||||
<element id="module-output" name="BuildJAR_TerrarumSansBitmap" />
|
||||
<element id="directory" name="META-INF">
|
||||
<element id="file-copy" path="$PROJECT_DIR$/META-INF/MANIFEST.MF" />
|
||||
</element>
|
||||
<element id="dir-copy" path="$PROJECT_DIR$/src" />
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
||||
9
.idea/codeStyles/Project.xml
generated
Executable file
@@ -0,0 +1,9 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<codeStyleSettings language="kotlin">
|
||||
<option name="ELSE_ON_NEW_LINE" value="true" />
|
||||
<option name="CATCH_ON_NEW_LINE" value="true" />
|
||||
<option name="FINALLY_ON_NEW_LINE" value="true" />
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
5
.idea/codeStyles/codeStyleConfig.xml
generated
Executable file
@@ -0,0 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
||||
7
.idea/kotlinc.xml
generated
Executable file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinCommonCompilerArguments">
|
||||
<option name="apiVersion" value="1.4" />
|
||||
<option name="languageVersion" value="1.4" />
|
||||
</component>
|
||||
</project>
|
||||
19
.idea/libraries/KotlinJavaRuntime.xml
generated
Normal file
@@ -0,0 +1,19 @@
|
||||
<component name="libraryTable">
|
||||
<library name="KotlinJavaRuntime">
|
||||
<CLASSES>
|
||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-stdlib.jar!/" />
|
||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-reflect.jar!/" />
|
||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-test.jar!/" />
|
||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-stdlib-jdk7.jar!/" />
|
||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-stdlib-jdk8.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-stdlib-sources.jar!/" />
|
||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-reflect-sources.jar!/" />
|
||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-test-sources.jar!/" />
|
||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-stdlib-jdk7-sources.jar!/" />
|
||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-stdlib-jdk8-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@@ -1,8 +1,6 @@
|
||||
<component name="libraryTable">
|
||||
<library name="KotlinJavaRuntime">
|
||||
<library name="lib">
|
||||
<CLASSES>
|
||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-runtime.jar!/" />
|
||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-reflect.jar!/" />
|
||||
<root url="file://$PROJECT_DIR$/lib" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
@@ -10,8 +8,9 @@
|
||||
<root url="file://$PROJECT_DIR$/lib" />
|
||||
</NATIVE>
|
||||
<SOURCES>
|
||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-runtime-sources.jar!/" />
|
||||
<root url="file://$PROJECT_DIR$/lib" />
|
||||
</SOURCES>
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" />
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" type="SOURCES" />
|
||||
</library>
|
||||
</component>
|
||||
71
.idea/markdown-navigator.xml
generated
Executable file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MarkdownProjectSettings">
|
||||
<PreviewSettings splitEditorLayout="SPLIT" splitEditorPreview="PREVIEW" useGrayscaleRendering="false" zoomFactor="1.0" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="true" highlightPreviewType="NONE" highlightFadeOut="5" highlightOnTyping="true" synchronizeSourcePosition="true" verticallyAlignSourceAndPreviewSyncPosition="true" showSearchHighlightsInPreview="false" showSelectionInPreview="true">
|
||||
<PanelProvider>
|
||||
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.panel" providerName="Default - Swing" />
|
||||
</PanelProvider>
|
||||
</PreviewSettings>
|
||||
<ParserSettings gitHubSyntaxChange="false">
|
||||
<PegdownExtensions>
|
||||
<option name="ABBREVIATIONS" value="false" />
|
||||
<option name="ANCHORLINKS" value="true" />
|
||||
<option name="ASIDE" value="false" />
|
||||
<option name="ATXHEADERSPACE" value="true" />
|
||||
<option name="AUTOLINKS" value="true" />
|
||||
<option name="DEFINITIONS" value="false" />
|
||||
<option name="DEFINITION_BREAK_DOUBLE_BLANK_LINE" value="false" />
|
||||
<option name="FENCED_CODE_BLOCKS" value="true" />
|
||||
<option name="FOOTNOTES" value="false" />
|
||||
<option name="HARDWRAPS" value="false" />
|
||||
<option name="INSERTED" value="false" />
|
||||
<option name="QUOTES" value="false" />
|
||||
<option name="RELAXEDHRULES" value="true" />
|
||||
<option name="SMARTS" value="false" />
|
||||
<option name="STRIKETHROUGH" value="true" />
|
||||
<option name="SUBSCRIPT" value="false" />
|
||||
<option name="SUPERSCRIPT" value="false" />
|
||||
<option name="SUPPRESS_HTML_BLOCKS" value="false" />
|
||||
<option name="SUPPRESS_INLINE_HTML" value="false" />
|
||||
<option name="TABLES" value="true" />
|
||||
<option name="TASKLISTITEMS" value="true" />
|
||||
<option name="TOC" value="false" />
|
||||
<option name="WIKILINKS" value="true" />
|
||||
</PegdownExtensions>
|
||||
<ParserOptions>
|
||||
<option name="COMMONMARK_LISTS" value="true" />
|
||||
<option name="DUMMY" value="false" />
|
||||
<option name="EMOJI_SHORTCUTS" value="true" />
|
||||
<option name="FLEXMARK_FRONT_MATTER" value="false" />
|
||||
<option name="GFM_LOOSE_BLANK_LINE_AFTER_ITEM_PARA" value="false" />
|
||||
<option name="GFM_TABLE_RENDERING" value="true" />
|
||||
<option name="GITBOOK_URL_ENCODING" value="false" />
|
||||
<option name="GITHUB_EMOJI_URL" value="false" />
|
||||
<option name="GITHUB_LISTS" value="false" />
|
||||
<option name="GITHUB_WIKI_LINKS" value="true" />
|
||||
<option name="JEKYLL_FRONT_MATTER" value="false" />
|
||||
<option name="SIM_TOC_BLANK_LINE_SPACER" value="true" />
|
||||
</ParserOptions>
|
||||
</ParserSettings>
|
||||
<HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true">
|
||||
<GeneratorProvider>
|
||||
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.generator" providerName="Default Swing HTML Generator" />
|
||||
</GeneratorProvider>
|
||||
<headerTop />
|
||||
<headerBottom />
|
||||
<bodyTop />
|
||||
<bodyBottom />
|
||||
</HtmlSettings>
|
||||
<CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssTextEnabled="false" isDynamicPageWidth="true">
|
||||
<StylesheetProvider>
|
||||
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.css" providerName="Default Swing Stylesheet" />
|
||||
</StylesheetProvider>
|
||||
<ScriptProviders />
|
||||
<cssText />
|
||||
</CssSettings>
|
||||
<HtmlExportSettings updateOnSave="false" parentDir="$ProjectFileDir$" targetDir="$ProjectFileDir$" cssDir="" scriptDir="" plainHtml="false" imageDir="" copyLinkedImages="false" imageUniquifyType="0" targetExt="" useTargetExt="false" noCssNoScripts="false" linkToExportedHtml="true" exportOnSettingsChange="true" regenerateOnProjectOpen="false" />
|
||||
<LinkMapSettings>
|
||||
<textMaps />
|
||||
</LinkMapSettings>
|
||||
</component>
|
||||
</project>
|
||||
3
.idea/markdown-navigator/profiles_settings.xml
generated
Executable file
@@ -0,0 +1,3 @@
|
||||
<component name="MarkdownNavigator.ProfileManager">
|
||||
<settings default="" pdf-export="" />
|
||||
</component>
|
||||
2
demo/.idea/misc.xml → .idea/misc.xml
generated
Normal file → Executable file
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8.0_242" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
9
.idea/modules.xml
generated
Executable file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/BuildJAR_TerrarumSansBitmap.iml" filepath="$PROJECT_DIR$/BuildJAR_TerrarumSansBitmap.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/FontTestGDX/FontTestGDX.iml" filepath="$PROJECT_DIR$/FontTestGDX/FontTestGDX.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Executable file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
210
.idea/workspace.xml
generated
Executable file
@@ -0,0 +1,210 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ArtifactsWorkspaceSettings">
|
||||
<artifacts-to-build>
|
||||
<artifact name="TerrarumSansBitmap" />
|
||||
</artifacts-to-build>
|
||||
</component>
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="22c5bc80-996c-4846-b173-7dc8c2096fe3" name="Default" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/.idea/libraries/lib.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/libraries/badlogicgames_gdx.xml" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/libraries/badlogicgames_gdx_backend_lwjgl3.xml" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/runConfigurations.xml" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/BuildJAR_TerrarumSansBitmap.iml" beforeDir="false" afterPath="$PROJECT_DIR$/BuildJAR_TerrarumSansBitmap.iml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/FontTestGDX/FontTestGDX.iml" beforeDir="false" afterPath="$PROJECT_DIR$/FontTestGDX/FontTestGDX.iml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/assets/ascii_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/ascii_variable.tga" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/assets/cyrilic_bulgarian_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/cyrilic_bulgarian_variable.tga" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/assets/cyrilic_serbian_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/cyrilic_serbian_variable.tga" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/assets/cyrilic_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/cyrilic_variable.tga" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/assets/greek_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/greek_variable.tga" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/assets/latinExtA_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/latinExtA_variable.tga" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/assets/latinExtB_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/latinExtB_variable.tga" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/assets/latinExtC_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/latinExtC_variable.tga" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/assets/latinExtD_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/latinExtD_variable.tga" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/assets/latinExt_additional_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/latinExt_additional_variable.tga" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/demo.PNG" beforeDir="false" afterPath="$PROJECT_DIR$/demo.PNG" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/work_files/ascii_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/ascii_variable.psd" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/work_files/cyrilic_bulgarian_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/cyrilic_bulgarian_variable.psd" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/work_files/cyrilic_serbian_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/cyrilic_serbian_variable.psd" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/work_files/cyrilic_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/cyrilic_variable.psd" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/work_files/greek_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/greek_variable.psd" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/work_files/latinExtA_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/latinExtA_variable.psd" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/work_files/latinExtB_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/latinExtB_variable.psd" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/work_files/latinExtC_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/latinExtC_variable.psd" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/work_files/latinExtD_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/latinExtD_variable.psd" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/work_files/latinExt_additional_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/latinExt_additional_variable.psd" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="Kotlin Class" />
|
||||
<option value="Interface" />
|
||||
<option value="Class" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="GitSEFilterConfiguration">
|
||||
<file-type-list>
|
||||
<filtered-out-file-type name="LOCAL_BRANCH" />
|
||||
<filtered-out-file-type name="REMOTE_BRANCH" />
|
||||
<filtered-out-file-type name="TAG" />
|
||||
<filtered-out-file-type name="COMMIT_BY_MESSAGE" />
|
||||
</file-type-list>
|
||||
</component>
|
||||
<component name="ProjectId" id="1aVE5t6KObkWt36lb07GBy1GY1S" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="Downloaded.Files.Path.Enabled" value="false" />
|
||||
<property name="Repository.Attach.Annotations" value="false" />
|
||||
<property name="Repository.Attach.JavaDocs" value="false" />
|
||||
<property name="Repository.Attach.Sources" value="false" />
|
||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
||||
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
|
||||
<property name="SearchEverywhereHistoryKey" value="HashMap	PSI	JAVA://java.util.HashMap soft wr	ACTION	EditorToggleUseSoftWraps" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/lib" />
|
||||
<property name="project.structure.last.edited" value="Libraries" />
|
||||
<property name="project.structure.proportion" value="0.15" />
|
||||
<property name="project.structure.side.proportion" value="0.32068965" />
|
||||
<property name="settings.editor.selected.configurable" value="preferences.keymap" />
|
||||
</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="C:\Users\minjaesong\Documents\Terrarum-sans-bitmap\" />
|
||||
<recent name="C:\Users\minjaesong\Documents\Terrarum-sans-bitmap" />
|
||||
<recent name="C:\Users\minjaesong\Documents\Terrarum-sans-bitmap\FontTestGDX\src" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<configuration default="true" type="Applet">
|
||||
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration default="true" type="executeSpecs" factoryName="Gauge Execution">
|
||||
<setting name="environment" value="" />
|
||||
<setting name="specsToExecute" value="" />
|
||||
<setting name="tags" value="" />
|
||||
<setting name="parallelNodes" value="" />
|
||||
<setting name="execInParallel" value="false" />
|
||||
<setting name="programParameters" value="" />
|
||||
<setting name="workingDirectory" value="" />
|
||||
<setting name="moduleName" value="" />
|
||||
<envMap />
|
||||
<setting name="rowsRange" value="" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="Application" factoryName="Application">
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration default="true" type="JUnit" factoryName="JUnit">
|
||||
<option name="TEST_OBJECT" value="class" />
|
||||
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="FontTestGDXKt" type="JetRunConfigurationType" temporary="true">
|
||||
<option name="MAIN_CLASS_NAME" value="FontTestGDXKt" />
|
||||
<module name="FontTestGDX" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
<option name="BuildArtifacts" enabled="true">
|
||||
<artifact name="TerrarumSansBitmap" />
|
||||
</option>
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType">
|
||||
<option name="filePath" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration default="true" type="TestNG">
|
||||
<option name="TEST_OBJECT" value="CLASS" />
|
||||
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
|
||||
<properties />
|
||||
<listeners />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" />
|
||||
<predefined_log_file enabled="true" id="idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="Kotlin.FontTestGDXKt" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="SvnConfiguration">
|
||||
<configuration />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="22c5bc80-996c-4846-b173-7dc8c2096fe3" name="Default" comment="" />
|
||||
<created>1497950823354</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1497950823354</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TodoView">
|
||||
<todo-panel id="selected-file">
|
||||
<is-autoscroll-to-source value="true" />
|
||||
</todo-panel>
|
||||
<todo-panel id="all">
|
||||
<are-packages-shown value="true" />
|
||||
<is-autoscroll-to-source value="true" />
|
||||
</todo-panel>
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
<option name="oldMeFiltersMigrated" value="true" />
|
||||
</component>
|
||||
<component name="XSLT-Support.FileAssociations.UIState">
|
||||
<expand />
|
||||
<select />
|
||||
</component>
|
||||
<component name="antWorkspaceConfiguration">
|
||||
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
|
||||
<option name="FILTER_TARGETS" value="false" />
|
||||
</component>
|
||||
</project>
|
||||
13
BuildJAR_TerrarumSansBitmap.iml
Executable file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
||||
<orderEntry type="library" name="lib" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
260
CONTRIBUTING.md
Executable file
@@ -0,0 +1,260 @@
|
||||
#### Pixel Artists Wanted: for Arabic (all four forms) and other Indian scripts (all the ligatures). Must willing to follow the styles and have a knowledge in Unicode. Your name will be inscribed in the list of contributors.
|
||||
|
||||
You can contribute to the font by fixing wrong glyphs, suggesting better ones, extending character set (letters for other writing systems or filling in the blanks on the existing ones), or code for other game frameworks (not limited to Java). Please leave pull request for that.
|
||||
|
||||
Font Spritesheets are stored in ```assets/graphics/fonts``` directory. Image format must be TGA with Alpha — no PNG. If someone needs PNG, they can batch-convert the font using utils like ImageMagick.
|
||||
|
||||
|
||||
#### Before getting started, you did read our design goals, right? Good. Now you may continue your awesome work.
|
||||
|
||||
## Ascenders, descenders, width informations (aka Glyph Tags)
|
||||
|
||||

|
||||
|
||||
Above image is a reference you can use while you draw some letters. Capital B is drawn as a reference. Orange-tinted area is for lowercase, x-height must be the same as that of said tinted area (lowercase Alpha is also drawn for the reference). NOTE THAT x-height is taller than centre bar (capital A is an exception). Height of the ascender of the lowercase letters must be the same as height of capital letters.
|
||||
|
||||
Red-tinted area SHOULD NOT CONTAIN any dots, it's emptied for compatibility. (Slick2d—you can define size of "gaps" of the spritesheet, but you can't define horizontal and vertical gap separately)
|
||||
|
||||
Blue-tinted area cotains width of the glyph in binary, uppermost dot is the Least Significant Bit.
|
||||
|
||||
Green-tinted area contains extra informations, left blank for most cases. We'll call it Glyph Tags.
|
||||
|
||||
Tinted-in-magenta shows the height where diacritics should be placed, for both uppercase and lowercase.
|
||||
|
||||
Each cell is 16 px wide, and any glyph you draw **must be contained within leftside FIFTEEN pixels**.
|
||||
|
||||
|
||||
|
||||
|
||||
## Font Metrics for variable-width font sheets
|
||||
|
||||
Although the font is basically a Spritesheet, some of the sheet expects variable widths to be supported. Any sheets with ```_variable``` means it expects variable widths. Anything else expects fixed width (regular Spritesheet behaviour). ```cjkpunct``` has width of 10, ```kana``` and ```hangul_johab``` has width of 12, ```wenquanyi``` has width of 16.
|
||||
|
||||
### Parsing Glyph Tags
|
||||
|
||||

|
||||
|
||||
Width is encoded in binary bits, on pixels. On the font spritesheet, every glyph has vertical dots on their top-right side (to be exact, every (16k - 1)th pixel on x axis). Above image is a sample of the font, with width information coloured in magenta. From top to bottom, each dot represents 1, 2, 4 and 8. For example, in the above image, ! (exclamation mark) has width of 5, " (double quote) has width of 6, # (octothorp) has width of 8, $ (dollar sign) has width of 9.
|
||||
|
||||
### Glyph Tags
|
||||
|
||||
Rightmost vertical column (should be 20 px tall) contains the tags. Tags are defined as following:
|
||||
|
||||
```
|
||||
(LSB) W -,
|
||||
W |
|
||||
W |= Width of the character
|
||||
W |
|
||||
W -'
|
||||
m --Is this character lowheight?
|
||||
K -,
|
||||
K |= Tags used by the "Keming Machine"
|
||||
K -'
|
||||
Q ---Compiler Directive (see below)
|
||||
n --,
|
||||
Y -, `-Nudging Bits (see below)
|
||||
X |
|
||||
Y |= Diacritics Anchor Points (see below)
|
||||
X -'
|
||||
A -,_ 0 Align 1 Align 0 Align 1 Align before
|
||||
A -' 0 Left 0 Right 1 Centre 1 the glyph
|
||||
D --Diacritics Type Bit (see below; not all diacritics are actually marked as a diacritics on the spritesheet)
|
||||
S -,_ 0 Stack 1 Stack 0 Before 1 Up &
|
||||
(MSB) S -' 0 up 0 down 1 &After 1 Down* (e.g. U+0C48)
|
||||
|
||||
Align Centre and Align Right will respect the diacritics anchor points.
|
||||
The Align Right AND Custom anchor point is being used for Thai diacritics.
|
||||
When a width AND diacritics type bit is set, the entire glyph is shifted to the right as specified and the space of same width will be inserted.
|
||||
(See SUNDANESE PAMINGKAL U+1BA1)
|
||||
|
||||
Up&Down:
|
||||
1. when two pixels are both #00FF00 it's "don't stack"
|
||||
2. otherwise, it's actually up&down
|
||||
|
||||
```
|
||||
|
||||
#### Nudging Bits Encoding
|
||||
|
||||
<MSB,Red> SXXXXXXX SYYYYYYY 00000000 <LSB,Blue>
|
||||
|
||||
Each X and Y numbers are Signed 8-Bit Integer.
|
||||
|
||||
X-positive: nudges towards left
|
||||
Y-positive: nudges towards up
|
||||
|
||||
#### Diacritics Anchor Point Encoding
|
||||
|
||||
4 Pixels are further divided as follows:
|
||||
|
||||
| LSB | | Red | Green | Blue |
|
||||
| ------------ | ------------ | ------------ | ------------ | ------------ |
|
||||
| Y | Anchor point Y for: | undefined | undefined | undefined |
|
||||
| X | Anchor point X for: | undefined | undefined | undefined |
|
||||
| Y | Anchor point Y for: | (unused) | (unused) | (unused) |
|
||||
| X | Anchor point X for: | Type-0 | Type-1 | Type-2 |
|
||||
| **MSB** | | | | |
|
||||
|
||||
<MSB,Red> 1Y1Y1Y1Y 1Y2Y2Y2Y 1Y3Y3Y3Y <LSB,Blue>
|
||||
<MSB,Red> 1X1X1X1X 1X2X2X2X 1X3X3X3X <LSB,Blue>
|
||||
|
||||
where Red is first, Green is second, Blue is the third diacritics.
|
||||
MSB for each word must be set so that the pixel would appear brighter on the image editor.
|
||||
(the font program will only read low 7 bits for each RGB channel)
|
||||
|
||||
#### Diacritics Type Bit Encoding
|
||||
|
||||
<MSB,Red> FFFFFFFF FFFFFFFF FFFFFFFF <LSB,Blue> (For Type-0)
|
||||
<MSB,Red> TTTT0000 00000000 00000000 <LSB,Blue> (For Type-1 to Type-15)
|
||||
|
||||
Certain types of diacritics have predefined meanings (but some writing systems define their own meaning e.g. Devanagari):
|
||||
|
||||
* Type-0: Above
|
||||
* Type-1: Below (when it should be separated from being above)
|
||||
* Type-2: Overlaid (will shift down 2 pixels for lowheight glyphs instead of the default of 4 pixels)
|
||||
|
||||
|
||||
#### Compiler Directives
|
||||
|
||||
<MSB,Red> [Opcode] [arg1] [arg2] <LSB,Blue>
|
||||
|
||||
Currently supported opcodes:
|
||||
|
||||
*00000000: No-operation; does not use the Compiler Directive system.
|
||||
|
||||
*10000111: Replace a character with maximum 7 subchars.
|
||||
Replacement characters are encoded vertically from X-zero, bit by bit
|
||||
(colour of the pixel doesn't matter) with LSB sitting on Y-zero.
|
||||
|
||||
*11111111: Tagging Used by the Subsystems. e.g. #FF0000 marks invalid combination.
|
||||
|
||||
#### Stack Up/Down
|
||||
|
||||
When the tag is stack-up, it'll be drawn 4 px lower if the underlying
|
||||
character is lowercase.
|
||||
|
||||
#### Align-To-This-X-Pos
|
||||
|
||||
Since this tag does not make sense for diacritics, they will use the value for compeletely different purpose:
|
||||
|
||||
0 : Nothing special
|
||||
1 : Covers previous character; it's neither stack-up nor down.
|
||||
Will be drawn 2 px lower if the underlying character is lowercase
|
||||
2 : Joiner.
|
||||
3..15: undefined
|
||||
|
||||
#### Diacritics That Comes Before and After
|
||||
|
||||
When this tag is set, the font compiler will replace this glyph with two extra code points given in the bitmap.
|
||||
|
||||
To implement those, this two extra code points are needed, which are provided in the Unicode's Reference Chart (www.unicode.org/charts/PDF/Uxxxx.pdf) The code points must be "drawn" in the bitmap, in the same manor as a tagging system. The zeroth column (x = 0) has the "before" character, the first column (x = 1) has the "after". All nineteen pixels (bits) are read by the font, which encompasses U+0000..U+EFFFF
|
||||
|
||||
For working examples, take a note at the bengali sprite sheet.
|
||||
|
||||
This tag can be used as a general "replace this with these" directive, as long as you're replacing it into two letters. This directive is exploited to construct dutch ligature "IJ" (U+0132 and U+0133), in the sheet LatinExtA.
|
||||
|
||||
Also note that the font compiler will not "stack" these diacritics.
|
||||
|
||||
#### The Keming Machine Tags
|
||||
|
||||
Keming Machine Tags define the rough shape of the glyph. Please read `keming_machine.txt` for further information.
|
||||
|
||||
|
||||
#### NOTES
|
||||
- If glyphs are right or centre aligned, they must be aligned in the same way inside of the bitmap; the font compiler assumes every variable-width glyphs to have a width of 15, regardless of the tagged width.
|
||||
- If the diacritic is aligned before the glyph, the diacritic itself is always assumed as left-aligned, as the font compiler will exchange position of said diacritic and the glyph right before it.
|
||||
|
||||

|
||||
|
||||
(fun fact: it was drawn on Rhodia memopad with Lamy 2000, then photographed and edited on my iPhone. Letter used is a Cherokee WE Ꮺ)
|
||||
|
||||
## Technical Limitations
|
||||
|
||||
- Each spritesheet is 4096x4096 maximum, which is a size of 4K Texture. However it is recommended to be smaller or equal to 1024x1024.
|
||||
- Glyphs exceeding 15px of width needs to be broken down with 2 or more characters. Wider sheets WILL NOT BE IMPLEMENTED, can't waste much pixels just for few superwide glyphs.
|
||||
- Due to how the compiler is coded, actual glyph must have alpha value of 255, the tags must have alpha values LESS THAN 255 (and obviously greater than zero). RGB plane of the TGA image doesn't do anything, keep it as #FFFFFF white.
|
||||
|
||||
## Implementation of the Korean writing system
|
||||
|
||||
On this font, Hangul letters are printed by assemblying two or three letter pieces. There are 10 sets of Hangul letter pieces on the font. Top 6 are initials, middle 2 are medials, and bottom 2 are finals. On the rightmost side, there's eight assembled glyphs to help you with (assuming you have basic knowledge on the writing system). Top 6 tells you how to use 6 initials, and bottom 2 tells you how to use 2 finals.
|
||||
|
||||
This is a Kotlin-like pseudocode for assembling the glyph:
|
||||
|
||||
// NOTE: this code implements modern Hangul only, in the unicode range of 0xAC00..0xD7A3.
|
||||
// the spritesheet is made to accomodate Johab encoding scheme, but can still be used with the following code.
|
||||
// for the code for full Johab encoding (U+1100.. that includes Old Korean), please refer to the actual code in the repo.
|
||||
|
||||
function getHanChosung(hanIndex: Int) = hanIndex / (21 * 28)
|
||||
function getHanJungseong(hanIndex: Int) = hanIndex / 28 % 21
|
||||
function getHanJongseong(hanIndex: Int) = hanIndex % 28
|
||||
|
||||
jungseongWide = arrayOf(9,13,14,18,19)
|
||||
jungseongComplex = arrayOf(10,11,12,15,16,17,20,23)
|
||||
|
||||
function getHanInitialRow(hanIndex: Int): Int {
|
||||
val ret: Int
|
||||
|
||||
if (isJungseongWide(hanIndex))
|
||||
ret = 2
|
||||
else if (isJungseongComplex(hanIndex))
|
||||
ret = 4
|
||||
else
|
||||
ret = 0
|
||||
|
||||
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
|
||||
}
|
||||
|
||||
function isJungseongWide(hanIndex: Int) = jungseongWide.contains(getHanJungseong(hanIndex))
|
||||
function isJungseongComplex(hanIndex: Int) = jungseongComplex.contains(getHanJungseong(hanIndex))
|
||||
|
||||
function getHanInitialRow(hanIndex: Int): Int {
|
||||
val ret: Int
|
||||
|
||||
if (isJungseongWide(hanIndex))
|
||||
ret = 2
|
||||
else if (isJungseongComplex(hanIndex))
|
||||
ret = 4
|
||||
else
|
||||
ret = 0
|
||||
|
||||
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
|
||||
}
|
||||
|
||||
function getHanMedialRow(hanIndex: Int) = if (getHanJongseong(hanIndex) == 0) 6 else 7
|
||||
|
||||
function getHanFinalRow(hanIndex: Int): Int {
|
||||
val jungseongIndex = getHanJungseong(hanIndex)
|
||||
|
||||
return if (jungseongWide.contains(jungseongIndex))
|
||||
8
|
||||
else
|
||||
9
|
||||
}
|
||||
|
||||
function isHangul(c: Char) = c.toInt() >= 0xAC00 && c.toInt() < 0xD7A4
|
||||
|
||||
...
|
||||
|
||||
for (each Char on the string) {
|
||||
if (isHangul(Char)) {
|
||||
val hIndex = Char.toInt() - 0xAC00
|
||||
|
||||
val indexCho = getHanChosung(hIndex)
|
||||
val indexJung = getHanJungseong(hIndex)
|
||||
val indexJong = getHanJongseong(hIndex)
|
||||
|
||||
val choRow = getHanInitialRow(hIndex)
|
||||
val jungRow = getHanMedialRow(hIndex)
|
||||
val jongRow = getHanFinalRow(hIndex)
|
||||
|
||||
// get sub image from sprite sheet
|
||||
val choseongImage = hangulSheet.getSubImage(indexCho, choRow)
|
||||
val jungseongImage = hangulSheet.getSubImage(indexJung, jungRow)
|
||||
val jongseongImage = hangulSheet.getSubImage(indexJong, jongRow)
|
||||
|
||||
// actual drawing part
|
||||
draw choseongImage to somewhere you want
|
||||
draw jungseongImage on top of choseongImage
|
||||
draw jongseongImage on top of choseongImage
|
||||
}
|
||||
...
|
||||
}
|
||||
9
CONTRIBUTORS.txt
Executable file
@@ -0,0 +1,9 @@
|
||||
Project Maintainer and Programmer
|
||||
|
||||
- minjaesong (Torvald)
|
||||
|
||||
|
||||
This font was not possible without following artists:
|
||||
|
||||
- minjaesong (Torvald)
|
||||
<< Append your name here. If you're getting consistent merge conflicts, push without this and leave a Issue on the GitHub page >>
|
||||
14
FontTestGDX/FontTestGDX.iml
Executable file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="BuildJAR_TerrarumSansBitmap" />
|
||||
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
||||
<orderEntry type="library" name="lib" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
3
FontTestGDX/META-INF/MANIFEST.MF
Executable file
@@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: FontTestGDXKt
|
||||
|
||||
285
FontTestGDX/src/FontTestGDX.kt
Executable file
@@ -0,0 +1,285 @@
|
||||
import com.badlogic.gdx.*
|
||||
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application
|
||||
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration
|
||||
import com.badlogic.gdx.files.FileHandle
|
||||
import com.badlogic.gdx.graphics.*
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.graphics.glutils.FrameBuffer
|
||||
import com.badlogic.gdx.utils.ScreenUtils
|
||||
import com.badlogic.gdx.utils.StreamUtils
|
||||
import net.torvald.terrarumsansbitmap.gdx.TerrarumSansBitmap
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import java.io.OutputStream
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2018-07-26.
|
||||
*/
|
||||
class FontTestGDX : Game() {
|
||||
|
||||
lateinit var font: TerrarumSansBitmap
|
||||
|
||||
lateinit var inputText: List<String>
|
||||
|
||||
lateinit var batch: SpriteBatch
|
||||
|
||||
lateinit var frameBuffer: FrameBuffer
|
||||
|
||||
lateinit var camera: OrthographicCamera
|
||||
|
||||
private val testing = false
|
||||
|
||||
private val demotextName = if (testing) "testtext.txt" else "demotext.txt"
|
||||
private val outimageName = if (testing) "testing.PNG" else "demo.PNG"
|
||||
|
||||
private lateinit var faketex: Texture
|
||||
|
||||
private val lineHeight = 24
|
||||
|
||||
override fun create() {
|
||||
font = TerrarumSansBitmap("./assets", debug = true, flipY = false, errorOnUnknownChar = false, shadowAlpha = 0.5f) // must test for two flipY cases
|
||||
|
||||
val inTextFile = Gdx.files.internal("./$demotextName")
|
||||
val reader = inTextFile.reader("UTF-8")
|
||||
inputText = reader.readLines()
|
||||
reader.close()
|
||||
|
||||
batch = SpriteBatch()
|
||||
|
||||
|
||||
// create faketex
|
||||
val fakepix = Pixmap(1,1,Pixmap.Format.RGBA8888)
|
||||
fakepix.drawPixel(0,0,-1)
|
||||
faketex = Texture(fakepix)
|
||||
fakepix.dispose()
|
||||
|
||||
frameBuffer = FrameBuffer(Pixmap.Format.RGBA8888, TEXW, TEXH, true)
|
||||
|
||||
camera = OrthographicCamera(TEXW.toFloat(), TEXH.toFloat())
|
||||
camera.translate(TEXW.div(2f), 0f)
|
||||
camera.setToOrtho(true, TEXW.toFloat(), TEXH.toFloat())
|
||||
camera.update()
|
||||
|
||||
|
||||
Gdx.input.inputProcessor = Navigator(this)
|
||||
}
|
||||
|
||||
override fun getScreen(): Screen? {
|
||||
return null
|
||||
}
|
||||
|
||||
var scrollOffsetY = 0f
|
||||
|
||||
override fun setScreen(screen: Screen?) {
|
||||
}
|
||||
|
||||
var tex: Texture? = null
|
||||
var screenshotExported = false
|
||||
|
||||
private val backcol = Color(.141f, .141f, .141f, 1f)
|
||||
|
||||
override fun render() {
|
||||
|
||||
if (tex == null) {
|
||||
frameBuffer.begin()
|
||||
|
||||
Gdx.gl.glClearColor(.141f, .141f, .141f, 1f)
|
||||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
|
||||
Gdx.gl.glEnable(GL20.GL_TEXTURE_2D)
|
||||
Gdx.gl.glEnable(GL20.GL_BLEND)
|
||||
batch.setBlendFunctionSeparate(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA, GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA) // for not premultiplied textures
|
||||
|
||||
batch.projectionMatrix = camera.combined
|
||||
batch.begin()
|
||||
|
||||
batch.color = backcol
|
||||
batch.draw(faketex, 0f, 0f, TEXW.toFloat(), TEXH.toFloat())
|
||||
batch.flush()
|
||||
|
||||
batch.color = Color.WHITE
|
||||
inputText.forEachIndexed { index, s ->
|
||||
font.draw(batch, s, 10f, TEXH - 30f - index * lineHeight)
|
||||
}
|
||||
|
||||
batch.end()
|
||||
|
||||
|
||||
// dump to file
|
||||
if (!screenshotExported) {
|
||||
val pixmap = ScreenUtils.getFrameBufferPixmap(0, 0, frameBuffer.width, frameBuffer.height)
|
||||
|
||||
PixmapIO.writePNG(Gdx.files.local(outimageName), pixmap)
|
||||
// writeTGA(Gdx.files.local(outimageName), pixmap, false)
|
||||
pixmap.dispose()
|
||||
|
||||
screenshotExported = true
|
||||
}
|
||||
|
||||
|
||||
frameBuffer.end()
|
||||
|
||||
///////////////
|
||||
|
||||
tex = frameBuffer.colorBufferTexture
|
||||
}
|
||||
|
||||
|
||||
Gdx.gl.glClearColor(.141f, .141f, .141f, 1f)
|
||||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
|
||||
Gdx.gl.glEnable(GL20.GL_TEXTURE_2D)
|
||||
Gdx.gl.glEnable(GL20.GL_BLEND)
|
||||
batch.setBlendFunctionSeparate(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA, GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA) // for not premultiplied textures
|
||||
|
||||
|
||||
batch.begin()
|
||||
batch.color = Color.WHITE
|
||||
batch.draw(tex, 0f, (TEXH.toFloat()/HEIGHT)*TEXH - scrollOffsetY, TEXW.toFloat(), -(TEXH.toFloat() / HEIGHT) * TEXH.toFloat())
|
||||
|
||||
|
||||
batch.end()
|
||||
}
|
||||
|
||||
override fun pause() {
|
||||
}
|
||||
|
||||
override fun resume() {
|
||||
}
|
||||
|
||||
override fun resize(width: Int, height: Int) {
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
font.dispose()
|
||||
faketex.dispose()
|
||||
}
|
||||
|
||||
fun scrollAdd(x: Int = 1) {
|
||||
scrollOffsetY -= (TEXH.toFloat() / HEIGHT) * lineHeight * x
|
||||
}
|
||||
|
||||
fun scrollSub(x: Int = 1) {
|
||||
scrollOffsetY += (TEXH.toFloat() / HEIGHT) * lineHeight * x
|
||||
}
|
||||
|
||||
class Navigator(val main: FontTestGDX) : InputAdapter() {
|
||||
override fun scrolled(amountX: Float, amountY: Float): Boolean {
|
||||
if (amountY >= 0)
|
||||
main.scrollSub(amountY.toInt())
|
||||
else
|
||||
main.scrollAdd(-amountY.toInt())
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun keyDown(keycode: Int): Boolean {
|
||||
if (keycode == Input.Keys.UP)
|
||||
main.scrollAdd()
|
||||
else if (keycode == Input.Keys.DOWN)
|
||||
main.scrollSub()
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Throws(IOException::class)
|
||||
private fun writeTGA(file: FileHandle, pixmap: Pixmap, flipY: Boolean) {
|
||||
val output = file.write(false)
|
||||
try {
|
||||
_writeTGA(output, pixmap, true, flipY)
|
||||
} finally {
|
||||
StreamUtils.closeQuietly(output)
|
||||
}
|
||||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
private fun _writeTGA(out: OutputStream, pixmap: Pixmap, verbatim: Boolean, flipY: Boolean) {
|
||||
val width: ByteArray = toShortLittle(pixmap.width)
|
||||
val height: ByteArray = toShortLittle(pixmap.height)
|
||||
val zero: ByteArray = toShortLittle(0)
|
||||
out.write(0) // ID field: empty
|
||||
out.write(0) // no colour map, but should be ignored anyway as it being unmapped RGB
|
||||
out.write(2) // 2 means unmapped RGB
|
||||
out.write(byteArrayOf(0, 0, 0, 0, 0)) // color map spec: empty
|
||||
out.write(zero) // x origin: 0
|
||||
out.write(zero) // y origin: 0
|
||||
out.write(width) // width
|
||||
out.write(height) // height
|
||||
out.write(32) // image pixel size: we're writing 32-bit image (8bpp BGRA)
|
||||
out.write(8) // image descriptor: dunno, Photoshop writes 8 in there
|
||||
|
||||
// write actual image data
|
||||
// since we're following Photoshop's conventional header, we also follows Photoshop's
|
||||
// TGA saving scheme, that is:
|
||||
// 1. BGRA order
|
||||
// 2. Y-Flipped but not X-Flipped
|
||||
if (!flipY) {
|
||||
for (y in pixmap.height - 1 downTo 0) {
|
||||
for (x in 0 until pixmap.width) {
|
||||
writeTga(x, y, verbatim, pixmap, out)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (y in 0 until pixmap.height) {
|
||||
for (x in 0 until pixmap.width) {
|
||||
writeTga(x, y, verbatim, pixmap, out)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// write footer
|
||||
// 00 00 00 00 00 00 00 00 TRUEVISION-XFILE 2E 00
|
||||
out.write(byteArrayOf(0, 0, 0, 0, 0, 0, 0, 0))
|
||||
if (verbatim) out.write("TRUEVISION-XFILE".toByteArray()) else out.write("TerrarumHappyTGA".toByteArray())
|
||||
out.write(byteArrayOf(0x2E, 0))
|
||||
out.flush()
|
||||
out.close()
|
||||
}
|
||||
|
||||
private val zeroalpha = byteArrayOf(0, 0, 0, 0)
|
||||
@Throws(IOException::class)
|
||||
private fun writeTga(x: Int, y: Int, verbatim: Boolean, pixmap: Pixmap, out: OutputStream) {
|
||||
val color = pixmap.getPixel(x, y)
|
||||
|
||||
// if alpha == 0, write special value instead
|
||||
if (verbatim && color and 0xFF == 0) {
|
||||
out.write(zeroalpha)
|
||||
} else {
|
||||
out.write(RGBAtoBGRA(color))
|
||||
}
|
||||
}
|
||||
|
||||
private fun toShortLittle(i: Int): ByteArray {
|
||||
return byteArrayOf(
|
||||
(i and 0xFF).toByte(),
|
||||
(i ushr 8 and 0xFF).toByte()
|
||||
)
|
||||
}
|
||||
|
||||
private fun RGBAtoBGRA(rgba: Int): ByteArray {
|
||||
return byteArrayOf(
|
||||
(rgba ushr 8 and 0xFF).toByte(),
|
||||
(rgba ushr 16 and 0xFF).toByte(),
|
||||
(rgba ushr 24 and 0xFF).toByte(),
|
||||
(rgba and 0xFF).toByte()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
lateinit var appConfig: Lwjgl3ApplicationConfiguration
|
||||
const val TEXW = 874
|
||||
const val TEXH = 24 * 130
|
||||
|
||||
const val WIDTH = TEXW
|
||||
const val HEIGHT = 768
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
appConfig = Lwjgl3ApplicationConfiguration()
|
||||
appConfig.useVsync(false)
|
||||
appConfig.setResizable(false)
|
||||
appConfig.setWindowedMode(WIDTH, HEIGHT)
|
||||
appConfig.setTitle("Terrarum Sans Bitmap Test")
|
||||
|
||||
Lwjgl3Application(FontTestGDX(), appConfig)
|
||||
}
|
||||
247
FontTestGDX/src/TypewriterGDX.kt
Normal file
@@ -0,0 +1,247 @@
|
||||
import com.badlogic.gdx.Game
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.InputAdapter
|
||||
import com.badlogic.gdx.audio.AudioDevice
|
||||
import com.badlogic.gdx.audio.Sound
|
||||
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application
|
||||
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.GL20
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.utils.GdxRuntimeException
|
||||
import net.torvald.terrarum.gamecontroller.InputStrober
|
||||
import net.torvald.terrarumsansbitmap.gdx.CodepointSequence
|
||||
import net.torvald.terrarumtypewriterbitmap.gdx.TerrarumTypewriterBitmap
|
||||
import java.io.StringReader
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2021-11-05.
|
||||
*/
|
||||
class TypewriterGDX(val width: Int, val height: Int, val cols: Int, val hmargin: Int, val vmargin: Int) : Game() {
|
||||
|
||||
lateinit var font: TerrarumTypewriterBitmap
|
||||
lateinit var batch: SpriteBatch
|
||||
// lateinit var frameBuffer: FrameBuffer
|
||||
lateinit var camera: OrthographicCamera
|
||||
|
||||
lateinit var inputStrober: InputStrober
|
||||
|
||||
lateinit var sndMovingkey: Sound
|
||||
lateinit var sndDeadkey: Sound
|
||||
lateinit var sndShiftin: Sound
|
||||
lateinit var sndShiftout: Sound
|
||||
lateinit var sndSpace: Sound
|
||||
lateinit var sndCRs: Array<Sound>
|
||||
lateinit var sndLF: Sound
|
||||
|
||||
override fun create() {
|
||||
font = TerrarumTypewriterBitmap(
|
||||
"./assets/typewriter",
|
||||
StringReader(
|
||||
"""ko_kr_3set-390_typewriter,typewriter_ko_3set-390.tga,16
|
||||
|en_intl_qwerty_typewriter,typewriter_intl_qwerty.tga,0
|
||||
""".trimMargin()
|
||||
),
|
||||
true, false, 256, true
|
||||
)
|
||||
|
||||
batch = SpriteBatch()
|
||||
|
||||
// frameBuffer = FrameBuffer(Pixmap.Format.RGBA8888, TEXW, TEXH, true)
|
||||
|
||||
camera = OrthographicCamera(width.toFloat(), height.toFloat())
|
||||
camera.translate(width.div(2f), 0f)
|
||||
camera.setToOrtho(true, width.toFloat(), height.toFloat())
|
||||
camera.update()
|
||||
|
||||
|
||||
inputStrober = InputStrober(this)
|
||||
|
||||
try {
|
||||
sndMovingkey = Gdx.audio.newSound(Gdx.files.internal("assets/typewriter/audio/movingkey.wav"))
|
||||
sndDeadkey = Gdx.audio.newSound(Gdx.files.internal("assets/typewriter/audio/deadkey.wav"))
|
||||
sndShiftin = Gdx.audio.newSound(Gdx.files.internal("assets/typewriter/audio/shiftin.wav"))
|
||||
sndShiftout = Gdx.audio.newSound(Gdx.files.internal("assets/typewriter/audio/shiftout.wav"))
|
||||
sndSpace = Gdx.audio.newSound(Gdx.files.internal("assets/typewriter/audio/space.wav"))
|
||||
|
||||
sndCRs = Array(6) {
|
||||
Gdx.audio.newSound(Gdx.files.internal("assets/typewriter/audio/cr$it.wav"))
|
||||
}
|
||||
|
||||
sndLF = Gdx.audio.newSound(Gdx.files.internal("assets/typewriter/audio/crlf.wav"))
|
||||
}
|
||||
catch (e: GdxRuntimeException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private val intro = listOf(
|
||||
39,50,29, // kva (HANG_GONG)
|
||||
42,31, // nc (HANG_SE)
|
||||
74,48,51, // ;tw (HANG_BEOL)
|
||||
62, // space
|
||||
0x561F71, // shiftin
|
||||
184,164,171,170, // >HON (ASC_3-90)
|
||||
0x561F70, // shiftout
|
||||
62, // space
|
||||
74,48, // ;t (HANG_BEO)
|
||||
43,12, // o5 (HANG_CYU)
|
||||
38,48,51, // jtw (HANG_EOL)
|
||||
0x561F71, // shiftin
|
||||
164, // H (ASC_-)
|
||||
0x561F70, // shiftout
|
||||
75,34, // 'f (HANG_TA)
|
||||
40,34, // lf (HANG_JA)
|
||||
39,32, // kd (HANG_GI)
|
||||
Input.Keys.ENTER,Input.Keys.ENTER
|
||||
)
|
||||
|
||||
private val textbuf: ArrayList<CodepointSequence> = arrayListOf(
|
||||
CodepointSequence()
|
||||
)
|
||||
|
||||
var keylayoutbase = 0xFA000
|
||||
private val printableKeys = ((Input.Keys.NUM_0..Input.Keys.NUM_9) + (Input.Keys.A..Input.Keys.PERIOD) + 62 + (Input.Keys.BACKSPACE..Input.Keys.SLASH)).toHashSet()
|
||||
|
||||
var initDone = false
|
||||
var initTimer = 0f
|
||||
var initTypingCursor = 0
|
||||
var keystrokeDelay = 0.08f
|
||||
|
||||
fun acceptKey(keycode: Int, force: Boolean = false) {
|
||||
if (initDone || force) {
|
||||
// println("[TypewriterGDX] Accepting key: $keycode")
|
||||
|
||||
val lowkeycode = keycode and 127
|
||||
|
||||
if (keycode == Input.Keys.ENTER) {
|
||||
val tbufsize = textbuf.last().size.div(cols.toFloat()).times(6f).coerceIn(0f, 6f).roundToInt() // 0..6
|
||||
textbuf.add(CodepointSequence())
|
||||
if (tbufsize == 0) sndLF.play()
|
||||
else sndCRs[tbufsize - 1].play()
|
||||
} else if (printableKeys.contains(lowkeycode)) {
|
||||
val cp = keycode + keylayoutbase
|
||||
textbuf.last().add(cp)
|
||||
// println("[TypewriterGDX] width: ${font.glyphProps[cp]}")
|
||||
|
||||
// play audio
|
||||
val isDeadkey = font.glyphProps[cp]?.width == 0
|
||||
if (isDeadkey) {
|
||||
sndDeadkey.play()
|
||||
} else if (lowkeycode == Input.Keys.SPACE || lowkeycode == Input.Keys.BACKSPACE) {
|
||||
sndSpace.play()
|
||||
} else {
|
||||
sndMovingkey.play()
|
||||
}
|
||||
} else if (lowkeycode == Input.Keys.SHIFT_LEFT || lowkeycode == Input.Keys.SHIFT_RIGHT) {
|
||||
sndShiftin.play()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For Shift-out only
|
||||
*/
|
||||
fun shiftOut() {
|
||||
sndShiftout.play()
|
||||
}
|
||||
|
||||
|
||||
private val textCol = Color(0.1f,0.1f,0.1f,1f)
|
||||
override fun render() {
|
||||
Gdx.gl.glClearColor(0.97f,0.96f,0.95f,1f)
|
||||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
|
||||
Gdx.gl.glEnable(GL20.GL_TEXTURE_2D)
|
||||
Gdx.gl.glEnable(GL20.GL_BLEND)
|
||||
Gdx.gl.glBlendFuncSeparate(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA, GL20.GL_ONE, GL20.GL_ONE)
|
||||
|
||||
batch.projectionMatrix = camera.combined
|
||||
batch.begin()
|
||||
|
||||
batch.color = textCol
|
||||
|
||||
try {
|
||||
textbuf.forEachIndexed { index, s ->
|
||||
font.draw(batch, s, hmargin.toFloat(), vmargin.toFloat() + 20 * index)
|
||||
}
|
||||
}
|
||||
catch (e: ConcurrentModificationException) {}
|
||||
|
||||
batch.end()
|
||||
|
||||
if (!initDone) {
|
||||
while (initTimer > keystrokeDelay) {
|
||||
val keyToType = intro[initTypingCursor]
|
||||
|
||||
if (keyToType < 256) {
|
||||
acceptKey(keyToType, true)
|
||||
}
|
||||
else if (keyToType == 0x561F71) {
|
||||
acceptKey(Input.Keys.SHIFT_LEFT + 128, true)
|
||||
}
|
||||
else if (keyToType == 0x561F70) {
|
||||
shiftOut()
|
||||
}
|
||||
initTypingCursor += 1
|
||||
initTimer -= keystrokeDelay
|
||||
|
||||
if (keyToType == Input.Keys.ENTER)
|
||||
initTimer -= 0.35f
|
||||
else if (keyToType == 0x561F71)
|
||||
initTimer -= 0.15f
|
||||
else if (keyToType == 0x561F70)
|
||||
initTimer -= 0.1f
|
||||
else
|
||||
initTimer -= Math.random().toFloat() * 0.04f
|
||||
}
|
||||
|
||||
initTimer += Gdx.graphics.deltaTime
|
||||
|
||||
if (initTypingCursor >= intro.size) {
|
||||
initDone = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
font.dispose()
|
||||
batch.dispose()
|
||||
inputStrober.dispose()
|
||||
sndMovingkey.dispose()
|
||||
sndDeadkey.dispose()
|
||||
sndShiftin.dispose()
|
||||
sndShiftout.dispose()
|
||||
sndSpace.dispose()
|
||||
sndCRs.forEach { it.dispose() }
|
||||
sndLF.dispose()
|
||||
}
|
||||
}
|
||||
|
||||
class TypewriterInput(val main: TypewriterGDX) : InputAdapter() {
|
||||
|
||||
private var shiftIn = false
|
||||
|
||||
override fun keyDown(keycode: Int): Boolean {
|
||||
// FIXME this shiftIn would not work at all...
|
||||
shiftIn = (keycode == Input.Keys.SHIFT_LEFT || keycode == Input.Keys.SHIFT_RIGHT)
|
||||
if (keycode < 128 && keycode != Input.Keys.SHIFT_LEFT && keycode != Input.Keys.SHIFT_RIGHT) {
|
||||
main.acceptKey(shiftIn.toInt() * 128 + keycode)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
private fun Boolean.toInt() = if (this) 1 else 0
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
appConfig = Lwjgl3ApplicationConfiguration()
|
||||
appConfig.useVsync(false)
|
||||
appConfig.setResizable(false)
|
||||
appConfig.setWindowedMode(534, 668)
|
||||
appConfig.setTitle("Terrarum Typewriter Bitmap Test")
|
||||
|
||||
Lwjgl3Application(TypewriterGDX(534, 668, 64, 32, 24), appConfig)
|
||||
}
|
||||
@@ -0,0 +1,401 @@
|
||||
package net.torvald.terrarum.gamecontroller
|
||||
|
||||
import TypewriterGDX
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.Input
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2021-11-06.
|
||||
*/
|
||||
class InputStrober(val typewriter: TypewriterGDX) {
|
||||
|
||||
companion object {
|
||||
const val KEY_DOWN = 0
|
||||
const val KEY_CHANGE = 1
|
||||
const val N_KEY_ROLLOVER = 8
|
||||
}
|
||||
|
||||
var KEYBOARD_DELAYS = longArrayOf(0L,250000000L,0L,25000000L,0L)
|
||||
private var stroboTime = 0L
|
||||
private var stroboStatus = 0
|
||||
private var repeatCount = 0
|
||||
private var oldKeys = IntArray(N_KEY_ROLLOVER) { 0 }
|
||||
/** always Low Layer */
|
||||
// private var keymap = IME.getLowLayerByName(App.getConfigString("basekeyboardlayout"))
|
||||
|
||||
private val thread = Thread { while (!Thread.interrupted()) {
|
||||
if (Gdx.input != null) withKeyboardEvent()
|
||||
} }
|
||||
|
||||
init {
|
||||
// println("InputStrobe start")
|
||||
thread.start()
|
||||
}
|
||||
|
||||
fun dispose() {
|
||||
thread.interrupt()
|
||||
}
|
||||
|
||||
fun resetKeyboardStrobo() {
|
||||
stroboStatus = 0
|
||||
repeatCount = 0
|
||||
}
|
||||
|
||||
// code proudly stolen from tsvm's TVDOS.SYS
|
||||
private fun withKeyboardEvent() {
|
||||
val keys = strobeKeys()
|
||||
var keyChanged = !arrayEq(keys, oldKeys)
|
||||
val keyDiff = arrayDiff(keys, oldKeys)
|
||||
|
||||
// println("Key strobed: ${keys.joinToString()}")
|
||||
|
||||
if (stroboStatus % 2 == 0 && (keys[0] != 0 || oldKeys[0] != 0)) {
|
||||
stroboStatus += 1
|
||||
stroboTime = System.nanoTime()
|
||||
repeatCount += 1
|
||||
|
||||
val shiftin = keys.contains(Input.Keys.SHIFT_LEFT) || keys.contains(Input.Keys.SHIFT_RIGHT)
|
||||
val newKeysym0 = keysToStr(keyDiff)
|
||||
|
||||
val newKeysym = if (newKeysym0 == null) null
|
||||
else if (shiftin && newKeysym0.size > 1 && newKeysym0[1]?.isNotBlank() == true) newKeysym0[1]
|
||||
else newKeysym0[0]
|
||||
|
||||
val headKeyCode = (if (keyDiff.size < 1) keys[0] else keyDiff[0]).and(127) or (if (shiftin) 128 else 0)
|
||||
|
||||
if (repeatCount == 1) {
|
||||
if (!keyChanged) {
|
||||
// println("KEY_DOWN '$keysym' ($headKeyCode) $repeatCount; ${keys.joinToString()}")
|
||||
// App.inputStrobed(TerrarumKeyboardEvent(KEY_DOWN, keysym, headKeyCode, repeatCount, keys))
|
||||
typewriter.acceptKey(headKeyCode)
|
||||
} else if (newKeysym != null) {
|
||||
// println("KEY_DOWC '$newKeysym' ($headKeyCode) $repeatCount; ${keys.joinToString()}")
|
||||
// App.inputStrobed(TerrarumKeyboardEvent(KEY_DOWN, newKeysym, headKeyCode, repeatCount, keys))
|
||||
typewriter.acceptKey(headKeyCode)
|
||||
}
|
||||
|
||||
|
||||
// println("shiftin=${shiftin} oldkeys=${oldKeys.joinToString()}")
|
||||
|
||||
if (!shiftin && (oldKeys.contains(Input.Keys.SHIFT_LEFT) || oldKeys.contains(Input.Keys.SHIFT_RIGHT))) {
|
||||
typewriter.shiftOut()
|
||||
}
|
||||
}
|
||||
|
||||
oldKeys = keys // don't put this outside of if-cascade
|
||||
}
|
||||
else if (keyChanged || keys[0] == 0) {
|
||||
stroboStatus = 0
|
||||
repeatCount = 0
|
||||
|
||||
if (keys[0] == 0) keyChanged = false
|
||||
}
|
||||
else if (stroboStatus % 2 == 1 && System.nanoTime() - stroboTime < KEYBOARD_DELAYS[stroboStatus]) {
|
||||
Thread.sleep(1L)
|
||||
}
|
||||
else {
|
||||
stroboStatus += 1
|
||||
if (stroboStatus >= 4)
|
||||
stroboStatus = 2
|
||||
}
|
||||
}
|
||||
|
||||
private fun keysToStr(keys: IntArray): Array<String?>? {
|
||||
if (keys.isEmpty()) return null
|
||||
val headkey = keys[0]
|
||||
return keymap[headkey]
|
||||
}
|
||||
|
||||
private fun strobeKeys(): IntArray {
|
||||
var keysPushed = 0
|
||||
val keyEventBuffers = IntArray(N_KEY_ROLLOVER) { 0 }
|
||||
for (k in 1..254) {
|
||||
if (Gdx.input.isKeyPressed(k)) {
|
||||
keyEventBuffers[keysPushed] = k
|
||||
keysPushed += 1
|
||||
}
|
||||
|
||||
if (keysPushed >= N_KEY_ROLLOVER) break
|
||||
}
|
||||
return keyEventBuffers
|
||||
}
|
||||
|
||||
private fun arrayEq(a: IntArray, b: IntArray): Boolean {
|
||||
for (i in a.indices) {
|
||||
if (a[i] != b.getOrNull(i)) return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
private fun arrayDiff(a: IntArray, b: IntArray): IntArray {
|
||||
return a.filter { !b.contains(it) }.toIntArray()
|
||||
}
|
||||
|
||||
|
||||
private val keymap = arrayOf(arrayOf<String?>(""),arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>("<HOME>"),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>("<CALL>"),
|
||||
arrayOf<String?>("<ENDCALL>"),
|
||||
arrayOf<String?>("0",")"),
|
||||
arrayOf<String?>("1","!"),
|
||||
arrayOf<String?>("2","@"),
|
||||
arrayOf<String?>("3","#"),
|
||||
arrayOf<String?>("4","$"),
|
||||
arrayOf<String?>("5","%"),
|
||||
arrayOf<String?>("6","^"),
|
||||
arrayOf<String?>("7","&"),
|
||||
arrayOf<String?>("8","*"),
|
||||
arrayOf<String?>("9","("),
|
||||
arrayOf<String?>("*"),
|
||||
arrayOf<String?>("#"),
|
||||
arrayOf<String?>("<UP>"),
|
||||
arrayOf<String?>("<DOWN>"),
|
||||
arrayOf<String?>("<LEFT>"),
|
||||
arrayOf<String?>("<RIGHT>"),
|
||||
arrayOf<String?>("<CENTER>"),
|
||||
arrayOf<String?>("<VOL_UP>"),
|
||||
arrayOf<String?>("<VOL_DOWN>"),
|
||||
arrayOf<String?>("<POWER>"),
|
||||
arrayOf<String?>("<CAMERA>"),
|
||||
arrayOf<String?>("<CLEAR>"),
|
||||
arrayOf<String?>("a","A"),
|
||||
arrayOf<String?>("b","B"),
|
||||
arrayOf<String?>("c","C"),
|
||||
arrayOf<String?>("d","D"),
|
||||
arrayOf<String?>("e","E"),
|
||||
arrayOf<String?>("f","F"),
|
||||
arrayOf<String?>("g","G"),
|
||||
arrayOf<String?>("h","H"),
|
||||
arrayOf<String?>("i","I"),
|
||||
arrayOf<String?>("j","J"),
|
||||
arrayOf<String?>("k","K"),
|
||||
arrayOf<String?>("l","L"),
|
||||
arrayOf<String?>("m","M"),
|
||||
arrayOf<String?>("n","N"),
|
||||
arrayOf<String?>("o","O"),
|
||||
arrayOf<String?>("p","P"),
|
||||
arrayOf<String?>("q","Q"),
|
||||
arrayOf<String?>("r","R"),
|
||||
arrayOf<String?>("s","S"),
|
||||
arrayOf<String?>("t","T"),
|
||||
arrayOf<String?>("u","U"),
|
||||
arrayOf<String?>("v","V"),
|
||||
arrayOf<String?>("w","W"),
|
||||
arrayOf<String?>("x","X"),
|
||||
arrayOf<String?>("y","Y"),
|
||||
arrayOf<String?>("z","Z"),
|
||||
arrayOf<String?>(",","<"),
|
||||
arrayOf<String?>(".",">"),
|
||||
arrayOf<String?>("<ALT_L>"),
|
||||
arrayOf<String?>("<ALT_R>"),
|
||||
arrayOf<String?>("<SHIFT_L>"),
|
||||
arrayOf<String?>("<SHIFT_R>"),
|
||||
arrayOf<String?>("<TAB>"),
|
||||
arrayOf<String?>(" "),
|
||||
arrayOf<String?>("<SYM>"),
|
||||
arrayOf<String?>("<EXPLORER>"),
|
||||
arrayOf<String?>("<ENVELOPE>"),
|
||||
arrayOf<String?>("\n"),
|
||||
arrayOf<String?>("\u0008"),
|
||||
arrayOf<String?>("`","~"),
|
||||
arrayOf<String?>("-","_"),
|
||||
arrayOf<String?>("=","+"),
|
||||
arrayOf<String?>("arrayOf<String?>(","{"),
|
||||
arrayOf<String?>(")","}"),
|
||||
arrayOf<String?>("\\","|"),
|
||||
arrayOf<String?>(";",":"),
|
||||
arrayOf<String?>("'","\""),
|
||||
arrayOf<String?>("/","?"),
|
||||
arrayOf<String?>("<AT>"),
|
||||
arrayOf<String?>("<NUM_LOCK>"),
|
||||
arrayOf<String?>("<HEADSETHOOK>"),
|
||||
arrayOf<String?>("<FOCUS>"),
|
||||
arrayOf<String?>("+"),
|
||||
arrayOf<String?>("<MENU>"),
|
||||
arrayOf<String?>("<NOTIFICATION>"),
|
||||
arrayOf<String?>("<SEARCH>"),
|
||||
arrayOf<String?>("<PLAY_PAUSE>"),
|
||||
arrayOf<String?>("<STOP>"),
|
||||
arrayOf<String?>("<NEXT>"),
|
||||
arrayOf<String?>("<PREV>"),
|
||||
arrayOf<String?>("<REW>"),
|
||||
arrayOf<String?>("<FFWD>"),
|
||||
arrayOf<String?>("<MUTE>"),
|
||||
arrayOf<String?>("<PAGE_UP>"),
|
||||
arrayOf<String?>("<PAGE_DOWN>"),
|
||||
arrayOf<String?>("<PICTSYMBOLS>"),
|
||||
arrayOf<String?>("<SW:>TCH_CHARSET>"),
|
||||
arrayOf<String?>("<:A:>"),
|
||||
arrayOf<String?>("<:B:>"),
|
||||
arrayOf<String?>("<:C:>"),
|
||||
arrayOf<String?>("<:X:>"),
|
||||
arrayOf<String?>("<:Y:>"),
|
||||
arrayOf<String?>("<:Z:>"),
|
||||
arrayOf<String?>("<:L1:>"),
|
||||
arrayOf<String?>("<:R1:>"),
|
||||
arrayOf<String?>("<:L2:>"),
|
||||
arrayOf<String?>("<:R2:>"),
|
||||
arrayOf<String?>("<:TL:>"),
|
||||
arrayOf<String?>("<:TR:>"),
|
||||
arrayOf<String?>("<:START:>"),
|
||||
arrayOf<String?>("<:SELECT:>"),
|
||||
arrayOf<String?>("<:MODE:>"),
|
||||
arrayOf<String?>("<ESC>"),
|
||||
arrayOf<String?>("<DEL>"),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>("<CAPS_LOCK>"),
|
||||
arrayOf<String?>("<SCROLL_LOCK>"),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>("<PRINT_SCREEN_SYS_RQ>"),
|
||||
arrayOf<String?>("<PAUSE_BREAK>"),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>("<END>"),
|
||||
arrayOf<String?>("<INSERT>"),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>("<CTRL_L>"),
|
||||
arrayOf<String?>("<CTRL_R>"),
|
||||
arrayOf<String?>("<F1>"),
|
||||
arrayOf<String?>("<F2>"),
|
||||
arrayOf<String?>("<F3>"),
|
||||
arrayOf<String?>("<F4>"),
|
||||
arrayOf<String?>("<F5>"),
|
||||
arrayOf<String?>("<F6>"),
|
||||
arrayOf<String?>("<F7>"),
|
||||
arrayOf<String?>("<F8>"),
|
||||
arrayOf<String?>("<F9>"),
|
||||
arrayOf<String?>("<F10>"),
|
||||
arrayOf<String?>("<F11>"),
|
||||
arrayOf<String?>("<F12>"),
|
||||
arrayOf<String?>("<NUM_LOCK>"),
|
||||
arrayOf<String?>("0"),
|
||||
arrayOf<String?>("1"),
|
||||
arrayOf<String?>("2"),
|
||||
arrayOf<String?>("3"),
|
||||
arrayOf<String?>("4"),
|
||||
arrayOf<String?>("5"),
|
||||
arrayOf<String?>("6"),
|
||||
arrayOf<String?>("7"),
|
||||
arrayOf<String?>("8"),
|
||||
arrayOf<String?>("9"),
|
||||
arrayOf<String?>("/"),
|
||||
arrayOf<String?>("*"),
|
||||
arrayOf<String?>("-"),
|
||||
arrayOf<String?>("+"),
|
||||
arrayOf<String?>("."),
|
||||
arrayOf<String?>("."),
|
||||
arrayOf<String?>("\n"),
|
||||
arrayOf<String?>("="),
|
||||
arrayOf<String?>("("),
|
||||
arrayOf<String?>(")"),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>(null),
|
||||
arrayOf<String?>("<:CIRCLE:>")
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
||||
data class TerrarumKeyboardEvent(
|
||||
val type: Int,
|
||||
val character: String?, // representative key symbol
|
||||
val headkey: Int, // representative keycode
|
||||
val repeatCount: Int,
|
||||
val keycodes: IntArray
|
||||
)
|
||||
7
LICENSE.md
Normal file → Executable file
@@ -1,6 +1,4 @@
|
||||
Terrarum Sans Bitmap
|
||||
|
||||
Copyright (c) 2017 Minjae Song (Torvald) and the contributors
|
||||
Copyright (c) 2017-2022 see CONTRIBUTORS.txt
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -19,6 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
WenQuanYi font is distributed under GNU GPL Version 2. See their [license document here](http://wenq.org/wqy2/index.cgi?GPL)
|
||||
|
||||
2
META-INF/MANIFEST.MF
Executable file
@@ -0,0 +1,2 @@
|
||||
Manifest-Version: 1.0
|
||||
|
||||
BIN
PUA_allocation_chart.xlsx
Executable file
176
README.md
Normal file → Executable file
@@ -1,33 +1,87 @@
|
||||
# Terrarum Sans Bitmap
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||
This font is a bitmap font used in [my game project called Terrarum](https://github.com/minjaesong/Terrarum) (hence the name). The font supports more than 90 % of european languages, as well as Chinese, Japanese and Korean. More technical side, it supports Latin-1 Supplement, Latin Ext-A/B/C, IPA Extension, Greek, Cyrillic (+ Bulgarian, Serbian variants) and the supplement, Armenian, Devanagari, Bengali, Thai, Georgian (Mkhedruli and Mtavruli), General Punctuations, Super/Subscrips, CJK Punctuations, All of the Kana (minus the Hentaigana), Chinese (limited to Unihan and Ext-A), Hangul (every possible syllables) and Fullwidth forms.
|
||||
|
||||
This font is a bitmap font used in my game project, Terrarum (hence the name). It Supports ExtA, Romanian (subset of ExtB), Cyrillic (Russian, Bulgarian, Serbian), Greek, Chinese, Japanese and Korean.
|
||||
|
||||
The code for the fonts are meant to be used with Slick2d (extends ```Font``` class). If you are not using the framework, please refer to the __Font metrics__ section to implement the font metrics correctly on your system.
|
||||
The JAR package is meant to be used with LibGDX (extends ```BitmapFont``` class). If you are not using the framework, please refer to the __Font metrics__ section to implement the font metrics correctly on your system.
|
||||
|
||||
The issue page is open. If you have some issues to submit, or have a question, please leave it on the page.
|
||||
|
||||
#### Little notes
|
||||
- To display Bulgarian/Serbian variants, you need special Control Characters. (GameFontBase.charsetOverrideBulgarian -- U+FFFC1; GameFontBase.charsetOverrideSerbian -- U+FFFC2)
|
||||
- All Han characters are in Chinese variant, no other variants are to be supported as most Chinese, Japanese and Korean people can understand other's variant and as long as I can, we don't bother anyway.
|
||||
- Indian script in general is not perfect: right now this font will never do the proper ligatures (I can't draw all the 1 224 possible combinations). Hopefully it's still be able to understand without them.
|
||||
- Slick2d versions are now unsupported. I couldn't extend myself to work on both versions, but I'm still welcome to merge your pull requests.
|
||||
|
||||
## Contribution guidelines
|
||||
### Design Goals
|
||||
|
||||
You can contribute to the font by fixing wrong glyphs, suggesting better ones, extending character set (like Latin Extended B), or code for other game frameworks such as LibGDX. Please leave pull request for that.
|
||||
- Sans-serif
|
||||
- Realise (some of) handwritten forms
|
||||
- Combininig with the sans-serif, this stands for **no over-simplification**
|
||||
- Condensed capitals for efficient space usage
|
||||
|
||||
Font images are stored in ```assets/graphics/fonts``` directory. Image format must be TGA with Alpha — no PNG. If someone needs PNG, they can batch-convert the font using utils like ImageMagick.
|
||||
## Download
|
||||
|
||||
- Go ahead to the [release tab](https://github.com/minjaesong/Terrarum-sans-bitmap/releases), and download the most recent version. It is **not** advised to use the .jar found within the repository, they're experimental builds I use during the development, and may contain bugs like leaking memory.
|
||||
|
||||
## Using on Slick2d
|
||||
## Using on your game
|
||||
|
||||
- Firstly, place the .jar to your library path and assets folder to the main directory of the app, then:
|
||||
|
||||
### Using on LibGDX
|
||||
|
||||
On your code (Kotlin):
|
||||
|
||||
class YourGame {
|
||||
class YourGame : Game() {
|
||||
|
||||
lateinit var fontGame: Font
|
||||
|
||||
override fun initStatesList(gc: GameContainer) {
|
||||
fontGame = GameFontImpl()
|
||||
override fun create() {
|
||||
fontGame = GameFontBase(path_to_assets)
|
||||
...
|
||||
}
|
||||
|
||||
override fun render() {
|
||||
batch.begin()
|
||||
...
|
||||
fontGame.draw(batch, text, ...)
|
||||
...
|
||||
batch.end()
|
||||
}
|
||||
}
|
||||
|
||||
On your code (Java):
|
||||
|
||||
class YourGame extends BasicGame {
|
||||
|
||||
Font fontGame;
|
||||
|
||||
@Override void create() {
|
||||
fontGame = new GameFontBase(path_to_assets);
|
||||
...
|
||||
}
|
||||
|
||||
@Override void render() {
|
||||
batch.begin();
|
||||
...
|
||||
fontGame.draw(batch, text, ...);
|
||||
...
|
||||
batch.end();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
### Using on Slick2d (legacy version only)
|
||||
|
||||
On your code (Kotlin):
|
||||
|
||||
class YourGame : BasicGame("YourGameName") {
|
||||
|
||||
lateinit var fontGame: Font
|
||||
|
||||
override fun init(gc: GameContainer) {
|
||||
fontGame = GameFontBase(path_to_assets)
|
||||
...
|
||||
}
|
||||
|
||||
@@ -39,107 +93,41 @@ On your code (Kotlin):
|
||||
|
||||
On your code (Java):
|
||||
|
||||
class YourGame {
|
||||
class YourGame extends BasicGame {
|
||||
|
||||
Font fontGame;
|
||||
|
||||
void initStatesList(GameContainer gc) {
|
||||
fontGame = new GameFontImpl();
|
||||
@Override void init(GameContainer gc) {
|
||||
fontGame = new GameFontBase(path_to_assets);
|
||||
...
|
||||
}
|
||||
|
||||
void render(GameContainer gc, Graphics g) {
|
||||
@Override void render(GameContainer gc, Graphics g) {
|
||||
g.setFont(fontGame);
|
||||
g.drawString(...);
|
||||
}
|
||||
}
|
||||
|
||||
## Font metrics
|
||||
### How to Use Color Code
|
||||
|
||||
The font expects both variable widths and fixed width to be supported. Any images with ```_variable``` means it expects variable widths. Anything else expects fixed width. ```romana_narrow``` has width of 6 (no, not 5), ```romana_wide``` has width of 9, ```cjkpunct``` has width of 10, ```kana``` has width of 12, ```hangul_johab``` has width of 11, ```wenquanyi``` has width of 16.
|
||||
Color codes are individual unicode characters. While you can somehow make a raw character and paste in on your code, it's certainly not desirable. Fortunately, we're also providing utility functions for the color codes.
|
||||
|
||||
### Parsing glyph widths for variable font sheets
|
||||
GameFontBase.toColorCode(argb4444: Int) -- returns String
|
||||
GameFontBase.toColorCode(r: Int, g: Int, b: Int) -- returns String
|
||||
GameFontBase.toColorCode(r: Int, g: Int, b: Int, a: Int) -- returns String
|
||||
|
||||
Width is encoded in binary number, on pixels. On the font image, every glyph has vertical dots on their right side (to be exact, every (16k - 1)th pixel on x axis). From top to bottom, each dot represents 1, 2, 4 and 8. For example, ASCII glyph 'C' has width of 9, 'W' has width of 11, " (double quote) has width of 6.
|
||||
```argb4444``` takes whole ARGB (in that order) as input, that is, from 0x0000 to 0xFFFF.
|
||||
```r, g, b(, a)``` takes RGB and A separately, in the range of 0x0..0xF. Any value exceeding the range **are unchecked and may wreak havoc**, so be careful.
|
||||
|
||||
### Implementing the Korean writing system
|
||||
U+100000 is used to disable previously-applied color codes (going back to original colour), even if it looks like ARGB of all zero.
|
||||
|
||||
On this font, Hangul letters are printed by assemblying two or three letter pieces. There are 10 sets of Hangul letter pieces on the font. Top 6 are initials, middle 2 are medials, and bottom 2 are finals. On the rightmost side, there's eight assembled glyphs to help you with (assuming you have basic knowledge on the writing system). Top 6 tells you how to use 6 initials, and bottom 2 tells you how to use 2 finals.
|
||||
|
||||
This is a Kotlin-like pseudocode for assembling the glyph:
|
||||
## Contribution guidelines
|
||||
|
||||
jungseongWide = arrayOf(8, 12, 13, 17, 18, 21)
|
||||
jungseongComplex = arrayOf(9, 10, 11, 14, 15, 16, 22)
|
||||
|
||||
function getHanInitialRow(hanIndex: Int): Int {
|
||||
val ret: Int
|
||||
|
||||
if (isJungseongWide(hanIndex))
|
||||
ret = 2
|
||||
else if (isJungseongComplex(hanIndex))
|
||||
ret = 4
|
||||
else
|
||||
ret = 0
|
||||
|
||||
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
|
||||
}
|
||||
|
||||
function isJungseongWide(hanIndex: Int) = jungseongWide.contains(getHanJungseong(hanIndex))
|
||||
function isJungseongComplex(hanIndex: Int) = jungseongComplex.contains(getHanJungseong(hanIndex))
|
||||
|
||||
function getHanInitialRow(hanIndex: Int): Int {
|
||||
val ret: Int
|
||||
|
||||
if (isJungseongWide(hanIndex))
|
||||
ret = 2
|
||||
else if (isJungseongComplex(hanIndex))
|
||||
ret = 4
|
||||
else
|
||||
ret = 0
|
||||
|
||||
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
|
||||
}
|
||||
|
||||
function getHanMedialRow(hanIndex: Int) = if (getHanJongseong(hanIndex) == 0) 6 else 7
|
||||
|
||||
function getHanFinalRow(hanIndex: Int): Int {
|
||||
val jungseongIndex = getHanJungseong(hanIndex)
|
||||
|
||||
return if (jungseongWide.contains(jungseongIndex))
|
||||
8
|
||||
else
|
||||
9
|
||||
}
|
||||
|
||||
function isHangul(c: Char) = c.toInt() >= 0xAC00 && c.toInt() < 0xD7A4
|
||||
|
||||
...
|
||||
|
||||
for (each Char on the string) {
|
||||
if (isHangul(Char)) {
|
||||
val hIndex = Char.toInt() - 0xAC00
|
||||
|
||||
val indexCho = getHanChosung(hIndex)
|
||||
val indexJung = getHanJungseong(hIndex)
|
||||
val indexJong = getHanJongseong(hIndex)
|
||||
|
||||
val choRow = getHanInitialRow(hIndex)
|
||||
val jungRow = getHanMedialRow(hIndex)
|
||||
val jongRow = getHanFinalRow(hIndex)
|
||||
|
||||
// get sub image from sprite sheet
|
||||
val choseongImage = hangulSheet.getSubImage(indexCho, choRow)
|
||||
val jungseongImage = hangulSheet.getSubImage(indexJung, jungRow)
|
||||
val jongseongImage = hangulSheet.getSubImage(indexJong, jongRow)
|
||||
|
||||
// actual drawing part
|
||||
draw choseongImage to somewhere you want
|
||||
draw jungseongImage on top of choseongImage
|
||||
draw jongseongImage on top of choseongImage
|
||||
}
|
||||
...
|
||||
}
|
||||
Please refer to [CONTRIBUTING.md](https://github.com/minjaesong/Terrarum-sans-bitmap/blob/master/CONTRIBUTING.md)
|
||||
|
||||
## Acknowledgement
|
||||
|
||||
Thanks to kind people of [/r/Typography](https://www.reddit.com/r/typography/) for amazing feedbacks.
|
||||
|
||||
CJK Ideographs are powered by [WenQuanYi Font](http://wenq.org/wqy2/index.cgi?BitmapSong). The font is distributed under the GNU GPL version 2. Although the shapes of typefaces are not copyrightable (the program codes—e.g. TTF—do), we would like to give a credit for the font and the people behind it.
|
||||
|
||||
@@ -1,552 +0,0 @@
|
||||
package net.torvald.imagefont
|
||||
|
||||
import org.lwjgl.opengl.GL11
|
||||
import org.newdawn.slick.*
|
||||
import org.newdawn.slick.opengl.Texture
|
||||
import java.nio.ByteOrder
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 16-01-27.
|
||||
*/
|
||||
open class GameFontBase : Font {
|
||||
|
||||
private fun getHan(hanIndex: Int): IntArray {
|
||||
val han_x = hanIndex % JONG_COUNT
|
||||
val han_y = hanIndex / JONG_COUNT
|
||||
val ret = intArrayOf(han_x, han_y)
|
||||
return ret
|
||||
}
|
||||
|
||||
private fun getHanChosung(hanIndex: Int) = hanIndex / (JUNG_COUNT * JONG_COUNT)
|
||||
|
||||
private fun getHanJungseong(hanIndex: Int) = hanIndex / JONG_COUNT % JUNG_COUNT
|
||||
|
||||
private fun getHanJongseong(hanIndex: Int) = hanIndex % JONG_COUNT
|
||||
|
||||
private val jungseongWide = arrayOf(8, 12, 13, 17, 18, 21)
|
||||
private val jungseongComplex = arrayOf(9, 10, 11, 14, 15, 16, 22)
|
||||
|
||||
private fun isJungseongWide(hanIndex: Int) = jungseongWide.contains(getHanJungseong(hanIndex))
|
||||
private fun isJungseongComplex(hanIndex: Int) = jungseongComplex.contains(getHanJungseong(hanIndex))
|
||||
|
||||
private fun getHanInitialRow(hanIndex: Int): Int {
|
||||
val ret: Int
|
||||
|
||||
if (isJungseongWide(hanIndex))
|
||||
ret = 2
|
||||
else if (isJungseongComplex(hanIndex))
|
||||
ret = 4
|
||||
else
|
||||
ret = 0
|
||||
|
||||
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
|
||||
}
|
||||
|
||||
private fun getHanMedialRow(hanIndex: Int) = if (getHanJongseong(hanIndex) == 0) 6 else 7
|
||||
|
||||
private fun getHanFinalRow(hanIndex: Int): Int {
|
||||
val jungseongIndex = getHanJungseong(hanIndex)
|
||||
|
||||
return if (jungseongWide.contains(jungseongIndex))
|
||||
8
|
||||
else
|
||||
9
|
||||
}
|
||||
|
||||
private fun isHangul(c: Char) = c.toInt() >= 0xAC00 && c.toInt() < 0xD7A4
|
||||
private fun isAscii(c: Char) = c.toInt() >= 0x20 && c.toInt() <= 0xFF
|
||||
private fun isExtA(c: Char) = c.toInt() >= 0x100 && c.toInt() < 0x180
|
||||
private fun isKana(c: Char) = c.toInt() >= 0x3040 && c.toInt() < 0x3100
|
||||
private fun isCJKPunct(c: Char) = c.toInt() >= 0x3000 && c.toInt() < 0x3040
|
||||
private fun isUniHan(c: Char) = c.toInt() >= 0x3400 && c.toInt() < 0xA000
|
||||
private fun isCyrilic(c: Char) = c.toInt() >= 0x400 && c.toInt() < 0x460
|
||||
private fun isFullwidthUni(c: Char) = c.toInt() >= 0xFF00 && c.toInt() < 0xFF20
|
||||
private fun isUniPunct(c: Char) = c.toInt() >= 0x2000 && c.toInt() < 0x2070
|
||||
private fun isWenQuanYi1(c: Char) = c.toInt() >= 0x33F3 && c.toInt() <= 0x69FC
|
||||
private fun isWenQuanYi2(c: Char) = c.toInt() >= 0x69FD && c.toInt() <= 0x9FDC
|
||||
private fun isGreek(c: Char) = c.toInt() >= 0x370 && c.toInt() <= 0x3CE
|
||||
private fun isRomanian(c: Char) = c.toInt() >= 0x218 && c.toInt() <= 0x21A
|
||||
private fun isRomanianNarrow(c: Char) = c.toInt() == 0x21B
|
||||
|
||||
|
||||
|
||||
private fun extAindexX(c: Char) = (c.toInt() - 0x100) % 16
|
||||
private fun extAindexY(c: Char) = (c.toInt() - 0x100) / 16
|
||||
|
||||
private fun kanaIndexX(c: Char) = (c.toInt() - 0x3040) % 16
|
||||
private fun kanaIndexY(c: Char) = (c.toInt() - 0x3040) / 16
|
||||
|
||||
private fun cjkPunctIndexX(c: Char) = (c.toInt() - 0x3000) % 16
|
||||
private fun cjkPunctIndexY(c: Char) = (c.toInt() - 0x3000) / 16
|
||||
|
||||
private fun uniHanIndexX(c: Char) = (c.toInt() - 0x3400) % 256
|
||||
private fun uniHanIndexY(c: Char) = (c.toInt() - 0x3400) / 256
|
||||
|
||||
private fun cyrilicIndexX(c: Char) = (c.toInt() - 0x400) % 16
|
||||
private fun cyrilicIndexY(c: Char) = (c.toInt() - 0x400) / 16
|
||||
|
||||
private fun fullwidthUniIndexX(c: Char) = (c.toInt() - 0xFF00) % 16
|
||||
private fun fullwidthUniIndexY(c: Char) = (c.toInt() - 0xFF00) / 16
|
||||
|
||||
private fun uniPunctIndexX(c: Char) = (c.toInt() - 0x2000) % 16
|
||||
private fun uniPunctIndexY(c: Char) = (c.toInt() - 0x2000) / 16
|
||||
|
||||
private fun wenQuanYiIndexX(c: Char) =
|
||||
(c.toInt() - if (c.toInt() <= 0x4DB5) 0x33F3 else 0x33F3 + 0x4A) % 32
|
||||
private fun wenQuanYi1IndexY(c: Char) = (c.toInt() - (0x33F3 + 0x4A)) / 32
|
||||
private fun wenQuanYi2IndexY(c: Char) = (c.toInt() - 0x69FD) / 32
|
||||
|
||||
private fun greekIndexX(c: Char) = (c.toInt() - 0x370) % 16
|
||||
private fun greekIndexY(c: Char) = (c.toInt() - 0x370) / 16
|
||||
|
||||
private fun romanianIndexX(c: Char) = c.toInt() - 0x218
|
||||
private fun romanianIndexY(c: Char) = 0
|
||||
|
||||
private fun thaiIndexX(c: Char) = (c.toInt() - 0xE00) % 16
|
||||
private fun thaiIndexY(c: Char) = (c.toInt() - 0xE00) / 16
|
||||
|
||||
private fun thaiNarrowIndexX(c: Char) = 3
|
||||
private fun thaiNarrowIndexY(c: Char) = 0
|
||||
|
||||
|
||||
private val narrowWidthSheets = arrayOf(
|
||||
SHEET_EXTB_ROMANIAN_NARROW
|
||||
)
|
||||
private val unihanWidthSheets = arrayOf(
|
||||
SHEET_UNIHAN,
|
||||
SHEET_FW_UNI,
|
||||
SHEET_WENQUANYI_1,
|
||||
SHEET_WENQUANYI_2
|
||||
)
|
||||
private val zeroWidthSheets = arrayOf(
|
||||
SHEET_COLOURCODE
|
||||
)
|
||||
private val variableWidthSheets = arrayOf(
|
||||
SHEET_ASCII_VARW,
|
||||
SHEET_CYRILIC_VARW,
|
||||
SHEET_EXTA_VARW,
|
||||
SHEET_GREEK_VARW
|
||||
)
|
||||
|
||||
|
||||
override fun getWidth(s: String) = getWidthSubstr(s, s.length)
|
||||
|
||||
private fun getWidthSubstr(s: String, endIndex: Int): Int {
|
||||
var len = 0
|
||||
for (i in 0..endIndex - 1) {
|
||||
val chr = s[i]
|
||||
val ctype = getSheetType(s[i])
|
||||
|
||||
if (chr.toInt() == 0x21B) // Romanian t; HAX!
|
||||
len += 6
|
||||
else if (variableWidthSheets.contains(ctype)) {
|
||||
try {
|
||||
len += asciiWidths[chr.toInt()]!!
|
||||
}
|
||||
catch (e: kotlin.KotlinNullPointerException) {
|
||||
println("KotlinNullPointerException on glyph number ${Integer.toHexString(chr.toInt()).toUpperCase()}")
|
||||
System.exit(1)
|
||||
}
|
||||
}
|
||||
else if (zeroWidthSheets.contains(ctype))
|
||||
len += 0
|
||||
else if (narrowWidthSheets.contains(ctype))
|
||||
len += W_LATIN_NARROW
|
||||
else if (ctype == SHEET_CJK_PUNCT)
|
||||
len += W_ASIAN_PUNCT
|
||||
else if (ctype == SHEET_HANGUL)
|
||||
len += W_HANGUL
|
||||
else if (ctype == SHEET_KANA)
|
||||
len += W_KANA
|
||||
else if (unihanWidthSheets.contains(ctype))
|
||||
len += W_UNIHAN
|
||||
else
|
||||
len += W_LATIN_WIDE
|
||||
|
||||
if (i < endIndex - 1) len += interchar
|
||||
}
|
||||
return len * scale
|
||||
}
|
||||
|
||||
override fun getHeight(s: String) = H * scale
|
||||
|
||||
override fun getLineHeight() = H * scale
|
||||
|
||||
override fun drawString(x: Float, y: Float, s: String) = drawString(x, y, s, Color.white)
|
||||
|
||||
override fun drawString(x: Float, y: Float, s: String, color: Color) {
|
||||
GL11.glEnable(GL11.GL_BLEND)
|
||||
GL11.glColorMask(true, true, true, true)
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA)
|
||||
|
||||
var thisCol = color
|
||||
|
||||
// hangul fonts first
|
||||
//hangulSheet.startUse() // disabling texture binding to make the font coloured
|
||||
// JOHAB
|
||||
for (i in 0..s.length - 1) {
|
||||
val ch = s[i]
|
||||
|
||||
if (isHangul(ch)) {
|
||||
val hIndex = ch.toInt() - 0xAC00
|
||||
|
||||
val indexCho = getHanChosung(hIndex)
|
||||
val indexJung = getHanJungseong(hIndex)
|
||||
val indexJong = getHanJongseong(hIndex)
|
||||
|
||||
val choRow = getHanInitialRow(hIndex)
|
||||
val jungRow = getHanMedialRow(hIndex)
|
||||
val jongRow = getHanFinalRow(hIndex)
|
||||
|
||||
val glyphW = getWidth(ch.toString())
|
||||
|
||||
hangulSheet.getSubImage(indexCho, choRow).drawWithShadow(
|
||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
||||
Math.round(((H - H_HANGUL) / 2).toFloat() + y + 1f).toFloat(),
|
||||
scale.toFloat(), thisCol
|
||||
)
|
||||
hangulSheet.getSubImage(indexJung, jungRow).drawWithShadow(
|
||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
||||
Math.round(((H - H_HANGUL) / 2).toFloat() + y + 1f).toFloat(),
|
||||
scale.toFloat(), thisCol
|
||||
)
|
||||
hangulSheet.getSubImage(indexJong, jongRow).drawWithShadow(
|
||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
||||
Math.round(((H - H_HANGUL) / 2).toFloat() + y + 1f).toFloat(),
|
||||
scale.toFloat(), thisCol
|
||||
)
|
||||
}
|
||||
}
|
||||
//hangulSheet.endUse()
|
||||
|
||||
// unihan fonts
|
||||
/*uniHan.startUse();
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
char ch = s.charAt(i);
|
||||
|
||||
if (isUniHan(ch)) {
|
||||
int glyphW = getWidth("" + ch);
|
||||
uniHan.renderInUse(
|
||||
Math.round(x
|
||||
+ getWidthSubstr(s, i + 1) - glyphW
|
||||
)
|
||||
, Math.round((H - H_UNIHAN) / 2 + y)
|
||||
, uniHanIndexX(ch)
|
||||
, uniHanIndexY(ch)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
uniHan.endUse();*/
|
||||
|
||||
// WenQuanYi 1
|
||||
//wenQuanYi_1.startUse()
|
||||
|
||||
for (i in 0..s.length - 1) {
|
||||
val ch = s[i]
|
||||
|
||||
if (isWenQuanYi1(ch)) {
|
||||
val glyphW = getWidth("" + ch)
|
||||
wenQuanYi_1.getSubImage(wenQuanYiIndexX(ch), wenQuanYi1IndexY(ch)).drawWithShadow(
|
||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
||||
Math.round((H - H_UNIHAN) / 2 + y).toFloat(),
|
||||
scale.toFloat(), thisCol
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
//wenQuanYi_1.endUse()
|
||||
// WenQuanYi 2
|
||||
//wenQuanYi_2.startUse()
|
||||
|
||||
for (i in 0..s.length - 1) {
|
||||
val ch = s[i]
|
||||
|
||||
if (isWenQuanYi2(ch)) {
|
||||
val glyphW = getWidth("" + ch)
|
||||
wenQuanYi_2.getSubImage(wenQuanYiIndexX(ch), wenQuanYi2IndexY(ch)).drawWithShadow(
|
||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
||||
Math.round((H - H_UNIHAN) / 2 + y).toFloat(),
|
||||
scale.toFloat(), thisCol
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
//wenQuanYi_2.endUse()
|
||||
|
||||
// regular fonts
|
||||
var prevInstance = -1
|
||||
for (i in 0..s.length - 1) {
|
||||
val ch = s[i]
|
||||
|
||||
if (!isHangul(ch) && !isUniHan(ch)) {
|
||||
|
||||
// if not init, endUse first
|
||||
if (prevInstance != -1) {
|
||||
//sheetKey[prevInstance].endUse()
|
||||
}
|
||||
//sheetKey[getSheetType(ch)].startUse()
|
||||
prevInstance = getSheetType(ch)
|
||||
|
||||
val sheetX: Int
|
||||
val sheetY: Int
|
||||
when (prevInstance) {
|
||||
SHEET_EXTA_VARW -> {
|
||||
sheetX = extAindexX(ch)
|
||||
sheetY = extAindexY(ch)
|
||||
}
|
||||
SHEET_KANA -> {
|
||||
sheetX = kanaIndexX(ch)
|
||||
sheetY = kanaIndexY(ch)
|
||||
}
|
||||
SHEET_CJK_PUNCT -> {
|
||||
sheetX = cjkPunctIndexX(ch)
|
||||
sheetY = cjkPunctIndexY(ch)
|
||||
}
|
||||
SHEET_CYRILIC_VARW -> {
|
||||
sheetX = cyrilicIndexX(ch)
|
||||
sheetY = cyrilicIndexY(ch)
|
||||
}
|
||||
SHEET_FW_UNI -> {
|
||||
sheetX = fullwidthUniIndexX(ch)
|
||||
sheetY = fullwidthUniIndexY(ch)
|
||||
}
|
||||
SHEET_UNI_PUNCT -> {
|
||||
sheetX = uniPunctIndexX(ch)
|
||||
sheetY = uniPunctIndexY(ch)
|
||||
}
|
||||
SHEET_GREEK_VARW -> {
|
||||
sheetX = greekIndexX(ch)
|
||||
sheetY = greekIndexY(ch)
|
||||
}
|
||||
SHEET_EXTB_ROMANIAN_WIDE -> {
|
||||
sheetX = romanianIndexX(ch)
|
||||
sheetY = romanianIndexY(ch)
|
||||
}
|
||||
SHEET_EXTB_ROMANIAN_NARROW -> {
|
||||
sheetX = 0
|
||||
sheetY = 0
|
||||
}
|
||||
else -> {
|
||||
sheetX = ch.toInt() % 16
|
||||
sheetY = ch.toInt() / 16
|
||||
}
|
||||
}
|
||||
|
||||
val glyphW = getWidth("" + ch)
|
||||
try {
|
||||
sheetKey[prevInstance]!!.getSubImage(sheetX, sheetY).drawWithShadow(
|
||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
||||
|
||||
// to deal with the height difference of the sheets
|
||||
Math.round(y).toFloat() + (if (prevInstance == SHEET_CJK_PUNCT) -1 // height hack
|
||||
else if (prevInstance == SHEET_FW_UNI) (H - H_HANGUL) / 2 // completely legit height adjustment
|
||||
else 0).toFloat(),
|
||||
|
||||
scale.toFloat(), thisCol
|
||||
)
|
||||
}
|
||||
catch (e: ArrayIndexOutOfBoundsException) {
|
||||
// character that does not exist in the sheet. No render, pass.
|
||||
}
|
||||
catch (e1: RuntimeException) {
|
||||
// System.err.println("[GameFontBase] RuntimeException raised while processing character '$ch' (U+${Integer.toHexString(ch.toInt()).toUpperCase()})")
|
||||
// e1.printStackTrack()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (prevInstance != -1) {
|
||||
//sheetKey[prevInstance].endUse()
|
||||
}
|
||||
|
||||
GL11.glEnd()
|
||||
}
|
||||
|
||||
private fun getSheetType(c: Char): Int {
|
||||
// EFs
|
||||
if (isRomanianNarrow(c))
|
||||
return SHEET_EXTB_ROMANIAN_NARROW
|
||||
else if (isHangul(c))
|
||||
return SHEET_HANGUL
|
||||
else if (isKana(c))
|
||||
return SHEET_KANA
|
||||
else if (isUniHan(c))
|
||||
return SHEET_UNIHAN
|
||||
else if (isAscii(c))
|
||||
return SHEET_ASCII_VARW
|
||||
else if (isExtA(c))
|
||||
return SHEET_EXTA_VARW
|
||||
else if (isCyrilic(c))
|
||||
return SHEET_CYRILIC_VARW
|
||||
else if (isUniPunct(c))
|
||||
return SHEET_UNI_PUNCT
|
||||
else if (isCJKPunct(c))
|
||||
return SHEET_CJK_PUNCT
|
||||
else if (isFullwidthUni(c))
|
||||
return SHEET_FW_UNI
|
||||
else if (isGreek(c))
|
||||
return SHEET_GREEK_VARW
|
||||
else if (isRomanian(c))
|
||||
return SHEET_EXTB_ROMANIAN_WIDE
|
||||
else
|
||||
return SHEET_UNKNOWN// fixed width punctuations
|
||||
// fixed width
|
||||
// fallback
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw part of a string to the screen. Note that this will still position the text as though
|
||||
* it's part of the bigger string.
|
||||
* @param x
|
||||
* *
|
||||
* @param y
|
||||
* *
|
||||
* @param s
|
||||
* *
|
||||
* @param color
|
||||
* *
|
||||
* @param startIndex
|
||||
* *
|
||||
* @param endIndex
|
||||
*/
|
||||
override fun drawString(x: Float, y: Float, s: String, color: Color, startIndex: Int, endIndex: Int) {
|
||||
val unprintedHead = s.substring(0, startIndex)
|
||||
val printedBody = s.substring(startIndex, endIndex)
|
||||
val xoff = getWidth(unprintedHead)
|
||||
drawString(x + xoff, y, printedBody, color)
|
||||
}
|
||||
|
||||
fun buildWidthTable(sheet: SpriteSheet, codeOffset: Int, codeRange: IntRange, rows: Int = 16) {
|
||||
fun Byte.toUint() = java.lang.Byte.toUnsignedInt(this)
|
||||
|
||||
/** @return Intarray(R, G, B, A) */
|
||||
fun Texture.getPixel(x: Int, y: Int): IntArray {
|
||||
val textureWidth = this.textureWidth
|
||||
val hasAlpha = this.hasAlpha()
|
||||
|
||||
val offset = (if (hasAlpha) 4 else 3) * (textureWidth * y + x) // 4: # of channels (RGBA)
|
||||
|
||||
if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) {
|
||||
return intArrayOf(
|
||||
this.textureData[offset].toUint(),
|
||||
this.textureData[offset + 1].toUint(),
|
||||
this.textureData[offset + 2].toUint(),
|
||||
if (hasAlpha)
|
||||
this.textureData[offset + 3].toUint()
|
||||
else 255
|
||||
)
|
||||
}
|
||||
else {
|
||||
return intArrayOf(
|
||||
this.textureData[offset + 2].toUint(),
|
||||
this.textureData[offset + 1].toUint(),
|
||||
this.textureData[offset].toUint(),
|
||||
if (hasAlpha)
|
||||
this.textureData[offset + 3].toUint()
|
||||
else 255
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
val binaryCodeOffset = 15
|
||||
|
||||
val cellW = sheet.getSubImage(0, 0).width + 1 // should be 16
|
||||
val cellH = sheet.getSubImage(0, 0).height + 1 // should be 20
|
||||
|
||||
// control chars
|
||||
for (ccode in codeRange) {
|
||||
val glyphX = ccode % rows
|
||||
val glyphY = ccode / rows
|
||||
|
||||
val codeStartX = (glyphX * cellW) + binaryCodeOffset
|
||||
val codeStartY = (glyphY * cellH)
|
||||
|
||||
var glyphWidth = 0
|
||||
for (downCtr in 0..3) {
|
||||
// if alpha is not zero, assume it's 1
|
||||
if (sheet.texture.getPixel(codeStartX, codeStartY + downCtr)[3] == 255) {
|
||||
glyphWidth = glyphWidth or (1 shl downCtr)
|
||||
}
|
||||
}
|
||||
|
||||
asciiWidths[codeOffset + ccode] = glyphWidth
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
lateinit internal var hangulSheet: SpriteSheet
|
||||
lateinit internal var asciiSheet: SpriteSheet
|
||||
|
||||
internal val asciiWidths: HashMap<Int, Int> = HashMap()
|
||||
|
||||
lateinit internal var extASheet: SpriteSheet
|
||||
lateinit internal var kanaSheet: SpriteSheet
|
||||
lateinit internal var cjkPunct: SpriteSheet
|
||||
// static SpriteSheet uniHan;
|
||||
lateinit internal var cyrilic: SpriteSheet
|
||||
lateinit internal var fullwidthForms: SpriteSheet
|
||||
lateinit internal var uniPunct: SpriteSheet
|
||||
lateinit internal var wenQuanYi_1: SpriteSheet
|
||||
lateinit internal var wenQuanYi_2: SpriteSheet
|
||||
lateinit internal var greekSheet: SpriteSheet
|
||||
lateinit internal var romanianSheet: SpriteSheet
|
||||
lateinit internal var romanianSheetNarrow: SpriteSheet
|
||||
|
||||
internal val JUNG_COUNT = 21
|
||||
internal val JONG_COUNT = 28
|
||||
|
||||
internal val W_ASIAN_PUNCT = 10
|
||||
internal val W_HANGUL = 11
|
||||
internal val W_KANA = 12
|
||||
internal val W_UNIHAN = 16
|
||||
internal val W_LATIN_WIDE = 9 // width of regular letters, including m
|
||||
internal val W_LATIN_NARROW = 5 // width of letter f, t, i, l
|
||||
|
||||
internal val H = 20
|
||||
internal val H_HANGUL = 16
|
||||
internal val H_UNIHAN = 16
|
||||
internal val H_KANA = 20
|
||||
|
||||
internal val SHEET_ASCII_VARW = 0
|
||||
internal val SHEET_HANGUL = 1
|
||||
internal val SHEET_EXTA_VARW = 2
|
||||
internal val SHEET_KANA = 3
|
||||
internal val SHEET_CJK_PUNCT = 4
|
||||
internal val SHEET_UNIHAN = 5
|
||||
internal val SHEET_CYRILIC_VARW = 6
|
||||
internal val SHEET_FW_UNI = 7
|
||||
internal val SHEET_UNI_PUNCT = 8
|
||||
internal val SHEET_WENQUANYI_1 = 9
|
||||
internal val SHEET_WENQUANYI_2 = 10
|
||||
internal val SHEET_GREEK_VARW = 11
|
||||
internal val SHEET_EXTB_ROMANIAN_WIDE = 12
|
||||
internal val SHEET_EXTB_ROMANIAN_NARROW = 13
|
||||
|
||||
internal val SHEET_UNKNOWN = 254
|
||||
internal val SHEET_COLOURCODE = 255
|
||||
|
||||
lateinit internal var sheetKey: Array<SpriteSheet?>
|
||||
|
||||
internal var interchar = 0
|
||||
internal var scale = 1
|
||||
set(value) {
|
||||
if (value > 0) field = value
|
||||
else throw IllegalArgumentException("Font scale cannot be zero or negative (input: $value)")
|
||||
}
|
||||
|
||||
}// end of companion object
|
||||
}
|
||||
|
||||
fun Image.drawWithShadow(x: Float, y: Float, color: Color) =
|
||||
this.drawWithShadow(x, y, 1f, color)
|
||||
|
||||
fun Image.drawWithShadow(x: Float, y: Float, scale: Float, color: Color) {
|
||||
this.draw(x + 1, y + 1, scale, color.darker(0.5f))
|
||||
this.draw(x , y + 1, scale, color.darker(0.5f))
|
||||
this.draw(x + 1, y , scale, color.darker(0.5f))
|
||||
|
||||
this.draw(x, y, scale, color)
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
package net.torvald.imagefont
|
||||
|
||||
import net.torvald.terrarum.imagefont.GameFontDemo
|
||||
import org.newdawn.slick.*
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 16-01-20.
|
||||
*/
|
||||
class GameFontImpl : GameFontBase() {
|
||||
|
||||
init {
|
||||
|
||||
GameFontBase.hangulSheet = SpriteSheet(
|
||||
"./assets/graphics/fonts/hangul_johab.tga", GameFontBase.W_HANGUL, GameFontBase.H_HANGUL)
|
||||
GameFontBase.asciiSheet = SpriteSheet(
|
||||
"./assets/graphics/fonts/ascii_variable.tga", 15, 19, 1)
|
||||
GameFontBase.extASheet = SpriteSheet(
|
||||
"./assets/graphics/fonts/LatinExtA_variable.tga", 15, 19, 1)
|
||||
GameFontBase.kanaSheet = SpriteSheet(
|
||||
"./assets/graphics/fonts/kana.tga", GameFontBase.W_KANA, GameFontBase.H_KANA)
|
||||
GameFontBase.cjkPunct = SpriteSheet(
|
||||
"./assets/graphics/fonts/cjkpunct.tga", GameFontBase.W_ASIAN_PUNCT, GameFontBase.H_KANA)
|
||||
/*uniHan = new SpriteSheet(
|
||||
"./assets/graphics/fonts/unifont_unihan"
|
||||
+ ((!terrarum.gameLocale.contains("zh"))
|
||||
? "_ja" : "")
|
||||
+".tga"
|
||||
, W_UNIHAN, H_UNIHAN
|
||||
);*/
|
||||
GameFontBase.cyrilic = SpriteSheet(
|
||||
when (GameFontDemo.gameLocale.substring(0..1)) {
|
||||
"bg" -> "./assets/graphics/fonts/cyrilic_bulgarian_variable.tga"
|
||||
"sr" -> "./assets/graphics/fonts/cyrilic_serbian_variable.tga"
|
||||
else -> "./assets/graphics/fonts/cyrilic_variable.tga"
|
||||
}, 15, 19, 1)
|
||||
GameFontBase.fullwidthForms = SpriteSheet(
|
||||
"./assets/graphics/fonts/fullwidth_forms.tga", GameFontBase.W_UNIHAN, GameFontBase.H_UNIHAN)
|
||||
GameFontBase.uniPunct = SpriteSheet(
|
||||
"./assets/graphics/fonts/unipunct.tga", GameFontBase.W_LATIN_WIDE, GameFontBase.H)
|
||||
GameFontBase.wenQuanYi_1 = SpriteSheet(
|
||||
"./assets/graphics/fonts/wenquanyi_11pt_part1.tga", 16, 18, 2)
|
||||
GameFontBase.wenQuanYi_2 = SpriteSheet(
|
||||
"./assets/graphics/fonts/wenquanyi_11pt_part2.tga", 16, 18, 2)
|
||||
GameFontBase.greekSheet = SpriteSheet(
|
||||
"./assets/graphics/fonts/greek_variable.tga", 15, 19, 1)
|
||||
GameFontBase.romanianSheet = SpriteSheet(
|
||||
"./assets/graphics/fonts/romana_wide.tga", GameFontBase.W_LATIN_WIDE, GameFontBase.H)
|
||||
GameFontBase.romanianSheetNarrow = SpriteSheet(
|
||||
"./assets/graphics/fonts/romana_narrow.tga", GameFontBase.W_LATIN_NARROW, GameFontBase.H)
|
||||
|
||||
val shk = arrayOf(
|
||||
GameFontBase.asciiSheet,
|
||||
GameFontBase.hangulSheet,
|
||||
GameFontBase.extASheet,
|
||||
GameFontBase.kanaSheet,
|
||||
GameFontBase.cjkPunct,
|
||||
null, // Full unihan, filler because we're using WenQuanYi
|
||||
GameFontBase.cyrilic,
|
||||
GameFontBase.fullwidthForms,
|
||||
GameFontBase.uniPunct,
|
||||
GameFontBase.wenQuanYi_1,
|
||||
GameFontBase.wenQuanYi_2,
|
||||
GameFontBase.greekSheet,
|
||||
GameFontBase.romanianSheet,
|
||||
GameFontBase.romanianSheetNarrow
|
||||
)
|
||||
GameFontBase.sheetKey = shk
|
||||
|
||||
|
||||
buildWidthTable(asciiSheet, 0, 0..0xFF)
|
||||
buildWidthTable(extASheet, 0x100, 0..0x7F)
|
||||
buildWidthTable(cyrilic, 0x400, 0..0x5F)
|
||||
buildWidthTable(greekSheet, 0x370, 0..0x5F)
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
Font implementations for Slick2d
|
||||
BIN
alignment_illustration.jpg
Executable file
|
After Width: | Height: | Size: 59 KiB |
BIN
assets/ascii_variable.tga
LFS
Executable file
BIN
assets/bengali_variable.tga
LFS
Executable file
BIN
assets/braille_variable.tga
LFS
Normal file
BIN
assets/graphics/fonts/cjkpunct.tga → assets/cjkpunct.tga
Normal file → Executable file
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
BIN
assets/control_pictures_variable.tga
LFS
Normal file
BIN
assets/currencies_variable.tga
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
assets/cyrilic_bulgarian_variable.tga
LFS
Executable file
BIN
assets/cyrilic_serbian_variable.tga
LFS
Executable file
BIN
assets/cyrilic_variable.tga
LFS
Executable file
BIN
assets/devanagari_internal_extrawide_variable.tga
LFS
Normal file
BIN
assets/devanagari_variable.tga
LFS
Normal file
BIN
assets/diacritical_marks_variable.tga
LFS
Executable file
BIN
assets/enclosed_alphanumeric_supplement_variable.tga
LFS
Normal file
BIN
assets/futhark.tga
Executable file
|
After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 160 KiB |
|
Before Width: | Height: | Size: 320 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 192 KiB |
|
Before Width: | Height: | Size: 180 KiB |
|
Before Width: | Height: | Size: 444 B |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 19 MiB |
|
Before Width: | Height: | Size: 19 MiB |
BIN
assets/greek_polytonic_xyswap_variable.tga
LFS
Executable file
BIN
assets/greek_variable.tga
LFS
Executable file
BIN
assets/halfwidth_fullwidth_variable.tga
LFS
Normal file
BIN
assets/hangul_johab.tga
LFS
Normal file
BIN
assets/hayeren_variable.tga
LFS
Executable file
BIN
assets/internal_variable.tga
LFS
Normal file
BIN
assets/ipa_ext_variable.tga
LFS
Executable file
BIN
assets/kana.tga
LFS
Executable file
BIN
assets/kartuli_allcaps_variable.tga
LFS
Executable file
BIN
assets/kartuli_variable.tga
LFS
Executable file
BIN
assets/latinExtA_variable.tga
LFS
Executable file
BIN
assets/latinExtB_variable.tga
LFS
Executable file
BIN
assets/latinExtC_variable.tga
Executable file
|
After Width: | Height: | Size: 40 KiB |
BIN
assets/latinExtD_variable.tga
LFS
Normal file
BIN
assets/latinExt_additional_variable.tga
LFS
Executable file
BIN
assets/letterlike_symbols_variable.tga
LFS
Normal file
BIN
assets/phonetic_extensions_variable.tga
LFS
Normal file
BIN
assets/puae000-e0ff.tga
LFS
Executable file
BIN
assets/richtext_furigana.tga
Executable file
|
After Width: | Height: | Size: 24 KiB |
BIN
assets/sundanese_variable.tga
LFS
Normal file
BIN
assets/tamil_extrawide_variable.tga
LFS
Normal file
BIN
assets/thai_variable.tga
LFS
Executable file
BIN
assets/tsalagi_variable.tga
LFS
Executable file
BIN
assets/typewriter/audio/cr0.wav
LFS
Normal file
BIN
assets/typewriter/audio/cr1.wav
LFS
Normal file
BIN
assets/typewriter/audio/cr2.wav
LFS
Normal file
BIN
assets/typewriter/audio/cr3.wav
LFS
Normal file
BIN
assets/typewriter/audio/cr4.wav
LFS
Normal file
BIN
assets/typewriter/audio/cr5.wav
LFS
Normal file
BIN
assets/typewriter/audio/crlf.wav
LFS
Normal file
BIN
assets/typewriter/audio/deadkey.wav
LFS
Normal file
BIN
assets/typewriter/audio/movingkey.wav
LFS
Normal file
BIN
assets/typewriter/audio/shiftin.wav
LFS
Normal file
BIN
assets/typewriter/audio/shiftout.wav
LFS
Normal file
BIN
assets/typewriter/audio/space.wav
LFS
Normal file
BIN
assets/typewriter/typewriter_intl_qwerty.tga
Normal file
|
After Width: | Height: | Size: 320 KiB |
BIN
assets/typewriter/typewriter_ko_3set-390.tga
Normal file
|
After Width: | Height: | Size: 320 KiB |
BIN
assets/unipunct_variable.tga
Executable file
|
After Width: | Height: | Size: 200 KiB |