224 Commits

Author SHA1 Message Date
minjaesong
0ea7bf8c1b Update LICENSE.md 2024-02-07 01:53:56 +09:00
minjaesong
f5bc1f8178 more updates 2024-02-05 22:12:56 +09:00
minjaesong
2a39ff0d35 copyright update 2024-02-05 04:18:31 +09:00
minjaesong
ecffe22d01 more patches 2024-02-05 03:23:19 +09:00
minjaesong
e1c48ace6b a late night patch, yay 2024-02-05 03:00:31 +09:00
minjaesong
efff35f0e3 more devanagari changes 2024-02-04 19:23:23 +09:00
minjaesong
f10962ceda more devanagari changes 2024-02-04 19:12:24 +09:00
minjaesong
37d21c6f6c unicode 15.1 update 2024-02-04 15:38:19 +09:00
minjaesong
ff7c0f8df3 yet another devanagari improvements regarding superscript RA and vowel I 2024-02-02 20:38:16 +09:00
minjaesong
c863148f13 fix: positioning of diacritics after hindi II; positioning of superscript RA in sample string DARJEELING 2024-01-28 22:48:41 +09:00
minjaesong
69e12f0205 hangul changes 2024-01-28 16:42:00 +09:00
minjaesong
6bf4a5a995 Old hangul rendering fix 2024-01-19 16:01:51 +09:00
minjaesong
38bdb28b64 next release commit 2023-10-06 12:20:13 +09:00
minjaesong
8ba1a4a005 fix: TAMIL AS ABOVE SIGN being shifted 1 px up 2023-07-06 22:06:59 +09:00
minjaesong
70da6a5142 README update 2023-06-06 19:56:33 +09:00
minjaesong
2f6126d0ea texts now printed 2px lower so that the text is vertically centred against the lineheight 2023-06-06 18:07:14 +09:00
minjaesong
189a427edc sundanese update as per unicode 15 2023-01-09 15:14:48 +09:00
minjaesong
21dbf348d0 redesigned capital cyrillic DA again 2022-09-28 17:53:03 +09:00
minjaesong
ff455ef2fd fixed a bad shape mask of the bulgarian lowercase te, mask of the uppercase scha was 1 px off to the left 2022-09-28 13:13:37 +09:00
minjaesong
d7029c3841 halfwidth hangul minor change 2022-09-04 21:57:51 +09:00
minjaesong
2d894613df new typeface for the experimental typewriter 2022-08-31 23:13:47 +09:00
minjaesong
60a1da1336 more cyrillic touchups 2022-08-18 19:39:02 +09:00
minjaesong
123d856853 forgot to make tga of these files 2022-08-03 00:55:42 +09:00
minjaesong
617e0bc5b1 fixed a bug where cyrillic 'ь' was tagged as 1 px narrower than it should be 2022-08-03 00:41:42 +09:00
minjaesong
0a873b3801 fixed a bug where glyphs in alternative charcter sets (namele bulgarian and serbian) would not override the glyph props of the base glyphs 2022-08-02 22:54:18 +09:00
minjaesong
3c97253c9a minor edit 2022-07-18 13:04:07 +09:00
minjaesong
f228c331cf keycap: added ctrl and alt 2022-07-01 02:13:40 +09:00
minjaesong
464ac151bd more work files that is not a goal of v1.11 release 2022-05-24 09:40:04 +09:00
minjaesong
8f70306540 cyrillic archaeic letters wip 2022-04-26 00:23:58 +09:00
minjaesong
28166bb2ec (in a Crocodile Dundee vibe) that's not a fix; this is a fix 2022-03-22 17:07:38 +09:00
minjaesong
ac85217998 fixed a bug where diacritics with align right would not get positioned correctly 2022-03-22 15:47:24 +09:00
minjaesong
44b2450fbf setting default line height to 24 pixels on the source 2022-03-22 09:29:38 +09:00
minjaesong
9221373c53 removing single-glyph devanagary DRYA ligature 2022-03-20 18:34:51 +09:00
minjaesong
bfaa190e49 another devanagari changes 2022-03-19 10:42:00 +09:00
minjaesong
23c7ae15a2 more variable devanagari i/ii 2022-03-17 15:37:31 +09:00
minjaesong
077a832767 variable length for devanagari i/ii 2022-03-14 21:42:28 +09:00
minjaesong
8c9e912491 devanagari: five more sanskrit ligatures 2022-03-13 17:05:03 +09:00
minjaesong
8a7cf85982 an alternative sequence to write Tamil SHRII 2022-03-10 16:23:14 +09:00
minjaesong
bae9af79e9 devanagari NG.K/KH/G/GH ligatures 2022-03-09 13:22:18 +09:00
minjaesong
374dc1dd66 sundanese kerning 2022-03-08 13:06:08 +09:00
minjaesong
2812460a9c devanagari nuqta 2022-03-08 11:05:31 +09:00
minjaesong
83a885d214 sundanese on demo.png (2) 2022-03-07 18:43:57 +09:00
minjaesong
0dbb32b575 sundanese on demo.png 2022-03-07 18:27:23 +09:00
minjaesong
4fea10583c added sundanese script 2022-03-07 16:11:37 +09:00
minjaesong
ebdb0c499c fixed a bug where standalone verb II would not rendered correctly 2022-03-06 12:57:27 +09:00
minjaesong
4e6f473b6f devanagary jya ligature 2022-03-02 15:09:24 +09:00
minjaesong
7fdb7a7a91 devanagari: improved rendering of superscript RA 2022-02-25 13:39:00 +09:00
minjaesong
f8a1c4cfdf dumping temp files to OS's temp directory 2022-02-23 09:20:50 +09:00
minjaesong
afa59255cc fixed a bug where getting the width of certain text would return a bad value 2022-02-17 14:20:21 +09:00
minjaesong
23a5a8997f some extra padding on the 'linotype' and improved method of getting text width 2022-02-17 11:36:14 +09:00
minjaesong
4e705e5c7d more testing with marathi ra 2022-02-16 13:58:28 +09:00
minjaesong
c57f8e191b devanagari ligature update 2022-02-16 13:19:03 +09:00
minjaesong
ed97bafc41 pua symbols update 2022-02-14 13:43:36 +09:00
minjaesong
eebff767ce devanagari ligatures and glyph adjustments 2022-02-14 10:39:54 +09:00
minjaesong
baee9a62aa new sanskrit sample text 2022-02-13 23:27:43 +09:00
minjaesong
305dbb548c advertisement for braille support 2022-02-13 22:40:32 +09:00
minjaesong
0ccdf67f1e width fix for cyrillic g 2022-02-13 22:20:54 +09:00
minjaesong
60aad1b24d update demo.PNG 2022-02-13 22:12:34 +09:00
minjaesong
e31e088744 another redesign oof 2022-02-13 22:06:36 +09:00
minjaesong
824f11412d devanagari HA redesign 2022-02-13 18:22:38 +09:00
minjaesong
1445404005 fixed a bad RAsup positioning (hopefully) 2022-02-13 18:13:31 +09:00
minjaesong
dd851cdbc9 more ligatures 2022-02-13 16:29:49 +09:00
minjaesong
7abfb2d2f0 apparently there are lots to adjust 2022-02-13 15:06:26 +09:00
minjaesong
5e7237fb17 fixed a bug where open YA is not being applied on complex conjuncts 2022-02-13 13:31:44 +09:00
minjaesong
0cba7b96be deploying new devanagari internal mapping 2022-02-13 12:24:57 +09:00
minjaesong
1705b2752e devanagari: using new internal mapping 2022-02-13 01:22:00 +09:00
minjaesong
4614ffab92 braille support 2022-02-07 13:38:22 +09:00
minjaesong
225d908f70 fixed the demo program that it would blend the text shadow correctly on the PNG output so it would look as good as the in-game 2022-02-02 20:21:06 +09:00
minjaesong
09e7483389 w 2022-02-02 12:12:21 +09:00
minjaesong
57ab00b6e1 devanagari glyph improvements and new encoding scheme wip 2022-01-30 19:57:59 +09:00
minjaesong
23b6be74e2 devanagari RAsup anomaly fix 2022-01-29 21:35:18 +09:00
minjaesong
905a235a1b neverending adjustments 2022-01-29 12:08:16 +09:00
minjaesong
d6b1dbd1d6 more devanagari adjustments 2022-01-29 00:34:06 +09:00
minjaesong
e9c4f0723a tamil vowel I ligatures 2022-01-27 20:25:19 +09:00
minjaesong
ac6733469c doc 2022-01-27 09:37:59 +09:00
minjaesong
a7ecba905a tamil: diacritics for extrawide is not quite working but this quick fix would work well enough 2022-01-26 18:33:06 +09:00
minjaesong
d7c48b1f88 tamil wip 2022-01-26 17:49:39 +09:00
minjaesong
0c74660396 fixing one pixel mistake 2022-01-26 15:03:28 +09:00
minjaesong
b3c1327dc4 IPA intonation graph implementation 2022-01-26 14:41:54 +09:00
minjaesong
489da04d1d devanagari: fixed the RAsup positioning 2022-01-26 14:17:23 +09:00
minjaesong
a58ad756ff devanagari narrower vowels 2022-01-26 10:09:02 +09:00
minjaesong
702f1b2e2f neverending adjustments 2022-01-25 23:28:20 +09:00
minjaesong
f10413d9c4 dot position adj 2022-01-25 21:41:44 +09:00
minjaesong
80aa9d0e52 more adjustments 2022-01-25 21:21:32 +09:00
minjaesong
64c13571f9 N.T and N.T.R ligatures 2022-01-25 21:10:08 +09:00
minjaesong
a36c5df477 oops not quite 2022-01-25 19:40:23 +09:00
minjaesong
7c3069e8cf i think devanagari is fully working now 2022-01-25 16:23:02 +09:00
minjaesong
1e66cfec51 marwari dda ligatures 2022-01-25 12:01:14 +09:00
minjaesong
1e0a820817 glyph adjustments 2022-01-25 10:24:23 +09:00
minjaesong
4623975858 more ligatures with RA and their half forms 2022-01-25 10:12:06 +09:00
minjaesong
23aac0c1c1 I think I've nailed down the RAsup rendering 2022-01-24 17:34:11 +09:00
minjaesong
54d983013a using open-YA for K.YA ligature 2022-01-23 20:23:56 +09:00
minjaesong
c7507a6357 another glyph changes 2022-01-23 11:31:50 +09:00
minjaesong
0714581866 diacritics placeholder is now semitransparent 2022-01-22 11:18:24 +09:00
minjaesong
095b8e65fb glyph adjustments 2022-01-21 12:38:36 +09:00
minjaesong
e60652d705 ha ha ha 2022-01-20 15:55:56 +09:00
minjaesong
f3aeba3d70 eh whateves 2022-01-20 14:47:21 +09:00
minjaesong
ee2b1027b7 moaarrrr ligggggsssss 2022-01-19 20:26:56 +09:00
minjaesong
3b05624de5 these glyphs are killing me :( 2022-01-19 16:50:29 +09:00
minjaesong
4c0582184f moar ligs 2022-01-19 14:20:56 +09:00
minjaesong
5e6b2363b7 devanagari ru-like syllables 2022-01-19 11:41:02 +09:00
minjaesong
dbe93a26eb more consistent K.SSA ligatures 2022-01-19 11:23:05 +09:00
minjaesong
b128312e2c wippie 2022-01-19 11:16:28 +09:00
minjaesong
07ca429483 more devanagari ligatures 2022-01-19 10:20:42 +09:00
minjaesong
9675c40216 devanagari ligation wip 2022-01-18 17:56:15 +09:00
minjaesong
0870856674 wip?? 2022-01-15 17:57:53 +09:00
minjaesong
3c6f18efbf more devanagari glyphs 2022-01-15 15:55:59 +09:00
minjaesong
2fdc6f85f5 devanagari eyelash RA 2022-01-14 17:59:36 +09:00
minjaesong
4ed2c26b35 new paper size 2022-01-11 18:01:05 +09:00
minjaesong
3ef7410e45 devanagari and bengali are separated internally 2022-01-11 16:47:08 +09:00
minjaesong
ba730fafe3 new devanagari wip 2022-01-10 15:53:02 +09:00
minjaesong
ab925bc8c5 fixing my stupid mistake 2022-01-05 17:20:40 +09:00
minjaesong
b1362f3a3b hangul: giyeok accompanied by UU or EU will have slightly curved tail 2022-01-05 16:03:33 +09:00
minjaesong
f60eb6b3fc hangul redraw 2022-01-05 14:47:06 +09:00
minjaesong
88f013a304 testing texts 2022-01-02 17:14:15 +09:00
minjaesong
ea9f8fae4c tamil ligature kssa and shrii 2022-01-02 17:13:39 +09:00
minjaesong
a6363131ac tamil almost working...? 2022-01-02 16:53:40 +09:00
minjaesong
fc60356b8b larger Anusvara for Bengali script 2022-01-02 14:01:20 +09:00
minjaesong
755420d5b3 control picture update to use some of the ISO 2047 symbols 2022-01-02 12:58:08 +09:00
minjaesong
0200aa5f85 Unicode Control Pictures 2022-01-02 11:43:58 +09:00
CuriousTorvald
7dff623b75 Update CONTRIBUTING.md 2022-01-02 10:54:16 +09:00
minjaesong
49f5e649b7 Making FontDemoGDX release-able again 2022-01-02 10:06:48 +09:00
minjaesong
1656e50c3b new year new copyright date 2022-01-01 22:06:26 +09:00
minjaesong
99a1648734 some edits 2022-01-01 19:12:25 +09:00
minjaesong
9672aa8e05 PUA realloc; tamil ligatures 2021-12-29 13:50:55 +09:00
minjaesong
d72ecb5cfd minor fix 2021-12-28 20:11:54 +09:00
minjaesong
39fccbe6cb some random miscellaneous work 2021-12-28 17:43:26 +09:00
minjaesong
84efb253cf testification 2021-12-26 17:41:52 +09:00
minjaesong
4c63860dc1 amendments 2021-12-21 15:26:44 +09:00
minjaesong
36acc7e523 more doc thingy 2021-12-21 14:56:11 +09:00
minjaesong
700397a995 more fixes for diacritics system 2021-12-21 14:05:25 +09:00
minjaesong
dc6bd89497 expanding diacritics types to correctly implement thai diacritics 2021-12-21 12:01:48 +09:00
minjaesong
c2ed83d511 halfwidth ㅆ had bad replacement chars defined 2021-12-20 22:55:33 +09:00
minjaesong
0a41da1659 minor changes 2021-12-20 01:51:15 +09:00
minjaesong
96e412414a slight changes in glyphs 2021-12-18 11:53:08 +09:00
minjaesong
483476b5fa halfwidth and fullwidth forms 2021-12-17 15:19:36 +09:00
minjaesong
ed8bcf7dc8 icon for mouse drag 2021-12-16 16:58:40 +09:00
minjaesong
376c7cf9a4 phonetic extensions 2021-12-14 17:16:13 +09:00
minjaesong
05d34d563d removing global flipY key 2021-12-13 02:52:45 +09:00
minjaesong
e59db6954a fixing wrong kerning tag for 'y'-like characters 2021-12-12 19:32:18 +09:00
minjaesong
9c05fb399b minute thai kerning change 2021-12-12 13:58:49 +09:00
minjaesong
40d4bc41c6 finally working on phonetic extensions 2021-12-09 17:38:11 +09:00
minjaesong
1f9a79db48 Enclosed Alphanumeric Supplement 2021-12-08 15:05:16 +09:00
minjaesong
0943d38926 implementation of "replacewith" compiler directive 2021-12-08 11:12:05 +09:00
minjaesong
5469b56841 minor changes on fraktur letters 2021-12-08 09:32:54 +09:00
minjaesong
d31730b5c3 arts for letterlike_symbols 2021-12-07 15:21:23 +09:00
minjaesong
bd36ee7399 wip 2021-12-06 09:14:15 +09:00
minjaesong
b8f5f57878 more fraktur 2021-12-05 22:04:13 +09:00
minjaesong
63de646eae font wip 2021-12-05 17:50:04 +09:00
minjaesong
e70ee44a37 fixing yet another bug on thai diacritics 2021-12-04 17:36:50 +09:00
minjaesong
6ee66fdccc tsalagi kerning 2021-11-30 14:47:40 +09:00
minjaesong
5ecffa1352 hayeren kerning 2021-11-30 13:04:03 +09:00
minjaesong
46efc42e24 kartuli kerning 2021-11-30 12:41:01 +09:00
minjaesong
35829ce982 greek and insular kerning 2021-11-30 12:21:58 +09:00
minjaesong
756ef4fae5 cyrillic kerning 2021-11-30 11:14:47 +09:00
minjaesong
ce31a5a6ef making use of the long-neglected scale variable 2021-11-28 12:42:34 +09:00
minjaesong
14ea4d8d84 thai kerning 2021-11-27 17:59:20 +09:00
minjaesong
f2eb1464f6 kerning ipa-ext 2021-11-27 11:56:06 +09:00
minjaesong
45b464ee13 hopefully alleviating a bug involving multithreaded (or mixed thread?) usage 2021-11-26 21:06:05 +09:00
minjaesong
c3f9ea47fd fixed a bug where shift+space and shift+backspace would play wrong sound 2021-11-26 17:10:18 +09:00
minjaesong
87012d7671 typewriter: faster typing sound, backspace is working again 2021-11-26 16:58:54 +09:00
minjaesong
1fce4055d7 some sort of an intro for the typewriter 2021-11-26 16:18:13 +09:00
minjaesong
b83dd501fc typewriting sound on typewriter 2021-11-26 15:27:09 +09:00
minjaesong
94a40a4a87 diacritics bit is now colour-coded 2021-11-26 10:59:30 +09:00
minjaesong
2fa867ce44 width adjustment for qwerty typewriter 2021-11-25 17:16:49 +09:00
minjaesong
4d1a599263 typewriter accepting new tagging system 2021-11-25 17:03:11 +09:00
minjaesong
8641c95169 new tagging system 2021-11-25 16:46:22 +09:00
minjaesong
4f6584ac27 minor change in kerning rule 2021-11-25 13:44:18 +09:00
minjaesong
cb25c5bf56 hangul typewriter: more faithful to the machine i'm copying 2021-11-25 11:48:45 +09:00
minjaesong
5c534ed388 glyph control bits spec change 2021-11-25 10:31:16 +09:00
minjaesong
368bf0ee15 typewriter hangul: trying fixed 7 px width... 2021-11-25 09:20:45 +09:00
minjaesong
c9ccf3e7f8 punctuations kerning 2021-11-24 17:57:17 +09:00
minjaesong
0ced94cb57 0000FC for superscripts! 2021-11-24 17:44:44 +09:00
minjaesong
b158e11e25 extd kerned 2021-11-24 17:35:41 +09:00
minjaesong
f4658daa9a extc 2021-11-24 16:19:34 +09:00
minjaesong
56b4ccb848 typewriter minor adjustments 2021-11-24 15:52:19 +09:00
minjaesong
2748eeb367 typewriter keymap minor change 2021-11-24 13:32:09 +09:00
minjaesong
8647578802 wtf is this char??? 2021-11-24 10:05:53 +09:00
minjaesong
3422c20322 latin ext-b updated for unicode 14.0 2021-11-24 09:52:54 +09:00
minjaesong
4561b06428 latin ext-d updated for unicode 14.0 2021-11-24 09:49:16 +09:00
minjaesong
652f239af3 extb 2021-11-21 22:37:14 +09:00
minjaesong
c2428ff7c2 extb wip 2021-11-21 17:46:04 +09:00
minjaesong
2d5e592622 kerning data for ascii,exta,extadditional 2021-11-21 16:55:34 +09:00
minjaesong
3a569a2e2e suppress debug prints if debug=false 2021-11-21 12:19:03 +09:00
minjaesong
f600764364 automatically creating symmetrical dual for kerning rules 2021-11-20 21:05:54 +09:00
minjaesong
ab2669b555 kerning for the pairs such as Pr,Fu,Fo,etc 2021-11-20 18:36:45 +09:00
minjaesong
f43a81de3f kerning bits for 0000..00ff 2021-11-20 16:37:25 +09:00
minjaesong
33ae3fa48a First working version of the Keming Machine 2021-11-20 15:46:43 +09:00
minjaesong
12fc3eee03 fixed a bug where dots on i and j were always being removed 2021-11-20 14:36:53 +09:00
minjaesong
396954e0ee extra args not needed when you've got flipY 2021-11-18 17:42:51 +09:00
minjaesong
d65aaa6da6 added a way to change diacritic shifting direction 2021-11-18 17:34:16 +09:00
minjaesong
ae67833cb2 diacritic dot removal for i and j 2021-11-18 17:18:42 +09:00
minjaesong
4261652bdf thai glyph update 2021-11-16 22:29:35 +09:00
minjaesong
49d83a297f greek F 2021-11-16 17:57:06 +09:00
minjaesong
b3a48b23ee added diacritics placeholders to PUA 2021-11-16 17:04:49 +09:00
minjaesong
b802f9b02e changed the shape of cyrillic palochka 2021-11-16 11:12:45 +09:00
minjaesong
0afdb9c2cf minor modifications on LatinExtABCD; added support for unicode Currency Symbols 2021-11-16 11:11:13 +09:00
minjaesong
c295430866 more errorOnUnknownChar flag check 2021-11-11 16:48:53 +09:00
minjaesong
883375dc9b minor modification on Ł ł and · (middot) 2021-11-09 22:32:22 +09:00
minjaesong
6a1208b45d more wip 2021-11-08 22:23:05 +09:00
minjaesong
25084b7a94 alphanumeric wip 2021-11-07 13:51:49 +09:00
minjaesong
c325c9c30c typewriter: latin alph capitals 2021-11-06 17:28:49 +09:00
minjaesong
d89409cc73 omg i think this is fimally working 2021-11-06 13:54:04 +09:00
minjaesong
0ff564a192 another minor mod 2021-11-05 23:07:35 +09:00
minjaesong
930804cf48 minor mod on Choseong HIEUH 2021-11-05 22:52:32 +09:00
minjaesong
699981d9a2 probably useable now 2021-11-05 22:47:59 +09:00
minjaesong
947c966660 typewriter font is working but not quite 2021-11-05 17:18:11 +09:00
minjaesong
554d9a5d0b will use config string this time 2021-11-04 22:44:40 +09:00
minjaesong
45e5c39739 making new font class for typewriter; renaming existing one with more sensible name 2021-11-04 21:42:00 +09:00
minjaesong
74e540cb61 future work: typewriter input on PUA 2021-11-04 17:49:02 +09:00
minjaesong
c1ec50e166 caching is back to the hashset as we don't iterate over them 2021-10-29 17:20:30 +09:00
minjaesong
58ce18f981 hopefully normalising malformed hangul IPF coding 2021-10-22 17:50:52 +09:00
minjaesong
f1fa98880f print with codepoints will try to normalise them 2021-10-22 17:24:29 +09:00
minjaesong
0c754d09ed making CodepointSequence more useful 2021-10-21 19:21:07 +09:00
minjaesong
b40e4fcc26 wtf with the premultiplying i didn't even told it to do so 2021-10-21 12:19:08 +09:00
minjaesong
a7bb33c3a0 more glyph updates 2021-10-14 20:41:52 +09:00
minjaesong
c3930b2e08 kerning set for slashes; re-doing lowercase k 2021-10-14 15:07:00 +09:00
minjaesong
979180860e flippin' options for TextureRegionPack 2021-09-21 00:26:44 +09:00
minjaesong
61fb70975c shadow opacity configuration 2021-09-18 13:42:37 +09:00
minjaesong
1af9f7c915 adjustments on hangul letters, colon, semicolon, comma and period; importing work-files from the main game to this repo 2021-09-17 10:06:30 +09:00
minjaesong
810411de7e improved caching performance; lwjgl3 for fonttest 2021-09-16 14:51:23 +09:00
minjaesong
b9bf9ca10d copyright date update 2021-09-15 23:58:45 +09:00
minjaesong
526c16daa9 more kerning pairs 2021-09-15 23:10:28 +09:00
minjaesong
e58104d5b5 fixed an overlook where charset override control codes were not actually strings (because UTF-16) but array of characters 2021-09-15 22:43:50 +09:00
138 changed files with 4886 additions and 2079 deletions

13
.gitattributes vendored Normal file
View File

@@ -0,0 +1,13 @@
*.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
*.tga binary diff=hex
*.kra binary diff=hex

6
.gitignore vendored
View File

@@ -7,3 +7,9 @@ Terrarum-sans-bitmap*.zip
TerrarumSansBitmap*.jar
Font*.jar
tmp_*
*~
.tmp*
tmp_*
*.bak
*-autosave.kra
.directory

View File

@@ -6,6 +6,82 @@
<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>

View File

@@ -1,10 +0,0 @@
<component name="libraryTable">
<library name="com.badlogicgames.gdx:gdx:1.10.0" type="repository">
<properties maven-id="com.badlogicgames.gdx:gdx:1.10.0" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/badlogicgames/gdx/gdx/1.10.0/gdx-1.10.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

16
.idea/libraries/lib.xml generated Normal file
View File

@@ -0,0 +1,16 @@
<component name="libraryTable">
<library name="lib">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib" />
</CLASSES>
<JAVADOC />
<NATIVE>
<root url="file://$PROJECT_DIR$/lib" />
</NATIVE>
<SOURCES>
<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>

124
.idea/uiDesigner.xml generated Normal file
View File

@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

146
.idea/workspace.xml generated Executable file → Normal file
View File

@@ -5,16 +5,35 @@
<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 beforePath="$PROJECT_DIR$/.idea/artifacts/TerrarumSansBitmap.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/artifacts/TerrarumSansBitmap.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FontTestGDX/FontTestGDX.iml" beforeDir="false" afterPath="$PROJECT_DIR$/FontTestGDX/FontTestGDX.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FontTestGDX/META-INF/MANIFEST.MF" beforeDir="false" afterPath="$PROJECT_DIR$/FontTestGDX/META-INF/MANIFEST.MF" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FontTestGDX/lib/TerrarumSansBitmap.jar" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt" beforeDir="false" afterPath="$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/cjkpunct.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/cjkpunct.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/currencies_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/currencies_variable.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/futhark.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/futhark.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/richtext_furigana.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/richtext_furigana.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/typewriter/typewriter_intl_qwerty.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/typewriter/typewriter_intl_qwerty.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/typewriter/typewriter_ko_3set-390.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/typewriter/typewriter_ko_3set-390.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/wenquanyi.tga.gz" beforeDir="false" afterPath="$PROJECT_DIR$/assets/wenquanyi.tga.gz" afterDir="false" />
<change beforePath="$PROJECT_DIR$/font_drawing_template.png" beforeDir="false" afterPath="$PROJECT_DIR$/font_drawing_template.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/glyph_height_pos_annotation.png" beforeDir="false" afterPath="$PROJECT_DIR$/glyph_height_pos_annotation.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/samples/wikipedia_x86.png" beforeDir="false" afterPath="$PROJECT_DIR$/samples/wikipedia_x86.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/terrarum_sans_cyrillic_2.png" beforeDir="false" afterPath="$PROJECT_DIR$/terrarum_sans_cyrillic_2.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/testing.PNG" beforeDir="false" afterPath="$PROJECT_DIR$/testing.PNG" afterDir="false" />
<change beforePath="$PROJECT_DIR$/testtext.txt" beforeDir="false" afterPath="$PROJECT_DIR$/testtext.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/width_bit_encoding_annotated.png" beforeDir="false" afterPath="$PROJECT_DIR$/width_bit_encoding_annotated.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/typewriter_input/alphnum_glyphs_master.kra" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/typewriter_input/alphnum_glyphs_master.kra" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/typewriter_input/alphnum_glyphs_resized.kra" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/typewriter_input/alphnum_glyphs_resized.kra" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/typewriter_input/hangul_3set_glyphs_master.kra" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/typewriter_input/hangul_3set_glyphs_master.kra" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/typewriter_input/typewriter_input_template.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/typewriter_input/typewriter_input_template.psd" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/typewriter_input/typewriter_intl_qwerty.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/typewriter_input/typewriter_intl_qwerty.psd" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/typewriter_input/typewriter_ko_3set-390.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/typewriter_input/typewriter_ko_3set-390.psd" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/typewriter_input/typewriter_ko_3set_glyphs_resized.kra" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/typewriter_input/typewriter_ko_3set_glyphs_resized.kra" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -33,22 +52,30 @@
<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="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</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="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="SearchEverywhereHistoryKey" value="HashMap&#9;PSI&#9;JAVA://java.util.HashMap&#10;soft wr&#9;ACTION&#9;EditorToggleUseSoftWraps" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/lib" />
<property name="project.structure.last.edited" value="Modules" />
<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.language.Kotlin" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;last_opened_file_path&quot;: &quot;/home/torvald/Documents/Terrarum-sans-bitmap&quot;,
&quot;project.structure.last.edited&quot;: &quot;Artifacts&quot;,
&quot;project.structure.proportion&quot;: &quot;0.0&quot;,
&quot;project.structure.side.proportion&quot;: &quot;0.0&quot;
}
}</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="C:\Users\minjaesong\Documents\Terrarum-sans-bitmap\" />
@@ -56,7 +83,7 @@
<recent name="C:\Users\minjaesong\Documents\Terrarum-sans-bitmap\FontTestGDX\src" />
</key>
</component>
<component name="RunManager">
<component name="RunManager" selected="Kotlin.FontTestGDXKt">
<configuration default="true" type="Applet">
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<method v="2">
@@ -90,14 +117,8 @@
</method>
</configuration>
<configuration name="FontTestGDXKt" type="JetRunConfigurationType" temporary="true">
<module name="FontTestGDX" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="MAIN_CLASS_NAME" value="FontTestGDXKt" />
<option name="WORKING_DIRECTORY" value="" />
<module name="FontTestGDX" />
<method v="2">
<option name="Make" enabled="true" />
<option name="BuildArtifacts" enabled="true">
@@ -105,36 +126,15 @@
</option>
</method>
</configuration>
<configuration name="TypewriterGDXKt" type="JetRunConfigurationType" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="TypewriterGDXKt" />
<module name="FontTestGDX" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType">
<option name="filePath" />
<option name="vmParameters" />
<option name="alternativeJrePath" />
<option name="programParameters" />
<option name="passParentEnvs" value="true" />
<option name="workingDirectory" />
<option name="isAlternativeJrePathEnabled" value="false" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="MAIN_CLASS_NAME" />
<option name="WORKING_DIRECTORY" />
<module name="" />
<option name="filePath" />
<option name="vmParameters" />
<option name="alternativeJrePath" />
<option name="programParameters" />
<option name="passParentEnvs" value="true" />
<option name="workingDirectory" />
<option name="isAlternativeJrePathEnabled" value="false" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="MAIN_CLASS_NAME" />
<option name="WORKING_DIRECTORY" />
<method v="2">
<option name="Make" enabled="true" />
</method>
@@ -160,6 +160,7 @@
<recent_temporary>
<list>
<item itemvalue="Kotlin.FontTestGDXKt" />
<item itemvalue="Kotlin.TypewriterGDXKt" />
</list>
</recent_temporary>
</component>
@@ -196,45 +197,10 @@
</entry>
</map>
</option>
<option name="oldMeFiltersMigrated" value="true" />
</component>
<component name="WindowStateProjectService">
<state x="86" y="97" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1601262877161">
<screen x="72" y="0" width="1848" height="1080" />
</state>
<state x="86" y="97" key="#com.intellij.execution.impl.EditConfigurationsDialog/72.0.1848.1080@72.0.1848.1080" timestamp="1601262877161" />
<state x="391" y="199" key="FileChooserDialogImpl" timestamp="1601263114996">
<screen x="72" y="0" width="1848" height="1080" />
</state>
<state x="391" y="199" key="FileChooserDialogImpl/72.0.1848.1080@72.0.1848.1080" timestamp="1601263114996" />
<state width="1802" height="288" key="GridCell.Tab.0.bottom" timestamp="1601263214814">
<screen x="72" y="0" width="1848" height="1080" />
</state>
<state width="1802" height="288" key="GridCell.Tab.0.bottom/72.0.1848.1080@72.0.1848.1080" timestamp="1601263214814" />
<state width="1802" height="288" key="GridCell.Tab.0.center" timestamp="1601263214814">
<screen x="72" y="0" width="1848" height="1080" />
</state>
<state width="1802" height="288" key="GridCell.Tab.0.center/72.0.1848.1080@72.0.1848.1080" timestamp="1601263214814" />
<state width="1802" height="288" key="GridCell.Tab.0.left" timestamp="1601263214814">
<screen x="72" y="0" width="1848" height="1080" />
</state>
<state width="1802" height="288" key="GridCell.Tab.0.left/72.0.1848.1080@72.0.1848.1080" timestamp="1601263214814" />
<state width="1802" height="288" key="GridCell.Tab.0.right" timestamp="1601263214814">
<screen x="72" y="0" width="1848" height="1080" />
</state>
<state width="1802" height="288" key="GridCell.Tab.0.right/72.0.1848.1080@72.0.1848.1080" timestamp="1601263214814" />
<state x="91" y="33" key="SettingsEditor" timestamp="1601263194258">
<screen x="72" y="0" width="1848" height="1080" />
</state>
<state x="91" y="33" key="SettingsEditor/72.0.1848.1080@72.0.1848.1080" timestamp="1601263194258" />
<state width="502" height="446" key="SwitcherDM" timestamp="1601260171295">
<screen x="72" y="0" width="1848" height="1080" />
</state>
<state width="502" height="446" key="SwitcherDM/72.0.1848.1080@72.0.1848.1080" timestamp="1601260171295" />
<state width="600" height="428" key="javadoc.popup" timestamp="1601255716058">
<screen x="72" y="0" width="1848" height="1080" />
</state>
<state width="600" height="428" key="javadoc.popup/72.0.1848.1080@72.0.1848.1080" timestamp="1601255716058" />
<component name="XSLT-Support.FileAssociations.UIState">
<expand />
<select />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />

4
BuildJAR_TerrarumSansBitmap.iml Executable file → Normal file
View File

@@ -5,9 +5,9 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="1.8.0_242" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="com.badlogicgames.gdx:gdx:1.10.0" level="project" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
<orderEntry type="library" scope="PROVIDED" name="lib" level="project" />
</component>
</module>

View File

@@ -7,7 +7,7 @@ Font Spritesheets are stored in ```assets/graphics/fonts``` directory. Image for
#### 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)
## Ascenders, descenders, width informations (aka Glyph Tags)
![Alas, use more modern browser or get better internet connexion!](glyph_height_pos_annotation.png)
@@ -26,11 +26,11 @@ Each cell is 16 px wide, and any glyph you draw **must be contained within lefts
### Font Metrics
## 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 widths for variable font sheets
### Parsing Glyph Tags
![Sample of Font Spritesheet with annotation](width_bit_encoding_annotated.png)
@@ -38,21 +38,95 @@ Width is encoded in binary bits, on pixels. On the font spritesheet, every glyph
### Glyph Tags
Green-tinted area (should be 10 px tall) contains the tags. Tags are defined as following:
Rightmost vertical column (should be 20 px tall) contains the tags. Tags are defined as following:
```
(LSB) 0 == Use Compiler Directive (Undefined right now, keep it as 0)
1 -, 1 = Align to this X pos of prev char,
1 | 2 = only valid if write-on-top is 1
1 | 4 = and is centre-aligned and non-zero
1 -' 8 = (if this is zero, floorOf(width/2) will be used instead)
0 -, 0 Align 1 Align 0 Align 1 Align before
1 -' 0 left 0 right 1 centre 1 the glyph
1 == write-on-top, usually it's diatritics but not always (e.g. devanagari vowel sign O)
1 -, 0 Stack 1 Stack 0 Before 1 Up &
(MSB) 0 -' 0 up 0 down 1 &After 1 Down (e.g. U+0C48)
(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
@@ -80,6 +154,10 @@ This tag can be used as a general "replace this with these" directive, as long a
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.
@@ -89,13 +167,13 @@ Also note that the font compiler will not "stack" these diacritics.
(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
## 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.
### Implementing the Korean writing system
## 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.

Binary file not shown.

3
FontTestGDX/FontTestGDX.iml Executable file → Normal file
View File

@@ -5,9 +5,10 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="1.8.0_242" jdkType="JavaSDK" />
<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>

View File

@@ -1,6 +1,3 @@
Manifest-Version: 1.0
Class-Path: lib/gdx.jar lib/gdx-backend-lwjgl.jar lib/gdx-backend-lwjg
l-natives.jar lib/gdx-natives.jar lib/kotlin-stdlib.jar lib/TerrarumSansB
itmap.jar
Main-Class: FontTestGDXKt
Manifest-Version: 1.0
Main-Class: FontTestGDXKt

View File

@@ -1,18 +1,23 @@
import com.badlogic.gdx.*
import com.badlogic.gdx.backends.lwjgl.LwjglApplication
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration
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 net.torvald.terrarumsansbitmap.gdx.GameFontBase
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: GameFontBase
lateinit var font: TerrarumSansBitmap
lateinit var inputText: List<String>
@@ -27,8 +32,12 @@ class FontTestGDX : Game() {
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 = GameFontBase("./assets", flipY = false, errorOnUnknownChar = false) // must test for two flipY cases
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")
@@ -38,11 +47,11 @@ class FontTestGDX : Game() {
batch = SpriteBatch()
println(font.charsetOverrideDefault)
println(font.charsetOverrideBulgarian)
println(font.charsetOverrideSerbian)
// 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)
@@ -67,6 +76,8 @@ class FontTestGDX : Game() {
var tex: Texture? = null
var screenshotExported = false
private val backcol = Color(.141f, .141f, .141f, 1f)
override fun render() {
if (tex == null) {
@@ -76,14 +87,18 @@ class FontTestGDX : Game() {
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
Gdx.gl.glEnable(GL20.GL_TEXTURE_2D)
Gdx.gl.glEnable(GL20.GL_BLEND)
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA)
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 = Color(0xeeeeeeff.toInt())
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 * font.lineHeight)
font.draw(batch, s, 10f, TEXH - 30f - index * lineHeight)
}
batch.end()
@@ -94,6 +109,7 @@ class FontTestGDX : Game() {
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
@@ -107,9 +123,17 @@ class FontTestGDX : Game() {
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()/appConfig.height)*TEXH - scrollOffsetY, TEXW.toFloat(), -(TEXH.toFloat() / appConfig.height) * TEXH.toFloat())
batch.draw(tex, 0f, (TEXH.toFloat()/HEIGHT)*TEXH - scrollOffsetY, TEXW.toFloat(), -(TEXH.toFloat() / HEIGHT) * TEXH.toFloat())
batch.end()
@@ -126,22 +150,23 @@ class FontTestGDX : Game() {
override fun dispose() {
font.dispose()
faketex.dispose()
}
fun scrollAdd(x: Int = 1) {
scrollOffsetY -= (TEXH.toFloat() / appConfig.height) * 20f * x
scrollOffsetY -= (TEXH.toFloat() / HEIGHT) * lineHeight * x
}
fun scrollSub(x: Int = 1) {
scrollOffsetY += (TEXH.toFloat() / appConfig.height) * 20f * x
scrollOffsetY += (TEXH.toFloat() / HEIGHT) * lineHeight * x
}
class Navigator(val main: FontTestGDX) : InputAdapter() {
override fun scrolled(amount: Int): Boolean {
if (amount >= 0)
main.scrollSub(amount)
override fun scrolled(amountX: Float, amountY: Float): Boolean {
if (amountY >= 0)
main.scrollSub(amountY.toInt())
else
main.scrollAdd(-amount)
main.scrollAdd(-amountY.toInt())
return true
}
@@ -155,19 +180,106 @@ class FontTestGDX : Game() {
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: LwjglApplicationConfiguration
lateinit var appConfig: Lwjgl3ApplicationConfiguration
const val TEXW = 874
const val TEXH = 2400
const val TEXH = 24 * 130
const val WIDTH = TEXW
const val HEIGHT = 768
fun main(args: Array<String>) {
appConfig = LwjglApplicationConfiguration()
appConfig.vSyncEnabled = false
appConfig.resizable = false//true;
appConfig.width = TEXW
appConfig.height = 768
appConfig.title = "Terrarum Sans Bitmap Test (GDX)"
LwjglApplication(FontTestGDX(), appConfig)
appConfig = Lwjgl3ApplicationConfiguration()
appConfig.useVsync(false)
appConfig.setResizable(false)
appConfig.setWindowedMode(WIDTH, HEIGHT)
appConfig.setTitle("Terrarum Sans Bitmap Test")
Lwjgl3Application(FontTestGDX(), appConfig)
}

View 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)
}

View File

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

View File

@@ -1,4 +1,4 @@
Copyright (c) 2017-2020 see CONTRIBUTORS.txt
Copyright (c) 2017-2024 CuriousTorvald (minjaesong)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

Binary file not shown.

View File

@@ -8,10 +8,10 @@ The JAR package is meant to be used with LibGDX (extends ```BitmapFont``` class)
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.
#### Notes and Limitations
- Displaying Bulgarian/Serbian variants of Cyrillic requires special Control Characters. (`GameFontBase.charsetOverrideBulgarian` -- U+FFFC1; `GameFontBase.charsetOverrideSerbian` -- U+FFFC2)
- All Han characters are in Mainland Chinese variant. There is no plan to support the other variants unless there is someone willing to do the drawing of the characters
- Only the Devanagari and Tamil has full (as much as I can) ligature support for Indic scripts -- Bengali script does not have any ligature support
- 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.
### Design Goals
@@ -33,12 +33,14 @@ The issue page is open. If you have some issues to submit, or have a question, p
On your code (Kotlin):
import net.torvald.terrarumsansbitmap.gdx.TerrarumSansBitmap
class YourGame : Game() {
lateinit var fontGame: Font
override fun create() {
fontGame = GameFontBase(path_to_assets)
fontGame = TerrarumSansBitmap(path_to_assets, ...)
...
}
@@ -53,12 +55,14 @@ On your code (Kotlin):
On your code (Java):
import net.torvald.terrarumsansbitmap.gdx.TerrarumSansBitmap;
class YourGame extends BasicGame {
Font fontGame;
@Override void create() {
fontGame = new GameFontBase(path_to_assets);
fontGame = new TerrarumSansBitmap(path_to_assets, ...);
...
}
@@ -71,43 +75,6 @@ On your code (Java):
}
}
### 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)
...
}
override fun render(gc: GameContainer, g: Graphics) {
g.font = fontGame
g.drawString(...)
}
}
On your code (Java):
class YourGame extends BasicGame {
Font fontGame;
@Override void init(GameContainer gc) {
fontGame = new GameFontBase(path_to_assets);
...
}
@Override void render(GameContainer gc, Graphics g) {
g.setFont(fontGame);
g.drawString(...);
}
}
### How to Use Color Code
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.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

After

Width:  |  Height:  |  Size: 131 B

BIN
assets/bengali_variable.tga LFS Executable file

Binary file not shown.

BIN
assets/braille_variable.tga LFS Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

BIN
assets/currencies_variable.tga LFS Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

BIN
assets/devanagari_variable.tga LFS Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

BIN
assets/internal_variable.tga LFS Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 130 B

BIN
assets/sundanese_variable.tga LFS Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 131 B

BIN
assets/typewriter/audio/cr0.wav LFS Normal file

Binary file not shown.

BIN
assets/typewriter/audio/cr1.wav LFS Normal file

Binary file not shown.

BIN
assets/typewriter/audio/cr2.wav LFS Normal file

Binary file not shown.

BIN
assets/typewriter/audio/cr3.wav LFS Normal file

Binary file not shown.

BIN
assets/typewriter/audio/cr4.wav LFS Normal file

Binary file not shown.

BIN
assets/typewriter/audio/cr5.wav LFS Normal file

Binary file not shown.

BIN
assets/typewriter/audio/crlf.wav LFS Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
assets/typewriter/audio/space.wav LFS Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 131 B

BIN
demo.PNG Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 152 KiB

View File

@@ -5,11 +5,12 @@ There are many bitmap fonts on the internet. You care for the multilingual suppo
most of them do not support your language, vector fonts take too much time to load, and even
then their legibility suffers because screw built-in antialias.
You somehow found a multilingual one, and it makes your game look like an old computer, and you say:
You somehow found a multilingual one, and it makes your text as if they came straight from an old
computer terminal, and you say:
“Well, better than nothing… no, its ugly.”
You speak japanese and you wish to support it, but then このクソなfont only good for displaying
You speak Japanese and wish to support it, but then このクソなfont only good for displaying
Japanese, its not even truly multilingual, and their English look uncanny and inconsistent.
Eventually you just mix different fonts together, and the results were always mildly infuriating.
@@ -51,17 +52,20 @@ How multilingual? Real multilingual!
􏻬Ѕидарски пејзаж: шугав билмез со чудење џвака ќофте и кељ на туѓ цех􀀀
􏻬Щётканы фермд пийшин цувъя. Бөгж зогсч хэльюү􀀀
􏻬Pchnąć w tę łódź jeża lub ośm skrzyń fig􀀀
􏻬कः खगौघाङचिच्छौजा झाञ्ज्ञोऽटौठीडडण्ढणः। तथोदधीन् पफर्बाभीर्मयोऽरिल्वाशिषां सहः॥􀀀
􏻬Înjurând pițigăiat, zoofobul comandă vexat whisky și tequila􀀀
􏻬Широкая электрификация южных губерний даст мощный толчок подъёму сельского хозяйства􀀀
􏻬अद्वैतामृवर्षिणीं भगवतीमष्टादशाध्यायिनीम् अम्ब त्वामनुसन्दधामि भगवद्गीते भवद्वेषिणीम् ॥􀀀
􏻬󿿂Ајшо, лепото и чежњо, за љубав срца мога дођи у Хаџиће на кафу󿿀􀀀
􏻬ᮙᮛᮔᮨᮂᮔ ᮓᮤᮘᮨᮛᮨ ᮃᮊᮜ᮪ ᮏᮩᮀ ᮠᮒᮨ ᮔᮥᮛᮔᮤ, ᮎᮙ᮪ᮕᮥᮁ-ᮌᮅᮜ᮪ ᮏᮩᮀ ᮞᮞᮙᮔ ᮃᮚ ᮓᮤᮔ ᮞᮥᮙᮔᮨᮒ᮪ ᮓᮥᮓᮥᮜᮥᮛᮔ᮪􀀀
􏻬Jovencillo emponzoñado de whisky: ¡qué figurota exhibe!􀀀
􏻬எழுத்து வடிவங்களுக்கு வார்த்தைகள் மற்றும் வாக்கியங்கள் போலவே தொனி, ஒலி பண்பு, தன்மை உண்டு􀀀
􏻬นายสังฆภัณฑ์ เฮงพิทักษ์ฝั่ง ผู้เฒ่าซึ่งมีอาชีพเป็นฅนขายฃวด ถูกตำรวจปฏิบัติการจับฟ้องศาล ฐานลักนาฬิกาคุณหญิงฉัตรชฎา ฌานสมาธิ􀀀
􏻬Pijamalı hasta yağız şoföre çabucak güvendi􀀀
􏻬Жебракують філософи при ґанку церкви в Гадячі, ще й шатро їхнє п’яне знаємо􀀀
􏻬Do bạch kim rất quý nên sẽ dùng để lắp vô xương􀀀
􏻬日堀油告観観藤村抄海評業庁経賃室弁市。太撮収改売週法所何都慣次現。価紙一無三洋日話転手治稿載末替付致治。􀀀
􏻬[pʰnɣɬɥi.m͡ŋχɫʍɨnaɸ.cθʊɫɯ.ɹɨɫʏ͡ɛx.ɯ͡ɣaxɲaɣɫ.ɸtʰɑɣɴ]􀀀
􏻬⠑⠥⠊⠵⠀⠟⠫⠒⠵⠀⠓⠗⠎⠉⠂⠀⠠⠊⠗⠘⠍⠓⠎⠀⠨⠣⠩⠐⠥⠍⠑⠱⠀⠈⠪⠀⠨⠷⠎⠢⠈⠧⠀⠈⠏⠒⠐⠕⠝⠀⠕⠌⠎⠀⠊⠿⠊⠪⠶⠚⠊􀀀
􏃯Features:􀀀
@@ -103,14 +107,21 @@ How multilingual? Real multilingual!
􎳌Rejoice, now we can render Old Korean in a correct way!􀀀
􏃯Unicode References:􀀀
􏃯Supported Unicode Blocks:􀀀
Basic Latin Latin-1 Supplement Latin Extended-A Latin Extended-B IPA Extension Greek Cyrillic
Cyrillic Supplement Armenian Devanagari Bengali Thai Georgian Hangul Jamo Cherokee Runic
Georgian Extended Greek Extended General Punctuations Superscripts and Subscripts CJK Symbols
Latin Extended-C Kana Hangul Compatibility Jamo Kana Phonetic Extensions CJK Unihan Extension A
CJK Unihan Latin Extended-D Hangul Jamo Extended-A Hangul Syllables Hangul Jamo Extended-B
Fullwidth Forms Kana Supplement
Basic Latin Latin-1 Supplement Latin Extended-A Latin Extended-B IPA Extensions Spacing Modifier Letters
Combining Diacritical Marks Greek and Coptic􏿆ᴱ􀀀 Cyrillic􏿆ᴭ􀀀 Cyrillic Supplement􏿆ᴭ􀀀 Armenian Devanagari
Bengali􏿆ᶠⁱ􀀀 Tamil Thai Georgian􏿆ჼ􀀀 Hangul Jamo Cherokee􏿆⁷􀀀 Runic Sundanese Georgian Extended
Sundanese Supplement Phonetic Extensions Phonetic Extensions Supplement Latin Extended Additional
Greek Extended General Punctuations Superscripts and Subscripts Currency Symbols Letterlike Symbols
Braile Patterns Latin Extended-C CJK Symbols and Punctuation Hiragana Katakana
Hangul Compatibility Jamo Katakana Phonetic Extensions CJK Unified Ideographs Extension A􏿆¹²·¹􀀀
CJK Unified Ideographs􏿆⁶􀀀 Latin Extended-D Hangul Jamo Extended-A Hangul Syllables
Hangul Jamo Extended-B Halfwidth and Fullwidth Forms Kana Supplement􏿆⁹􀀀 Enclosed Alphanumeric Supplement
􏿆ᴭ􀀀 No support for archæic letters 􏿆ᴱ􀀀 No support for Coptic
􏿆ᶠⁱ􀀀 No support for ligatures 􏿆ჼ􀀀 Mkhedruli only
􏿆⁶􀀀 􏿆⁷􀀀 􏿆⁹􀀀 􏿆¹²·¹􀀀 Up to the specified Unicode version
GitHubs issue page is open! You can report any 􏽕errors􀀀, or leave 􏽕suggestions􀀀.
You can help this font to be more versatile. (for more languages, more frameworks) 􏽕Clone􀀀 this repo, make

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

108
keming_machine.txt Normal file
View File

@@ -0,0 +1,108 @@
--- Pixel 0
- Lowheight bit
- encoding: has pixel - it's low height
- used by the diacritics system to quickly look up if the character is low height without parsing the Pixel 1
### Legends
#
# A·B < unset for lowheight miniscules, as in e
# |·| < space we don't care
# C·D < middle hole for majuscules, as in C
# E·F < middle hole for miniscules, as in c
# G·H
# ――― < baseline
# |·|
# J·K
--- Pixel 1
- A..K Occupied (1024)
- Is ABGH are all Ys instead of Bars? (2)
- Say, A is Bar but E is wye (e.g. Ꮨ), this condition is false; this character must be encoded as ABDFGH(B).
- encoding:
- <MSB> Y0000000 JK000000 ABCDEFGH <LSB>
- Y: Bar/Wye Mode
- A..K: arguments
- B-type will contract the space by 2 pixels, while Y-type will do it by 1
# Capital/lower itself is given using the pixel 0 due to the diacritics processing
--- Examples
- AB(B): T
- ABCEGH(B): C
- ABCEFGH(Y): K
- ABCDEG: Ꮅ
- ABCDEFGH: B,D,O
- ABCDFH: Ч
- ABCEG: Г
- ABGH: Ꮖ
- ACDEG: Ꮀ
- ACDEFGH: h,Ƅ
- ACDFH: ߆
- ACEGH: L
- AH(Y): \
- BDEFGH: J
- BDFGH: ɺ,ป
- BG(Y): /
- CD: Ⴕ
- CDEF(Y): Φ
- CDEFGH: a,c,e,i,o,φ,ϕ
- CDEFGHJK: g
- CDEFGHK: ƞ
- AB(Y): Y
- ABCD(Y): V
- CDEF(Y): v
- EFGH(Y): ʌ
- CDGH(Y): A
--- Rules
# Legend: _ dont care
# @ must have a bit set
# ` must have a bit unset
- ͟A͟B͟C͟D͟E͟F͟G͟H͟J͟K͟ ͟ ͟ ͟A͟B͟C͟D͟E͟F͟G͟H͟J͟K͟
- _@_`___`__ — `_________ # Γe,TJ ; Ye,YJ,Ve,VJ,TA,ΓA,VA,Vʌ,YA,Yʌ,yA,yʌ,/a,/d
- _@_@___`__ — `___`_@___ # Pɺ but NOT Po,PJ
- _@_@___`__ — `___@_____ # Fo,PJ (always 1 px)
- ___`_`____ — `___@_`___ # Cꟶ,Kꟶ,Lꟶ,Γꟶ
- ___`_`____ — `_@___`___ # CꟵ,KꟵ,LꟵ,ΓꟵ
-----------------------------------------------------
- _`________ — @_`___`___ # eꞀ,LT ; eY,LY,eV,LV,AT,AꞀ,AY,Ay,λY,λy,a\,b\
- _`___`_@__ — @_@___`___ # Lꟼ but NOT oꟼ,bꟼ
- _`___@____ — @_@___`___ # oꟼ,bꟼ (always 1 px)
- _`___@_`__ — __`_`_____ # ⱶƆ,ⱶJ
- _`_@___`__ — __`_`_____ # ⱵƆ,ⱵJ
--- Implementation
code: |
val posTable = intArrayOf(7,6,5,4,3,2,1,0,9,8)
class RuleMask(s: String) {
private var careBits = 0
private var ruleBits = 0
init {
s.forEachIndexed { index, char ->
when (char) {
'@' -> {
careBits = careBits or (1 shl posTable[index])
ruleBits = ruleBits or (1 shl posTable[index])
}
'`' -> {
careBits = careBits or (1 shl posTable[index])
}
}
}
}
fun matches(shapeBits: Int) = ((shapeBits and careBits) and ruleBits) == 0
}
--- Pixel 2
dot removal for diacritics:
- All 24 bits are used to put replacement character
- encoding:
- <MSB> RRRRRRRR GGGGGGGG BBBBBBBB <LSB>

View File

@@ -1,16 +1,39 @@
package net.torvald.terrarumsansbitmap
/**
* Created by minjaesong on 2021-11-25.
*/
data class DiacriticsAnchor(val type: Int, val x: Int, val y: Int, val xUsed: Boolean, val yUsed: Boolean)
/**
* Created by minjaesong on 2018-08-07.
*/
data class GlyphProps(
val width: Int,
val writeOnTop: Boolean,
val alignWhere: Int,
val alignXPos: Int,
val isLowheight: Boolean = false,
val nudgeX: Int = 0,
val nudgeY: Int = 0,
val diacriticsAnchors: Array<DiacriticsAnchor> = Array(6) { DiacriticsAnchor(it, 0, 0, false, false) },
val alignWhere: Int = 0, // ALIGN_LEFT..ALIGN_BEFORE
val writeOnTop: Int = -1, // -1: false, 0: Type-0, 1: Type-1, etc;
val stackWhere: Int = 0, // STACK_UP..STACK_UP_N_DOWN
val extInfo: IntArray = IntArray(15),
val hasKernData: Boolean = false,
val isKernYtype: Boolean = false,
val kerningMask: Int = 255,
val directiveOpcode: Int = 0, // 8-bits wide
val directiveArg1: Int = 0, // 8-bits wide
val directiveArg2: Int = 0, // 8-bits wide
val rtl: Boolean = false,
val stackWhere: Int = 0,
var extInfo: IntArray? = null
) {
companion object {
const val ALIGN_LEFT = 0
@@ -22,35 +45,62 @@ data class GlyphProps(
const val STACK_DOWN = 1
const val STACK_BEFORE_N_AFTER = 2
const val STACK_UP_N_DOWN = 3
const val STACK_DONT = 4
const val DIA_OVERLAY = 1
const val DIA_JOINER = 2
const val DIA_OVERLAY = 2
// const val DIA_JOINER = 2
private fun Boolean.toInt() = if (this) 1 else 0
}
constructor(width: Int, tags: Int) : this(
width,
tags.ushr(7).and(1) == 1,
tags.ushr(5).and(3),
tags.ushr(1).and(15),
tags.and(1) == 1,
tags.ushr(8).and(3)
/*constructor(width: Int, tags: Int) : this(
width,
tags.ushr(7).and(1) == 1,
tags.ushr(5).and(3),
tags.ushr(1).and(15),
tags.and(1) == 1,
tags.ushr(8).and(3),
tags.and(1) == 1
)
fun isOverlay() = writeOnTop && alignXPos == 1
constructor(width: Int, tags: Int, isLowheight: Boolean, isKernYtype: Boolean, kerningMask: Int) : this(
width,
tags.ushr(7).and(1) == 1,
tags.ushr(5).and(3),
tags.ushr(1).and(15),
tags.and(1) == 1,
tags.ushr(8).and(3),
tags.and(1) == 1,
null,
true,
isLowheight,
isKernYtype,
kerningMask
)*/
// fun isOverlay() = writeOnTop && alignXPos == 1
override fun hashCode(): Int {
val tags = rtl.toInt() or alignXPos.shl(1) or alignWhere.shl(5) or
val tags = rtl.toInt() or alignWhere.shl(5) or
writeOnTop.toInt().shl(7) or stackWhere.shl(8)
var hash = -2128831034
extInfo?.forEach {
extInfo.forEach {
hash = hash xor it
hash = hash * 16777619
}
diacriticsAnchors.forEach {
hash = hash xor it.type
hash = hash * 16777619
hash = hash xor (it.x or (if (it.xUsed) 128 else 0))
hash = hash * 16777619
hash = hash xor (it.y or (if (it.yUsed) 128 else 0))
hash = hash * 16777619
}
hash = hash xor tags
hash = hash * 167677619
@@ -62,5 +112,21 @@ data class GlyphProps(
return other is GlyphProps && this.hashCode() == other.hashCode()
}
fun requiredExtInfoCount() = if (stackWhere == STACK_BEFORE_N_AFTER) 2 else 0
fun requiredExtInfoCount() =
if (stackWhere == STACK_BEFORE_N_AFTER)
2
else if (directiveOpcode in 0b10000_000..0b10000_111)
7
else 0
fun isPragma(pragma: String) = when (pragma) {
"replacewith" -> directiveOpcode in 0b10000_000..0b10000_111
else -> false
}
fun forEachExtInfo(action: (Int) -> Unit) = extInfo.slice(0 until requiredExtInfoCount()).forEach(action)
fun forEachExtInfoIndexed(action: (Int, Int) -> Unit) = extInfo.slice(0 until requiredExtInfoCount()).forEachIndexed(action)
val isIllegal: Boolean
get() = directiveOpcode == 255
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
/*
* Terrarum Sans Bitmap
*
* Copyright (c) 2018 Minjae Song (Torvald)
* Copyright (c) 2017-2021 Minjae Song (Torvald)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -110,8 +110,6 @@ class PixmapRegionPack(
// todo globalFlipY ?
/*return*/region
}
}
@@ -152,8 +150,6 @@ class PixmapRegionPack(
// todo globalFlipY ?
/*return*/region
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
/*
* Terrarum Sans Bitmap
*
* Copyright (c) 2017 Minjae Song (Torvald)
* Copyright (c) 2017-2021 Minjae Song (Torvald)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -40,17 +40,18 @@ class TextureRegionPack(
val vGap: Int = 0,
val hFrame: Int = 0,
val vFrame: Int = 0,
val xySwapped: Boolean = false // because Unicode chart does, duh
val xySwapped: Boolean = false, // because Unicode chart does, duh
val flipX: Boolean = false,
val flipY: Boolean = false
): Disposable {
constructor(ref: String, tileW: Int, tileH: Int, hGap: Int = 0, vGap: Int = 0, hFrame: Int = 0, vFrame: Int = 0, xySwapped: Boolean = false) :
this(Texture(ref), tileW, tileH, hGap, vGap, hFrame, vFrame, xySwapped)
constructor(fileHandle: FileHandle, tileW: Int, tileH: Int, hGap: Int = 0, vGap: Int = 0, hFrame: Int = 0, vFrame: Int = 0, xySwapped: Boolean = false) :
this(Texture(fileHandle), tileW, tileH, hGap, vGap, hFrame, vFrame, xySwapped)
constructor(ref: String, tileW: Int, tileH: Int, hGap: Int = 0, vGap: Int = 0, hFrame: Int = 0, vFrame: Int = 0, xySwapped: Boolean = false, flipX: Boolean = false, flipY: Boolean = false) :
this(Texture(ref), tileW, tileH, hGap, vGap, hFrame, vFrame, xySwapped, flipX, flipY)
constructor(fileHandle: FileHandle, tileW: Int, tileH: Int, hGap: Int = 0, vGap: Int = 0, hFrame: Int = 0, vFrame: Int = 0, xySwapped: Boolean = false, flipX: Boolean = false, flipY: Boolean = false) :
this(Texture(fileHandle), tileW, tileH, hGap, vGap, hFrame, vFrame, xySwapped, flipX, flipY)
companion object {
/** Intented for Y-down coord system, typically fon Non-GDX codebase */
var globalFlipY = false
}
val regions: Array<TextureRegion>
@@ -70,7 +71,7 @@ class TextureRegionPack(
region.setRegion(texture)
region.setRegion(rx, ry, tileW, tileH)
region.flip(false, globalFlipY)
region.flip(flipX, flipY)
/*return*/region
}
@@ -84,7 +85,7 @@ class TextureRegionPack(
region.setRegion(texture)
region.setRegion(rx, ry, tileW, tileH)
region.flip(false, globalFlipY)
region.flip(flipX, flipY)
/*return*/region
}
@@ -93,6 +94,8 @@ class TextureRegionPack(
fun get(x: Int, y: Int) = regions[y * horizontalCount + x]
fun forEach(action: (TextureRegion) -> Unit) = regions.forEach(action)
override fun dispose() {
texture.dispose()
}

View File

@@ -0,0 +1,634 @@
package net.torvald.terrarumtypewriterbitmap.gdx
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.Input
import com.badlogic.gdx.graphics.Pixmap
import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.graphics.g2d.Batch
import com.badlogic.gdx.graphics.g2d.BitmapFont
import com.badlogic.gdx.graphics.g2d.GlyphLayout
import com.badlogic.gdx.utils.GdxRuntimeException
import net.torvald.terrarumsansbitmap.DiacriticsAnchor
import net.torvald.terrarumsansbitmap.GlyphProps
import net.torvald.terrarumsansbitmap.gdx.*
import net.torvald.terrarumsansbitmap.gdx.CodePoint
import net.torvald.terrarumsansbitmap.gdx.TerrarumSansBitmap.Companion.TextCacheObj
import net.torvald.terrarumsansbitmap.gdx.TerrarumSansBitmap.Companion.ShittyGlyphLayout
import java.io.BufferedOutputStream
import java.io.FileOutputStream
import java.io.Reader
import java.util.zip.GZIPInputStream
import kotlin.math.roundToInt
/**
* Config File Syntax:
*
* ```
* identifier,image file name,relative codepoint
* # working example:
* intl_qwerty_typewriter,typewriter_intl_qwerty.tga,0
* ko_kr_3set-390_typewriter,typewriter_ko_3set-390.tga,16
* ```
*
* // the Relative Codepoint of 16 should point to U+F3000
*
* Created by minjaesong on 2021-11-04.
*/
class TerrarumTypewriterBitmap(
fontDir: String,
configFile: Reader,
val flipY: Boolean = false,
var errorOnUnknownChar: Boolean = false,
val textCacheSize: Int = 256,
val debug: Boolean = false
) : BitmapFont() {
override fun getLineHeight() = 20f
override fun getXHeight() = 8f
override fun getCapHeight() = 12f
override fun getAscent() = 3f
override fun getDescent() = 3f
override fun isFlipped() = flipY
var interchar = 0
val glyphProps = HashMap<CodePoint, GlyphProps>()
private val sheets = HashMap<String, PixmapRegionPack>()
private val spriteSheetNames = HashMap<String, String>()
private val codepointStart = HashMap<String, CodePoint>()
private val codepointToSheetID = HashMap<Int, String>()
private var textCacheCap = 0
private val textCache = HashMap<Long, TextCacheObj>(textCacheSize * 2)
private val colourBuffer = HashMap<CodePoint, ARGB8888>()
/**
* Insertion sorts the last element fo the textCache
*/
private fun addToCache(text: CodepointSequence, linotype: Texture, width: Int) {
val cacheObj =
TextCacheObj(text.getHash(), ShittyGlyphLayout(text, linotype, width))
if (textCacheCap < textCacheSize) {
textCache[cacheObj.hash] = cacheObj
textCacheCap += 1
}
else {
// randomly eliminate one
textCache.remove(textCache.keys.random())!!.dispose()
// add new one
textCache[cacheObj.hash] = cacheObj
}
}
private fun getCache(hash: Long): TextCacheObj? {
return textCache[hash]
}
private fun getColour(codePoint: Int): Int { // input: 0x10F_RGB, out: RGBA8888
if (colourBuffer.containsKey(codePoint))
return colourBuffer[codePoint]!!
val r = codePoint.and(0x0F00).ushr(8)
val g = codePoint.and(0x00F0).ushr(4)
val b = codePoint.and(0x000F)
val col = r.shl(28) or r.shl(24) or
g.shl(20) or g.shl(16) or
b.shl(12) or b.shl(8) or
0xFF
colourBuffer[codePoint] = col
return col
}
init {
val fontParentDir = if (fontDir.endsWith('/') || fontDir.endsWith('\\')) fontDir else "$fontDir/"
configFile.forEachLine {
if (!it.startsWith("#")) {
val csv = it.split(',')
if (csv.size != 3) throw IllegalArgumentException("Malformed CSV line: '$it'")
val key = csv[0]
val sheetname = csv[1]
val cpstart = csv[2].toInt() * 256 + 0xF9000
spriteSheetNames[key] = sheetname
codepointStart[key] = cpstart
for (k in cpstart until cpstart + 256) {
codepointToSheetID[k] = key
}
}
}
spriteSheetNames.forEach { key, filename ->
var pixmap: Pixmap
println("[TerrarumTypewriterBitmap] loading texture $filename [VARIABLE]")
// unpack gz if applicable
if (filename.endsWith(".gz")) {
val tmpFileName = "tmp_${filename.dropLast(7)}.tga"
try {
val gzi = GZIPInputStream(Gdx.files.internal(fontParentDir + filename).read(8192))
val wholeFile = gzi.readBytes()
gzi.close()
val fos = BufferedOutputStream(FileOutputStream(tmpFileName))
fos.write(wholeFile)
fos.flush()
fos.close()
pixmap = Pixmap(Gdx.files.internal(tmpFileName))
}
catch (e: GdxRuntimeException) {
//e.printStackTrace()
System.err.println("[TerrarumTypewriterBitmap] said texture not found, skipping...")
pixmap = Pixmap(1, 1, Pixmap.Format.RGBA8888)
}
//File(tmpFileName).delete()
}
else {
pixmap = try {
Pixmap(Gdx.files.internal(fontParentDir + filename))
} catch (e: GdxRuntimeException) {
//e.printStackTrace()
System.err.println("[TerrarumTypewriterBitmap] said texture not found, skipping...")
Pixmap(1, 1, Pixmap.Format.RGBA8888)
}
}
val cpstart = codepointStart[key]!!
buildWidthTable(pixmap, cpstart until cpstart + 256, 16)
val texRegPack = PixmapRegionPack(pixmap,
TerrarumSansBitmap.W_VAR_INIT,
TerrarumSansBitmap.H,
TerrarumSansBitmap.HGAP_VAR, 0
)
sheets[key] = texRegPack
pixmap.dispose() // you are terminated
}
glyphProps[0] = GlyphProps(0)
}
private fun getSheetType(c: CodePoint) = codepointToSheetID[c] ?: "unknown"
private fun getSheetwisePosition(cPrev: Int, ch: Int) = getSheetType(ch).let {
val coff = ch - (codepointStart[it] ?: 0)
intArrayOf(coff % 16, coff / 16)
}
private fun Boolean.toInt() = if (this) 1 else 0
private fun Int.tagify() = if (this and 255 == 0) 0 else this
private fun buildWidthTable(pixmap: Pixmap, codeRange: Iterable<Int>, cols: Int = 16) {
val binaryCodeOffset = TerrarumSansBitmap.W_VAR_INIT
val cellW = TerrarumSansBitmap.W_VAR_INIT + 1
val cellH = TerrarumSansBitmap.H
for (code in codeRange) {
val cellX = ((code - codeRange.first()) % cols) * cellW
val cellY = ((code - codeRange.first()) / cols) * cellH
val codeStartX = cellX + binaryCodeOffset
val codeStartY = cellY
var width = (0..4).fold(0) { acc, y -> acc or ((pixmap.getPixel(codeStartX, codeStartY + y).and(255) != 0).toInt() shl y) }
val isLowHeight = (pixmap.getPixel(codeStartX, codeStartY + 5).and(255) != 0)
if (code in 0xF2000..0xF3FFF && code and 127 == Input.Keys.BACKSPACE) {
width *= -1
}
// Keming machine parameters
val kerningBit1 = pixmap.getPixel(codeStartX, codeStartY + 6).tagify()
val kerningBit2 = pixmap.getPixel(codeStartX, codeStartY + 7).tagify()
val kerningBit3 = pixmap.getPixel(codeStartX, codeStartY + 8).tagify()
val kerningBit4 = pixmap.getPixel(codeStartX, codeStartY + 9).tagify()
var isKernYtype = ((kerningBit1 and 0x80000000.toInt()) != 0)
var kerningMask = kerningBit1.ushr(8).and(0xFFFFFF)
val hasKernData = kerningBit1 and 255 != 0//(kerningBit1 and 255 != 0 && kerningMask != 0xFFFF)
if (!hasKernData) {
isKernYtype = false
kerningMask = 255
}
val nudgingBits = pixmap.getPixel(codeStartX, codeStartY + 10).tagify()
val nudgeX = nudgingBits.ushr(24).toByte().toInt() // signed 8-bit int
val nudgeY = nudgingBits.ushr(16).toByte().toInt() // signed 8-bit int
val diacriticsAnchors = (0..5).map {
val yPos = 11 + (it / 3) * 2
val shift = (3 - (it % 3)) * 8
val yPixel = pixmap.getPixel(codeStartX, codeStartY + yPos).tagify()
val xPixel = pixmap.getPixel(codeStartX, codeStartY + yPos + 1).tagify()
val y = (yPixel ushr shift) and 127
val x = (xPixel ushr shift) and 127
val yUsed = (yPixel ushr shift) >= 128
val xUsed = (yPixel ushr shift) >= 128
DiacriticsAnchor(it, x, y, xUsed, yUsed)
}.toTypedArray()
val alignWhere = (0..1).fold(0) { acc, y -> acc or ((pixmap.getPixel(codeStartX, codeStartY + y + 15).and(255) != 0).toInt() shl y) }
var writeOnTop = pixmap.getPixel(codeStartX, codeStartY + 17).tagify()
if (writeOnTop == 0) writeOnTop = -1
else if (writeOnTop == 0xFFFFFF) writeOnTop = 0
val stackWhere = (0..1).fold(0) { acc, y -> acc or ((pixmap.getPixel(codeStartX, codeStartY + y + 18).and(255) != 0).toInt() shl y) }
glyphProps[code] = GlyphProps(width, isLowHeight, nudgeX, nudgeY, diacriticsAnchors, alignWhere, writeOnTop, stackWhere, IntArray(15), hasKernData, isKernYtype, kerningMask)
// if (nudgingBits != 0) println("${code.charInfo()} nudgeX=$nudgeX, nudgeY=$nudgeY, nudgingBits=0x${nudgingBits.toString(16)}")
// extra info
val extCount = glyphProps[code]?.requiredExtInfoCount() ?: 0
if (extCount > 0) {
for (x in 0 until extCount) {
var info = 0
for (y in 0..18) {
// if ALPHA is not zero, assume it's 1
if (pixmap.getPixel(cellX + x, cellY + y).and(255) != 0) {
info = info or (1 shl y)
}
}
glyphProps[code]!!.extInfo[x] = info
}
}
}
}
private val pixmapOffsetY = 10
private val linotypePad = 16
private var flagFirstRun = true
private @Volatile var textBuffer = CodepointSequence(256)
private @Volatile lateinit var tempLinotype: Texture
private var nullProp = GlyphProps(15)
fun draw(batch: Batch, codepoints: CodepointSequence, x: Float, y: Float): GlyphLayout? {
// Q&D fix for issue #12
// When the line ends with a diacritics, the whole letter won't render
// If the line starts with a letter-with-diacritic, it will error out
// Some diacritics (e.g. COMBINING TILDE) do not obey lowercase letters
val charSeqNotBlank = codepoints.size > 0 // determine emptiness BEFORE you hack a null chars in
val newCodepoints = CodepointSequence()
newCodepoints.add(0)
newCodepoints.addAll(codepoints)
newCodepoints.add(0)
fun Int.flipY() = this * if (flipY) 1 else -1
// always draw at integer position; this is bitmap font after all
val x = Math.round(x)
val y = Math.round(y)
val charSeqHash = newCodepoints.getHash()
var renderCol = -1 // subject to change with the colour code
if (charSeqNotBlank) {
val cacheObj = getCache(charSeqHash)
if (cacheObj == null || flagFirstRun) {
textBuffer = newCodepoints
val (posXbuffer, posYbuffer) = buildPosMap(textBuffer)
flagFirstRun = false
//println("text not in buffer: $charSeq")
//textBuffer.forEach { print("${it.toHex()} ") }
//println()
// resetHash(charSeq, x.toFloat(), y.toFloat())
val _pw = posXbuffer.last() + 2*linotypePad
val _ph = TerrarumSansBitmap.H + (pixmapOffsetY * 2)
if (_pw < 0 || _ph < 0) throw RuntimeException("Illegal linotype dimension (w: $_pw, h: $_ph)")
val linotypePixmap = Pixmap(_pw, _ph, Pixmap.Format.RGBA8888)
var index = 0
while (index <= textBuffer.lastIndex) {
try {
val c = textBuffer[index]
val sheetID = getSheetType(c)
val (sheetX, sheetY) =
if (index == 0) getSheetwisePosition(0, c)
else getSheetwisePosition(textBuffer[index - 1], c)
val hash = getHash(c) // to be used to simulate printing irregularity
if (TerrarumSansBitmap.isColourCode(c)) {
if (c == 0x100000) {
renderCol = -1
} else {
renderCol = getColour(c)
}
} else {
try {
val posY = posYbuffer[index].flipY()
val posX = posXbuffer[index]
val texture = sheets[sheetID]?.get(sheetX, sheetY)
texture?.let {
linotypePixmap.drawPixmap(it, posX + linotypePad, posY + pixmapOffsetY, renderCol)
}
} catch (noSuchGlyph: ArrayIndexOutOfBoundsException) {
}
}
index++
}
catch (e: NullPointerException) {
System.err.println("Shit hit the multithreaded fan")
e.printStackTrace()
break
}
}
tempLinotype = Texture(linotypePixmap)
tempLinotype.setFilter(Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest)
// put things into cache
//textCache[charSeq] = ShittyGlyphLayout(textBuffer, linotype!!)
addToCache(textBuffer, tempLinotype, posXbuffer.last())
linotypePixmap.dispose()
}
else {
textBuffer = cacheObj.glyphLayout!!.textBuffer
tempLinotype = cacheObj.glyphLayout!!.linotype
}
batch.draw(tempLinotype,
(x - linotypePad).toFloat(),
(y - pixmapOffsetY).toFloat() + (if (flipY) (tempLinotype.height) else 0),
(tempLinotype.width.toFloat()),
(tempLinotype.height.toFloat()) * (if (flipY) -1 else 1)
)
}
return null
}
/**
* posXbuffer's size is greater than the string, last element marks the width of entire string.
*/
private fun buildPosMap(str: List<Int>): Pair<IntArray, IntArray> {
val posXbuffer = IntArray(str.size + 1) { 0 }
val posYbuffer = IntArray(str.size) { 0 }
var nonDiacriticCounter = 0 // index of last instance of non-diacritic char
var stackUpwardCounter = 0
var stackDownwardCounter = 0
val HALF_VAR_INIT = TerrarumSansBitmap.W_VAR_INIT.minus(1).div(2)
// this is starting to get dirty...
// persisting value. the value is set a few characters before the actual usage
var extraWidth = 0
try {
for (charIndex in 0 until posXbuffer.size - 1) {
if (charIndex > 0) {
// nonDiacriticCounter allows multiple diacritics
val thisChar = str[charIndex]
if (glyphProps[thisChar] == null && errorOnUnknownChar) {
val errorGlyphSB = StringBuilder()
Character.toChars(thisChar).forEach { errorGlyphSB.append(it) }
throw InternalError("No GlyphProps for char '$errorGlyphSB' " +
"(${thisChar.charInfo()})")
}
val thisProp = glyphProps[thisChar] ?: nullProp
val lastNonDiacriticChar = str[nonDiacriticCounter]
val itsProp = glyphProps[lastNonDiacriticChar] ?: nullProp
val kerning = 0
//println("char: ${thisChar.charInfo()}\nproperties: $thisProp")
var alignmentOffset = when (thisProp.alignWhere) {
GlyphProps.ALIGN_LEFT -> 0
GlyphProps.ALIGN_RIGHT -> thisProp.width - TerrarumSansBitmap.W_VAR_INIT
GlyphProps.ALIGN_CENTRE -> Math.ceil((thisProp.width - TerrarumSansBitmap.W_VAR_INIT) / 2.0).toInt()
else -> 0 // implies "diacriticsBeforeGlyph = true"
}
if (thisProp.writeOnTop < 0) {
posXbuffer[charIndex] = -thisProp.nudgeX +
when (itsProp.alignWhere) {
GlyphProps.ALIGN_RIGHT ->
posXbuffer[nonDiacriticCounter] + TerrarumSansBitmap.W_VAR_INIT + alignmentOffset + interchar + kerning + extraWidth
GlyphProps.ALIGN_CENTRE ->
posXbuffer[nonDiacriticCounter] + HALF_VAR_INIT + itsProp.width + alignmentOffset + interchar + kerning + extraWidth
else ->
posXbuffer[nonDiacriticCounter] + itsProp.width + alignmentOffset + interchar + kerning + extraWidth
}
nonDiacriticCounter = charIndex
stackUpwardCounter = 0
stackDownwardCounter = 0
extraWidth = thisProp.nudgeX // NOTE: sign is flipped!
}
/*else if (thisProp.writeOnTop >= 0 && thisProp.diacriticsAnchors[0].x == GlyphProps.DIA_JOINER) {
posXbuffer[charIndex] = when (itsProp.alignWhere) {
GlyphProps.ALIGN_RIGHT ->
posXbuffer[nonDiacriticCounter] + TerrarumSansBitmap.W_VAR_INIT + alignmentOffset
//GlyphProps.ALIGN_CENTRE ->
// posXbuffer[nonDiacriticCounter] + HALF_VAR_INIT + itsProp.width + alignmentOffset
else ->
posXbuffer[nonDiacriticCounter] + itsProp.width + alignmentOffset
}
}*/
else {
// set X pos according to alignment information
posXbuffer[charIndex] = when (thisProp.alignWhere) {
GlyphProps.ALIGN_LEFT, GlyphProps.ALIGN_BEFORE -> posXbuffer[nonDiacriticCounter]
GlyphProps.ALIGN_RIGHT -> {
posXbuffer[nonDiacriticCounter] - (TerrarumSansBitmap.W_VAR_INIT - itsProp.width)
}
GlyphProps.ALIGN_CENTRE -> {
val alignXPos = if (itsProp.diacriticsAnchors[0].x == 0) itsProp.width.div(2) else itsProp.diacriticsAnchors[0].x
if (itsProp.alignWhere == GlyphProps.ALIGN_RIGHT) {
posXbuffer[nonDiacriticCounter] + alignXPos + (itsProp.width + 1).div(2)
}
else {
posXbuffer[nonDiacriticCounter] + alignXPos - HALF_VAR_INIT
}
}
else -> throw InternalError("Unsupported alignment: ${thisProp.alignWhere}")
}
// set Y pos according to diacritics position
if (thisProp.alignWhere == GlyphProps.ALIGN_CENTRE) {
when (thisProp.stackWhere) {
GlyphProps.STACK_DOWN -> {
posYbuffer[charIndex] = TerrarumSansBitmap.H_DIACRITICS * stackDownwardCounter
stackDownwardCounter++
}
GlyphProps.STACK_UP -> {
posYbuffer[charIndex] = -TerrarumSansBitmap.H_DIACRITICS * stackUpwardCounter
// shift down on lowercase if applicable
/*if (getSheetType(thisChar) in TerrarumSansBitmap.autoShiftDownOnLowercase &&
lastNonDiacriticChar.isLowHeight()) {
//println("AAARRRRHHHH for character ${thisChar.toHex()}")
//println("lastNonDiacriticChar: ${lastNonDiacriticChar.toHex()}")
//println("cond: ${thisProp.alignXPos == GlyphProps.DIA_OVERLAY}, charIndex: $charIndex")
if (thisProp.alignXPos == GlyphProps.DIA_OVERLAY)
posYbuffer[charIndex] -= TerrarumSansBitmap.H_OVERLAY_LOWERCASE_SHIFTDOWN // if minus-assign doesn't work, try plus-assign
else
posYbuffer[charIndex] -= TerrarumSansBitmap.H_STACKUP_LOWERCASE_SHIFTDOWN // if minus-assign doesn't work, try plus-assign
}*/
stackUpwardCounter++
}
GlyphProps.STACK_UP_N_DOWN -> {
posYbuffer[charIndex] = TerrarumSansBitmap.H_DIACRITICS * stackDownwardCounter
stackDownwardCounter++
posYbuffer[charIndex] = -TerrarumSansBitmap.H_DIACRITICS * stackUpwardCounter
stackUpwardCounter++
}
// for BEFORE_N_AFTER, do nothing in here
}
}
}
}
}
// fill the last of the posXbuffer
if (str.isNotEmpty()) {
val lastCharProp = glyphProps[str.last()]
val penultCharProp = glyphProps[str[nonDiacriticCounter]]!!
posXbuffer[posXbuffer.lastIndex] = 1 + posXbuffer[posXbuffer.lastIndex - 1] + // adding 1 to house the shadow
if (lastCharProp != null && lastCharProp.writeOnTop >= 0) {
val realDiacriticWidth = if (lastCharProp.alignWhere == GlyphProps.ALIGN_CENTRE) {
(lastCharProp.width).div(2) + penultCharProp.diacriticsAnchors[0].x
}
else if (lastCharProp.alignWhere == GlyphProps.ALIGN_RIGHT) {
(lastCharProp.width) + penultCharProp.diacriticsAnchors[0].x
}
else 0
maxOf(penultCharProp.width, realDiacriticWidth)
}
else {
(lastCharProp?.width ?: 0)
}
}
else {
posXbuffer[0] = 0
}
}
catch (e: NullPointerException) {}
return posXbuffer to posYbuffer
}
/***
* @param col RGBA8888 representation
*/
private fun Pixmap.drawPixmap(pixmap: Pixmap, xPos: Int, yPos: Int, col: Int) {
for (y in 0 until pixmap.height) {
for (x in 0 until pixmap.width) {
val pixel = pixmap.getPixel(x, y) // Pixmap uses RGBA8888, while Color uses ARGB. What the fuck?
val newPixel = pixel colorTimes col
this.drawPixel(xPos + x, yPos + y, newPixel)
}
}
}
private infix fun Int.colorTimes(other: Int): Int {
val thisBytes = IntArray(4) { this.ushr(it * 8).and(255) }
val otherBytes = IntArray(4) { other.ushr(it * 8).and(255) }
return (thisBytes[0] times256 otherBytes[0]) or
(thisBytes[1] times256 otherBytes[1]).shl(8) or
(thisBytes[2] times256 otherBytes[2]).shl(16) or
(thisBytes[3] times256 otherBytes[3]).shl(24)
}
private infix fun Int.times256(other: Int) = multTable255[this][other]
private val multTable255 = Array(256) { left ->
IntArray(256) { right ->
(255f * (left / 255f).times(right / 255f)).roundToInt()
}
}
// randomiser effect hash ONLY
private val hashBasis = -3750763034362895579L
private val hashPrime = 1099511628211L
private var hashAccumulator = hashBasis
fun getHash(char: Int): Long {
hashAccumulator = hashAccumulator xor char.toLong()
hashAccumulator *= hashPrime
return hashAccumulator
}
fun CodepointSequence.getHash(): Long {
val hashBasis = -3750763034362895579L
val hashPrime = 1099511628211L
var hashAccumulator = hashBasis
try {
this.forEach {
hashAccumulator = hashAccumulator xor it.toLong()
hashAccumulator *= hashPrime
}
}
catch (e: NullPointerException) {
System.err.println("CodepointSequence is null?!")
e.printStackTrace()
}
return hashAccumulator
}
private fun Int.charInfo() = "U+${this.toString(16).padStart(4, '0').toUpperCase()}: ${Character.getName(this)}"
override fun dispose() {
super.dispose()
textCache.values.forEach { it.dispose() }
sheets.values.forEach { it.dispose() }
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

@@ -1,16 +1,55 @@
To
uu
Td
mm
Ye
Yd
क क्क क्च क्त क्त्य क्त्र क्त्व क्थ क्न क्प क्प्र क्म क्य क्र क्ल क्व क्श क्ष क्ष्र क्ष्ण क्ष्म क्ष्म्य क्ष्य क्ष्व क्स
ख ख्य
ग ग्ग ग्ज ग्ज्य ग्ण ग्द ग्ध ग्ध्व ग्न ग्न्य ग्ब ग्भ ग्भ्य ग्म ग्य ग्र ग्र्य ग्ल ग्व
घ घ्न घ्र घ्व
ङ ङ्क ङ्क्त ङ्क्ष ङ्क्ष्व ङ्ख ङ्ख्य ङ्ग ङ्ग्य ङ्ग्र ङ्घ ङ्घ्र ङ्न ङ्म
च च्च च्च्य च्छ च्छ्र च्छ्व च्य
ज ज्ज ज्ज्ञ ज्ज्य ज्ज्व ज्ञ ज्म ज्य ज्र ज्व
ञ ञ्च ञ्छ ञ्ज ञ्ज्ञ ञ्श ञ्श्र ञ्श्व
ट ट्क ट्ट ट्प ट्य ट्श ट्स
ठ ठ्य
ड ड्ग ड्भ ड्य ड्र ड्व
ढ ढ्य
ण ण्ट ण्ठ ण्ड ण्ड्य ण्ड्र ण्ण ण्म ण्य ण्व
त त्क त्क्र त्क्व त्क्ष त्ख त्त त्त्य त्त्र त्त्व त्थ त्न त्न्य त्प त्प्र त्फ त्म त्म्य त्य त्र त्र्य त्व त्व्य त्स त्स्त त्स्त्र त्स्थ त्स्न त्स्म त्स्य त्स्र त्स्व
थ थ्य थ्व
द द्ग द्ग्र द्द द्द्य द्द्र द्द्व द्ध द्ध्य द्ध्र द्ध्व द्न द्ब द्ब्र द्भ द्भ्य द्भ्र द्म द्य द्र द्र्य द्व द्व्य द्व्र
ध ध्न ध्म ध्य ध्र ध्व ध्ह
न न्क न्क्र न्क्ल न्क्ष न्ख न्ग न्घ न्त न्त्य न्त्र न्त्र्य न्त्व न्त्स्य न्थ न्द न्द्य न्द्र न्द्व न्ध न्ध्य न्ध्र न्न न्न्य न्न्व न्प न्प्र न्फ न्ब न्ब्र न्भ न्भ्र
न्म न्य न्र न्व न्व्य न्स न्स्थ न्स्म न्स्व न्ह
प प्त प्त्व प्न प्म प्य प्र प्ल प्स प्स्य
ब ब्ज ब्द ब्ध ब्ध्व ब्य ब्र ब्व
भ भ्ण भ्य भ्र भ्व
म म्ण म्न म्प म्ब म्ब्य म्भ म्य म्र म्ल
य य्य य्व
र र्क र्क्ष्य र्ख र्ग र्ग्य र्ग्र र्घ र्घ्य र्ङ्ग र्च र्च्छ र्च्य र्छ र्ज र्ज्ञ र्ज्य र्ज्व र्ण र्ण्य र्त र्त्त र्त्म र्त्य र्त्र र्त्व र्त्स र्त्स्न्य र्थ र्थ्य र्द
र्द्ध र्द्य र्द्र र्द्व र्ध र्ध्न र्ध्म र्ध्य र्ध्र र्ध्व र्न र्न्य र्प र्ब र्ब्र र्भ र्भ्य र्भ्र र्म र्म्य र्य र्ल र्व र्व्य र्श र्श्व र्ष र्ष्ट र्ष्ण र्ष्य र्ह र्ह्य र्ह्र
ल ल्क ल्क्य ल्ग ल्प ल्ब ल्म ल्य ल्ल ल्व
व व्य व्र
श श्च श्च्य श्छ श्न श्प श्म श्य श्र श्ल श्व श्व्य श्न्र श्व्र श्च्र
ष ष्क ष्क्र ष्ट ष्ट्य ष्ट्र ष्ट्व ष्ठ ष्ठ्य ष्ण ष्ण्य ष्प ष्प्र ष्म ष्य ष्व
स स्क स्त स्त्य स्त्र स्त्र्य स्त्व स्थ स्थ्य स्न स्प स्फ स्म स्म्य स्य स्र स्व स्स्व
ह ह्ण ह्न ह्म ह्य ह्र ह्ल ह्व
/œ̃/
/ɛ̃/
/ẽ
when the line ends with a diacritics, whole letter wont render
if the line starts with a letter-with-diacritic, it will error out
विकिपीडिया सभी विषयों पर प्रामाणिक और उपयोग, परिवर्तन
व पुनर्वितरण के लिए स्वतन्त्र ज्ञानकोश बनाने का एक बहुभाषीय
प्रकल्प है। यह यथासम्भव निष्पक्ष दृष्टिकोण वाली सूचना प्रसारित
करने के लिए कृतसंकल्प है। सर्वप्रथम अंग्रेज़ी विकिपीडिया
जनवरी 2001 में आरम्भ किया गया था, और हिन्दी
विकिपीडिया का शुभारम्भ जुलाई 2003 में हुआ। सहायता पृष्ठ
पर जाएं और प्रयोगस्थल में प्रयोग करके देखें कि आप स्वयं
किसी लेख को कैसे परिवर्तित कर सकते हैं।
र्ज्यह
परिवर्तन
र्ग्यह
अर्ग्यिह
अर्त्स्न्यौह
अर्त्स्न्यिह कृकॄ
ड्ग ड्भ ङ्ग ङ्घ ङ्म छ्व ट्ट ट्ठ ट्व ठ्ठ ठ्व ड्ड ड्ढ ड्व ढ्ढ ढ्व ष्ठ्र द्र्य
ड्ग्र ड्भ्र ङ्ग्र ङ्घ्र ङ्म्र छ्व्र ट्ट्र ट्ठ्र ट्व्र ठ्ठ्र ठ्व्र ड्ड्र ड्ढ्र ड्व्र ढ्ढ्र ढ्व्र
श्क श्ख श्ग श्घ श्ङ श्च श्छ श्ज श्झ श्ञ श्ट श्ठ श्ड श्ढ श्ण श्त श्थ श्द श्ध श्न श्प श्फ श्ब श्भ श्म श्य श्र श्ल श्व श्श श्ष श्स श्ह श्ळ श्क्ष श्ज्ञ
र्यर्‍यर‍्य र्‍कर्‍प ऱ्कऱ्प
ऱ्प र्‍प ऱ्‍प

BIN
work_files/ascii_variable.psd LFS Normal file

Binary file not shown.

BIN
work_files/bengali_variable.psd LFS Normal file

Binary file not shown.

BIN
work_files/braille_variable.psd LFS Normal file

Binary file not shown.

BIN
work_files/cjkpunct.psd LFS Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
work_files/cyrilic_variable.psd LFS Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
work_files/furigana.psd LFS Normal file

Binary file not shown.

BIN
work_files/futhark.psd LFS Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More