258 Commits
v1.3 ... v1.10

Author SHA1 Message Date
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
minjaesong
92aeb3c8aa update to kotlin 1.4; fixed a bug where trying to colour a text using gdxbatch's colour would cause undesirable results 2021-09-13 01:21:43 +09:00
minjaesong
3841611780 1.9 release 2021-03-15 19:56:53 +09:00
minjaesong
06bc8c9e2d forgot to update demo.png 2020-10-16 15:20:07 +09:00
minjaesong
21415c6f8d add: kerning sets for b and d 2020-10-06 16:31:24 +09:00
minjaesong
22c2a7aa52 fix: issue #12 2020-10-06 15:14:57 +09:00
minjaesong
0eb181f315 time to get off so i'll just commit this 2020-09-29 18:04:58 +09:00
minjaesong
45b431f953 fix: partial fix for issue #12 2020-09-29 14:07:35 +09:00
minjaesong
bbee554fec add: error msg for illegal linotype dimension 2020-09-29 11:36:59 +09:00
minjaesong
c4c67f489e fixing idiotic priority cache impl where they won't get younger 2020-05-04 00:09:05 +09:00
minjaesong
4d867d6523 replacing personalised test text 2020-05-03 23:42:06 +09:00
minjaesong
6620c11178 hangul: minor texture changes 2020-05-03 23:28:59 +09:00
minjaesong
db06cab07c cleaning up unnecessary functions 2020-05-03 22:26:45 +09:00
minjaesong
90b11cdd97 hangul: more microkerning shit 2020-05-03 20:34:12 +09:00
minjaesong
7bb92d1b4e hangul: some of the microkerning implemented in dirty way 2020-05-03 18:13:17 +09:00
minjaesong
b5dd744bd5 hangul: WEO to use wider initials just like WI and YI 2020-05-02 00:03:50 +09:00
minjaesong
34903b10d4 more hangul improvements 2020-05-01 17:12:13 +09:00
minjaesong
0c5b7c8b70 more letters for kerning charsets 2020-04-23 02:50:03 +09:00
minjaesong
cdffca98ef even more kerning pairs i can think of WIP 2020-04-23 01:16:18 +09:00
minjaesong
ce30d1d5fd major modification on hangul font 2020-04-23 01:02:57 +09:00
minjaesong
ab067044f8 more kerning pairs i can think of WIP 2020-04-21 05:17:19 +09:00
minjaesong
3e04b8bbe6 more kerning pairs WIP 2020-04-19 15:03:37 +09:00
minjaesong
4556a9e244 very crude kerning impl for Ys and Ts and AV-VA pairs 2020-04-14 23:56:08 +09:00
minjaesong
e5d04de250 character sets to use ints rather than chars 2020-04-14 23:45:35 +09:00
minjaesong
b7df181729 minor improvement on rotund r 2020-04-14 07:25:11 +09:00
minjaesong
2fd3fcfd46 support for LatinExt-D 2020-04-14 06:41:11 +09:00
minjaesong
73251d70fa completely dropping Slick2d stuffs 2020-01-14 16:26:10 +09:00
minjaesong
971f98beb3 shadow inversion to make recessed texts 2020-01-06 15:19:07 +09:00
minjaesong
abe1da35a0 kana minor edits, fixing wrong case 2019-10-03 01:24:39 +09:00
Minjae Song
29885f3ac9 updating demo.png 2019-05-31 04:14:32 +09:00
Minjae Song
56d2a98a5b hangul update 2019-05-30 14:10:27 +09:00
Minjae Song
43342fff00 demo: updating unicode references 2019-05-14 13:33:14 +09:00
Minjae Song
51d4dec6d3 new redesigned hangul 2019-05-14 13:17:20 +09:00
Minjae Song
81dc38d242 support for Compatibility Hangul 0x3130..0x318F 2019-05-13 02:27:56 +09:00
Minjae Song
863f9d91c8 hangul redraw wip -- less "laundry line" 2019-05-12 23:51:50 +09:00
Minjae Song
4c99cca7ff internal test mode 2019-05-12 17:20:22 +09:00
Minjae Song
b807b96b5f hangul redraw and punct adjustments 2019-05-12 17:10:05 +09:00
Minjae Song
91c9a7a99c TextureRegionPack is now Gdx.disposable 2019-03-10 16:43:32 +09:00
Minjae Song
778e2b0afb tweaks on left/right bumper labels 2019-02-23 23:48:18 +09:00
Minjae Song
c9055ef7b8 PUA: LR buttons are now xbox shaped, added xbox one's View and Menu buttons 2019-02-13 17:52:45 +09:00
Minjae Song
e60b95efb8 bgBG: one dark pixel fixed on 'zhe' 2019-02-08 09:54:54 +09:00
Minjae Song
9ca70a601b fixing memory leak caused by my sloppy-ass coding 2019-02-07 17:30:15 +09:00
Minjae Song
6cacc56ea8 Update README.md 2019-02-07 03:25:59 +09:00
Minjae Song
6d142f082c readme: gitlab link -> github link 2019-01-29 23:42:20 +09:00
Minjae Song
db3b13800b Merge branch 'cpu-render-pixmap-cache' 2019-01-22 22:39:15 +09:00
Minjae Song
7fe0cc9527 copyright update 2019-01-13 04:42:14 +09:00
Minjae Song
b62fee89cb fixed getWidth() not returning correct width
getWidth() is heavier than ever now, at least it's cached
2019-01-10 20:11:36 +09:00
Minjae Song
d88443814f sheet name comment on coderange, default cache size is 64 2019-01-10 18:25:24 +09:00
Minjae Song
dfeab56bb5 Update CONTRIBUTING.md 2018-12-02 02:35:58 +09:00
Minjae Song
b623727b1a potential memory leak fixed (unbound cache size) 2018-11-03 16:35:26 +09:00
minjaesong
048b683cb2 sorta works but poor performance on wall of text 2018-09-19 02:54:07 +09:00
minjaesong
35b384af53 proper render, except there can be NO transparency in color & spritesheet 2018-09-19 00:07:32 +09:00
minjaesong
cebfa27d59 this is cursed; new shadowing method pls code 2018-09-18 01:08:28 +09:00
minjaesong
c57de3a21f we have a render (but not colour) 2018-09-17 23:10:29 +09:00
minjaesong
4ad5e47758 little diagnose print 2018-09-17 21:29:55 +09:00
Minjae Song
f06ed4529c how the fuck this does not work 2018-09-17 17:51:36 +09:00
Minjae Song
8da321bdc2 fixed bad offset but still bad render 2018-09-17 17:02:09 +09:00
Minjae Song
920b11e3e9 WIP, at least it draws something 2018-09-17 16:26:25 +09:00
minjaesong
d8dd88c6a7 aggressive cacheing (ShittyGlyphLayout) 2018-09-16 18:51:11 +09:00
minjaesong
ba28b6d10c improved shadowing perf at the cost of reduced quality
black text on white background should work now
2018-09-16 16:08:34 +09:00
minjaesong
50ae1789bf this should fix issue #11
If performance is not a concern (which is WIP)
2018-09-16 14:48:02 +09:00
minjaesong
bd9784a516 release candidate 1.7 2018-09-15 16:29:27 +09:00
minjaesong
0bafde9914 latin extended-c 2018-09-10 21:31:00 +09:00
minjaesong
b3bfe6035f support for polytonic greek 2018-09-10 01:26:58 +09:00
minjaesong
c3cf795e9a I still suck at Armenian; polytone greek WIP 2018-09-10 01:02:27 +09:00
minjaesong
cefc7860b3 new armenian (#10)
- Redesigned glyphs
- Update to Unicode 11 (2 chrs added)
2018-09-09 19:51:43 +09:00
minjaesong
b8963cd3a9 full support of old hangul 2018-08-29 00:35:46 +09:00
minjaesong
32290dd504 selectively skipping spritesheets 2018-08-24 02:36:29 +09:00
minjaesong
2702f850c2 elaboration of before-and-after tag; spec change
- RTL tag removed
- we're calling the program part "the font compiler"
2018-08-24 00:37:48 +09:00
minjaesong
2e10249f27 unicode super/subscripts (fractions) 2018-08-23 03:37:22 +09:00
minjaesong
04a375328c fixing up diacritics; complete unipunct 2018-08-22 18:17:48 +09:00
minjaesong
97ef1ddc27 more fucking bengali 2018-08-21 19:54:36 +09:00
minjaesong
4057d86176 more works on IPA
diacritics Overlay and Joiner has implemented
2018-08-14 23:37:29 +09:00
minjaesong
654f7b9ac4 I overwrote the fucking demo text 2018-08-14 19:36:00 +09:00
minjaesong
91afc4af31 tʰɛstɪŋgə tʰɛstɪŋ wʌn tʉ θɹɪ
isOverlay not actually implemented
2018-08-14 19:21:12 +09:00
minjaesong
1440908820 tags definition update to accomodate more weirdness 2018-08-11 04:39:44 +09:00
minjaesong
4ce58cf5d1 made demo program actually run 2018-08-11 00:33:52 +09:00
minjaesong
620794dc57 diacritics overlap artefacts fixed
not as I intended. fuck my life
2018-08-11 00:04:19 +09:00
minjaesong
128eeec6b5 more demotexts (more caps, sanskrit)
about to make substantial changes
2018-08-10 22:18:33 +09:00
minjaesong
33468d5ded impl of georgian mtavruli 2018-08-10 22:00:13 +09:00
minjaesong
96e5bb9a7d bitmap for Georgian Mtavruli (Georgian all-caps) 2018-08-10 21:52:15 +09:00
minjaesong
6300b29ab5 fixed up Thai and Devanagari Anusvara
not perfect but it'll work
2018-08-10 04:20:03 +09:00
minjaesong
a0e2cbf756 Devanagari BETA; broke Thai diacritics again 2018-08-10 01:29:58 +09:00
minjaesong
4a36d3e7f1 bitmap for Devanagari (only) 2018-08-09 21:11:11 +09:00
minjaesong
ab0d483cb1 somehow fixed issue #8 2018-08-09 19:32:30 +09:00
minjaesong
cdd0514ca0 fixed up the test app
- exports the drawn text as demo.PNG
- scrollable with scroll wheels and arrow keys
2018-08-09 17:42:16 +09:00
minjaesong
cf3091421f bringing the shadow back 2018-08-09 15:46:57 +09:00
minjaesong
15fb3d15c0 Kana suppelements and Insular script 2018-08-09 15:34:08 +09:00
minjaesong
45532ca9b7 lemme have some debugging helper 2018-08-09 02:54:43 +09:00
minjaesong
6714bbb510 now everything is converted to UTF-32 internally
- To make working with other planes easier
2018-08-09 02:44:29 +09:00
minjaesong
77f2314b24 stacked diacritics seems working 2018-08-08 13:03:34 +09:00
minjaesong
dcd6390dbf new tagging system (see #5) WIP
- diacritics stacking does not work
- centre align with align-to-this-x-pos is untested
2018-08-08 02:22:40 +09:00
minjaesong
ecac1dc8af contribution guideline on separate md 2018-08-01 08:55:19 +09:00
minjaesong
b3174171c4 Cherokee whitespace adjustments 2018-07-29 07:09:09 +09:00
minjaesong
a0608bf032 README update 2018-07-28 05:48:33 +09:00
minjaesong
c920eb1fe4 forgot to build font demo--as always 2018-07-28 05:38:05 +09:00
minjaesong
6cf1206716 wall of demo texts; release candidate 1 2018-07-28 05:23:17 +09:00
minjaesong
dca8ed7392 A wild Cherokee language appeared! 2018-07-28 04:52:42 +09:00
minjaesong
55bdaef897 colour code is now ARGB instead of RGBA 2018-07-27 03:51:15 +09:00
minjaesong
2cc9f0ba8c more tweaks on cyrillic family; control char impl to override RU/BG/SR mode 2018-07-27 03:26:06 +09:00
minjaesong
496c17276d more sample text 2018-07-27 01:02:11 +09:00
minjaesong
6a54ea1cca refined cyrillic letters
- more based on the handwriting
2018-07-26 11:38:36 +09:00
minjaesong
3b79a5c93f glyph fixes for vietnamese 2018-07-26 05:48:38 +09:00
minjaesong
f6e2a3b049 working demo; fixed chinese shading bug
operation not guaranteed on Slick2d
2018-07-26 05:32:28 +09:00
minjaesong
379c84c22e changed project structure so that they make sense
Font tester tool (GDX only) is coming!
2018-07-26 05:10:25 +09:00
minjaesong
42e4ae298b tweaks on armenian lowercase 2017-12-10 05:08:34 +09:00
minjaesong
f3b00c83ce new shape for the asterisk 2017-11-25 23:09:09 +09:00
minjaesong
fdcba3f6e6 no message 2017-11-25 14:19:09 +09:00
minjaesong
24cb04cdef font showcase img update 2017-10-27 05:58:44 +09:00
minjaesong
e47d2c91b1 lower Eszett more distinguishable from its caps 2017-10-27 05:56:15 +09:00
minjaesong
ff0b574c45 not enough spikey for the currency sign 2017-10-23 01:01:40 +09:00
minjaesong
279ca757d9 always draw at integer position 2017-10-21 04:10:01 +09:00
minjaesong
08d54e13c0 added missing Yen sign, adjustments on some Latin-1 symbols and Ext-A long-S 2017-07-14 22:45:16 +09:00
minjaesong
5aa6177b50 added texture filter control for gdx (whether it has some effect or not) 2017-07-14 02:36:00 +09:00
minjaesong
73c4e96359 vietnamese: it was horn, not comma... 2017-07-12 22:24:34 +09:00
minjaesong
cf1ac67cb0 assets for vietnamese support 2017-07-12 21:53:46 +09:00
minjaesong
0bb8133764 more contribution guidelines 2017-07-11 15:29:28 +09:00
minjaesong
eb114d72f3 adjusted hangul (again!) and sample update 2017-07-08 00:16:19 +09:00
minjaesong
233d4ad054 runic letters 2017-07-08 00:15:51 +09:00
minjaesong
6852ec1255 little elaboration on colour code 2017-07-04 00:14:06 +09:00
minjaesong
df51ca165b fixed a bug where GDX version's getWidth() returns wrong value (and I don't really use GlyphLayout...) 2017-07-04 00:07:10 +09:00
minjaesong
a59655d628 no message 2017-07-03 13:52:16 +09:00
minjaesong
0aa0672815 minor fix on armenian 2017-07-02 19:26:01 +09:00
minjaesong
1ecc83489b forgot to hit Ctrl+S 2017-07-02 12:58:04 +09:00
minjaesong
9bb5edd7d0 voi vittu 2017-07-02 12:57:23 +09:00
minjaesong
e084606ce8 README update about how to use color codes 2017-07-02 12:55:33 +09:00
minjaesong
e23c0090f4 color code utils; colour-coded sample text 2017-07-02 12:45:58 +09:00
minjaesong
4cd29b5230 Color codes (RGBA4444), NOT tested with Slick2D 2017-07-02 03:29:11 +09:00
minjaesong
3aba6aacc7 duh moar readme 2017-06-27 12:17:49 +09:00
minjaesong
4723b864c4 README update regarding the release 2017-06-27 12:14:19 +09:00
minjaesong
0c61fa6c68 Hangul quick fix 2017-06-27 12:02:36 +09:00
minjaesong
2d9642ff6f README upd 2017-06-27 11:57:14 +09:00
minjaesong
59ee8e5a48 Kana: 'he' (for both) and Katakana 'ki' adjusted; sample update 2017-06-27 11:32:07 +09:00
minjaesong
e894471b0d README update 2017-06-20 19:44:02 +09:00
minjaesong
b2fe8c3304 release candidate 2017-06-20 18:36:58 +09:00
minjaesong
f2a0fc0d47 Slick back-port 2017-06-20 18:21:44 +09:00
minjaesong
cdbfa1bab8 forgot to push updated code :\ 2017-06-20 02:17:09 +09:00
minjaesong
15bed6f696 +IPA Extension, more fixes in the regards of consistency 2017-06-20 02:13:42 +09:00
minjaesong
318c4af68f this is what it's like right now 2017-06-19 22:57:21 +09:00
minjaesong
c5004c3ff6 Armenian, Georgian (+other Kartvelian langs) 2017-06-19 21:44:18 +09:00
minjaesong
31c1adcee4 no message 2017-06-19 00:07:29 +09:00
minjaesong
53f44f498c narrower spacing for Cyrillic capital Ge 2017-06-18 23:37:57 +09:00
minjaesong
4258192f24 Cyrillic update: support for Ukrainian, Abxazian, Azerbaijiani, etc. 2017-06-18 22:43:44 +09:00
minjaesong
c59b3cdf27 minor changes on Thai glyphs 2017-06-18 17:58:43 +09:00
minjaesong
687bc40097 fixed inverted shadow position on Han characters 2017-06-18 17:40:14 +09:00
minjaesong
ab211d6433 GDX: fixed wrong shadow col, support for flipped Y coord 2017-06-18 01:03:26 +09:00
minjaesong
65108a0630 Thai with diacritics works good enough; fixed wrong shadow of Korean 2017-06-16 22:08:14 +09:00
minjaesong
8c740a5062 Font implementation for GDX (issue #4), various format changes on the spritesheets 2017-06-16 19:34:24 +09:00
minjaesong
8897c65b98 readme - elaboration on font metrics 2017-05-27 22:55:12 +09:00
minjaesong
0a44d5c27a sample image crop 2017-05-27 22:32:13 +09:00
Minjae Song
4cffd8e864 wut 2017-05-27 22:31:06 +09:00
minjaesong
bff8bcf939 more samples 2017-05-27 22:29:23 +09:00
minjaesong
774982113a readme image update 2017-05-25 00:26:50 +09:00
minjaesong
d1981c34e3 wider and bigger hangul glyphs
- height increased for letters without Final
2017-05-22 14:02:49 +09:00
Song Minjae
275e037ea2 fixes on # $ & 2017-04-28 23:51:34 +09:00
Song Minjae
3c85722c00 change in README image and Kana font 2017-04-27 19:04:53 +09:00
166 changed files with 5190 additions and 2347 deletions

10
.gitattributes vendored Normal file
View File

@@ -0,0 +1,10 @@
*.psd filter=lfs diff=lfs merge=lfs -text
*.ogg filter=lfs diff=lfs merge=lfs -text
*.tga filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.opus filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.kra filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.wav filter=lfs diff=lfs merge=lfs -text

13
.gitignore vendored Normal file → Executable file
View File

@@ -1,2 +1,15 @@
demo/out/*
demo/lib/*
demo/assets/*
out/*
lib/*
Terrarum-sans-bitmap*.zip
TerrarumSansBitmap*.jar
Font*.jar
tmp_*
*~
.tmp*
tmp_*
*.bak
*-autosave.kra
.directory

1
.idea/.name generated Executable file
View File

@@ -0,0 +1 @@
BuildJAR_TerrarumSansBitmap

87
.idea/artifacts/FontDemoGDX.xml generated Executable file
View File

@@ -0,0 +1,87 @@
<component name="ArtifactManager">
<artifact type="jar" name="FontDemoGDX">
<output-path>$PROJECT_DIR$/</output-path>
<root id="archive" name="FontDemoGDX.jar">
<element id="module-output" name="FontTestGDX" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/FontTestGDX/META-INF/MANIFEST.MF" />
</element>
<element id="artifact" artifact-name="TerrarumSansBitmap" />
<element id="extracted-dir" path="$KOTLIN_BUNDLED$/lib/kotlin-stdlib.jar" path-in-jar="/" />
<element id="extracted-dir" path="$KOTLIN_BUNDLED$/lib/kotlin-reflect.jar" path-in-jar="/" />
<element id="extracted-dir" path="$KOTLIN_BUNDLED$/lib/kotlin-test.jar" path-in-jar="/" />
<element id="extracted-dir" path="$KOTLIN_BUNDLED$/lib/kotlin-stdlib-jdk7.jar" path-in-jar="/" />
<element id="extracted-dir" path="$KOTLIN_BUNDLED$/lib/kotlin-stdlib-jdk8.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jnlp.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-1.10.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jinput-2.0.5.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jutils-1.0.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jorbis-0.0.17.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jlayer-1.0.1-gdx.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/TerrarumSansBitmap.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-1.10.0-javadoc.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-1.10.0-sources.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-platform-1.10.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-javadoc.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-sources.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jinput-2.0.5-javadoc.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jinput-2.0.5-sources.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jutils-1.0.0-javadoc.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jutils-1.0.0-sources.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jorbis-0.0.17-javadoc.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jorbis-0.0.17-sources.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jlayer-1.0.1-gdx-javadoc.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jlayer-1.0.1-gdx-sources.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-javadoc.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-sources.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-backend-lwjgl3-1.10.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-natives-linux.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-natives-macos.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-javadoc.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-sources.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-javadoc.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-sources.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-natives-windows.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-javadoc.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-sources.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-natives-linux.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-natives-macos.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-natives-linux-arm32.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-natives-linux-arm64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-3.2.3-natives-windows-x86.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-natives-windows.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-natives-linux.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-natives-macos.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-natives-linux.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-natives-macos.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-backend-lwjgl3-1.10.0-javadoc.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-backend-lwjgl3-1.10.0-sources.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jinput-platform-2.0.5-natives-osx.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-natives-linux.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-natives-macos.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-natives-windows.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-natives-windows.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gdx-platform-1.10.0-natives-desktop.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jinput-platform-2.0.5-natives-linux.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-natives-linux-arm32.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-natives-linux-arm64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-glfw-3.2.3-natives-windows-x86.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-natives-windows.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jinput-platform-2.0.5-natives-windows.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-natives-linux-arm32.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-natives-linux-arm64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-openal-3.2.3-natives-windows-x86.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-natives-linux-arm32.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-natives-linux-arm64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-opengl-3.2.3-natives-windows-x86.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-natives-linux-arm32.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-natives-linux-arm64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.3-natives-windows-x86.jar" path-in-jar="/" />
</root>
</artifact>
</component>

12
.idea/artifacts/TerrarumSansBitmap.xml generated Executable file
View File

@@ -0,0 +1,12 @@
<component name="ArtifactManager">
<artifact type="jar" name="TerrarumSansBitmap">
<output-path>$PROJECT_DIR$/lib</output-path>
<root id="archive" name="TerrarumSansBitmap.jar">
<element id="module-output" name="BuildJAR_TerrarumSansBitmap" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/META-INF/MANIFEST.MF" />
</element>
<element id="dir-copy" path="$PROJECT_DIR$/src" />
</root>
</artifact>
</component>

9
.idea/codeStyles/Project.xml generated Executable file
View File

@@ -0,0 +1,9 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<codeStyleSettings language="kotlin">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
</codeStyleSettings>
</code_scheme>
</component>

5
.idea/codeStyles/codeStyleConfig.xml generated Executable file
View File

@@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

7
.idea/kotlinc.xml generated Executable file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinCommonCompilerArguments">
<option name="apiVersion" value="1.4" />
<option name="languageVersion" value="1.4" />
</component>
</project>

19
.idea/libraries/KotlinJavaRuntime.xml generated Normal file
View File

@@ -0,0 +1,19 @@
<component name="libraryTable">
<library name="KotlinJavaRuntime">
<CLASSES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-stdlib.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-reflect.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-test.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-stdlib-jdk7.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-stdlib-jdk8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-stdlib-sources.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-reflect-sources.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-test-sources.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-stdlib-jdk7-sources.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-stdlib-jdk8-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,8 +1,6 @@
<component name="libraryTable">
<library name="KotlinJavaRuntime">
<library name="lib">
<CLASSES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-runtime.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-reflect.jar!/" />
<root url="file://$PROJECT_DIR$/lib" />
</CLASSES>
<JAVADOC />
@@ -10,8 +8,9 @@
<root url="file://$PROJECT_DIR$/lib" />
</NATIVE>
<SOURCES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-runtime-sources.jar!/" />
<root url="file://$PROJECT_DIR$/lib" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" type="SOURCES" />
</library>
</component>

71
.idea/markdown-navigator.xml generated Executable file
View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MarkdownProjectSettings">
<PreviewSettings splitEditorLayout="SPLIT" splitEditorPreview="PREVIEW" useGrayscaleRendering="false" zoomFactor="1.0" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="true" highlightPreviewType="NONE" highlightFadeOut="5" highlightOnTyping="true" synchronizeSourcePosition="true" verticallyAlignSourceAndPreviewSyncPosition="true" showSearchHighlightsInPreview="false" showSelectionInPreview="true">
<PanelProvider>
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.panel" providerName="Default - Swing" />
</PanelProvider>
</PreviewSettings>
<ParserSettings gitHubSyntaxChange="false">
<PegdownExtensions>
<option name="ABBREVIATIONS" value="false" />
<option name="ANCHORLINKS" value="true" />
<option name="ASIDE" value="false" />
<option name="ATXHEADERSPACE" value="true" />
<option name="AUTOLINKS" value="true" />
<option name="DEFINITIONS" value="false" />
<option name="DEFINITION_BREAK_DOUBLE_BLANK_LINE" value="false" />
<option name="FENCED_CODE_BLOCKS" value="true" />
<option name="FOOTNOTES" value="false" />
<option name="HARDWRAPS" value="false" />
<option name="INSERTED" value="false" />
<option name="QUOTES" value="false" />
<option name="RELAXEDHRULES" value="true" />
<option name="SMARTS" value="false" />
<option name="STRIKETHROUGH" value="true" />
<option name="SUBSCRIPT" value="false" />
<option name="SUPERSCRIPT" value="false" />
<option name="SUPPRESS_HTML_BLOCKS" value="false" />
<option name="SUPPRESS_INLINE_HTML" value="false" />
<option name="TABLES" value="true" />
<option name="TASKLISTITEMS" value="true" />
<option name="TOC" value="false" />
<option name="WIKILINKS" value="true" />
</PegdownExtensions>
<ParserOptions>
<option name="COMMONMARK_LISTS" value="true" />
<option name="DUMMY" value="false" />
<option name="EMOJI_SHORTCUTS" value="true" />
<option name="FLEXMARK_FRONT_MATTER" value="false" />
<option name="GFM_LOOSE_BLANK_LINE_AFTER_ITEM_PARA" value="false" />
<option name="GFM_TABLE_RENDERING" value="true" />
<option name="GITBOOK_URL_ENCODING" value="false" />
<option name="GITHUB_EMOJI_URL" value="false" />
<option name="GITHUB_LISTS" value="false" />
<option name="GITHUB_WIKI_LINKS" value="true" />
<option name="JEKYLL_FRONT_MATTER" value="false" />
<option name="SIM_TOC_BLANK_LINE_SPACER" value="true" />
</ParserOptions>
</ParserSettings>
<HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true">
<GeneratorProvider>
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.generator" providerName="Default Swing HTML Generator" />
</GeneratorProvider>
<headerTop />
<headerBottom />
<bodyTop />
<bodyBottom />
</HtmlSettings>
<CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssTextEnabled="false" isDynamicPageWidth="true">
<StylesheetProvider>
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.css" providerName="Default Swing Stylesheet" />
</StylesheetProvider>
<ScriptProviders />
<cssText />
</CssSettings>
<HtmlExportSettings updateOnSave="false" parentDir="$ProjectFileDir$" targetDir="$ProjectFileDir$" cssDir="" scriptDir="" plainHtml="false" imageDir="" copyLinkedImages="false" imageUniquifyType="0" targetExt="" useTargetExt="false" noCssNoScripts="false" linkToExportedHtml="true" exportOnSettingsChange="true" regenerateOnProjectOpen="false" />
<LinkMapSettings>
<textMaps />
</LinkMapSettings>
</component>
</project>

View File

@@ -0,0 +1,3 @@
<component name="MarkdownNavigator.ProfileManager">
<settings default="" pdf-export="" />
</component>

2
demo/.idea/misc.xml → .idea/misc.xml generated Normal file → Executable file
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8.0_242" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

9
.idea/modules.xml generated Executable file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/BuildJAR_TerrarumSansBitmap.iml" filepath="$PROJECT_DIR$/BuildJAR_TerrarumSansBitmap.iml" />
<module fileurl="file://$PROJECT_DIR$/FontTestGDX/FontTestGDX.iml" filepath="$PROJECT_DIR$/FontTestGDX/FontTestGDX.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated Executable file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

210
.idea/workspace.xml generated Executable file
View File

@@ -0,0 +1,210 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ArtifactsWorkspaceSettings">
<artifacts-to-build>
<artifact name="TerrarumSansBitmap" />
</artifacts-to-build>
</component>
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="22c5bc80-996c-4846-b173-7dc8c2096fe3" name="Default" comment="">
<change afterPath="$PROJECT_DIR$/.idea/libraries/lib.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/badlogicgames_gdx.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/badlogicgames_gdx_backend_lwjgl3.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/runConfigurations.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/BuildJAR_TerrarumSansBitmap.iml" beforeDir="false" afterPath="$PROJECT_DIR$/BuildJAR_TerrarumSansBitmap.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FontTestGDX/FontTestGDX.iml" beforeDir="false" afterPath="$PROJECT_DIR$/FontTestGDX/FontTestGDX.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/ascii_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/ascii_variable.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/cyrilic_bulgarian_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/cyrilic_bulgarian_variable.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/cyrilic_serbian_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/cyrilic_serbian_variable.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/cyrilic_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/cyrilic_variable.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/greek_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/greek_variable.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/latinExtA_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/latinExtA_variable.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/latinExtB_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/latinExtB_variable.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/latinExtC_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/latinExtC_variable.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/latinExtD_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/latinExtD_variable.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/latinExt_additional_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/latinExt_additional_variable.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/demo.PNG" beforeDir="false" afterPath="$PROJECT_DIR$/demo.PNG" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/ascii_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/ascii_variable.psd" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/cyrilic_bulgarian_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/cyrilic_bulgarian_variable.psd" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/cyrilic_serbian_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/cyrilic_serbian_variable.psd" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/cyrilic_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/cyrilic_variable.psd" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/greek_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/greek_variable.psd" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/latinExtA_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/latinExtA_variable.psd" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/latinExtB_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/latinExtB_variable.psd" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/latinExtC_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/latinExtC_variable.psd" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/latinExtD_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/latinExtD_variable.psd" afterDir="false" />
<change beforePath="$PROJECT_DIR$/work_files/latinExt_additional_variable.psd" beforeDir="false" afterPath="$PROJECT_DIR$/work_files/latinExt_additional_variable.psd" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Kotlin Class" />
<option value="Interface" />
<option value="Class" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GitSEFilterConfiguration">
<file-type-list>
<filtered-out-file-type name="LOCAL_BRANCH" />
<filtered-out-file-type name="REMOTE_BRANCH" />
<filtered-out-file-type name="TAG" />
<filtered-out-file-type name="COMMIT_BY_MESSAGE" />
</file-type-list>
</component>
<component name="ProjectId" id="1aVE5t6KObkWt36lb07GBy1GY1S" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="Downloaded.Files.Path.Enabled" value="false" />
<property name="Repository.Attach.Annotations" value="false" />
<property name="Repository.Attach.JavaDocs" value="false" />
<property name="Repository.Attach.Sources" value="false" />
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="SearchEverywhereHistoryKey" value="HashMap&#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="Libraries" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.32068965" />
<property name="settings.editor.selected.configurable" value="preferences.keymap" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="C:\Users\minjaesong\Documents\Terrarum-sans-bitmap\" />
<recent name="C:\Users\minjaesong\Documents\Terrarum-sans-bitmap" />
<recent name="C:\Users\minjaesong\Documents\Terrarum-sans-bitmap\FontTestGDX\src" />
</key>
</component>
<component name="RunManager">
<configuration default="true" type="Applet">
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="executeSpecs" factoryName="Gauge Execution">
<setting name="environment" value="" />
<setting name="specsToExecute" value="" />
<setting name="tags" value="" />
<setting name="parallelNodes" value="" />
<setting name="execInParallel" value="false" />
<setting name="programParameters" value="" />
<setting name="workingDirectory" value="" />
<setting name="moduleName" value="" />
<envMap />
<setting name="rowsRange" value="" />
<method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<option name="TEST_OBJECT" value="class" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="FontTestGDXKt" type="JetRunConfigurationType" temporary="true">
<option name="MAIN_CLASS_NAME" value="FontTestGDXKt" />
<module name="FontTestGDX" />
<method v="2">
<option name="Make" enabled="true" />
<option name="BuildArtifacts" enabled="true">
<artifact name="TerrarumSansBitmap" />
</option>
</method>
</configuration>
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType">
<option name="filePath" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="TestNG">
<option name="TEST_OBJECT" value="CLASS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<properties />
<listeners />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<predefined_log_file enabled="true" id="idea.log" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="Kotlin.FontTestGDXKt" />
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="22c5bc80-996c-4846-b173-7dc8c2096fe3" name="Default" comment="" />
<created>1497950823354</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1497950823354</updated>
</task>
<servers />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="all">
<are-packages-shown value="true" />
<is-autoscroll-to-source value="true" />
</todo-panel>
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
<option name="oldMeFiltersMigrated" value="true" />
</component>
<component name="XSLT-Support.FileAssociations.UIState">
<expand />
<select />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
</component>
</project>

13
BuildJAR_TerrarumSansBitmap.iml Executable file
View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
<orderEntry type="library" name="lib" level="project" />
</component>
</module>

245
CONTRIBUTING.md Executable file
View File

@@ -0,0 +1,245 @@
#### Pixel Artists Wanted: for Arabic (all four forms) and other Indian scripts (all the ligatures). Must willing to follow the styles and have a knowledge in Unicode. Your name will be inscribed in the list of contributors.
You can contribute to the font by fixing wrong glyphs, suggesting better ones, extending character set (letters for other writing systems or filling in the blanks on the existing ones), or code for other game frameworks (not limited to Java). Please leave pull request for that.
Font Spritesheets are stored in ```assets/graphics/fonts``` directory. Image format must be TGA with Alpha — no PNG. If someone needs PNG, they can batch-convert the font using utils like ImageMagick.
#### Before getting started, you did read our design goals, right? Good. Now you may continue your awesome work.
## Ascenders, descenders, width informations (aka Glyph Tags)
![Alas, use more modern browser or get better internet connexion!](glyph_height_pos_annotation.png)
Above image is a reference you can use while you draw some letters. Capital B is drawn as a reference. Orange-tinted area is for lowercase, x-height must be the same as that of said tinted area (lowercase Alpha is also drawn for the reference). NOTE THAT x-height is taller than centre bar (capital A is an exception). Height of the ascender of the lowercase letters must be the same as height of capital letters.
Red-tinted area SHOULD NOT CONTAIN any dots, it's emptied for compatibility. (Slick2d—you can define size of "gaps" of the spritesheet, but you can't define horizontal and vertical gap separately)
Blue-tinted area cotains width of the glyph in binary, uppermost dot is the Least Significant Bit.
Green-tinted area contains extra informations, left blank for most cases. We'll call it Glyph Tags.
Tinted-in-magenta shows the height where diacritics should be placed, for both uppercase and lowercase.
Each cell is 16 px wide, and any glyph you draw **must be contained within leftside FIFTEEN pixels**.
## Font Metrics for variable-width font sheets
Although the font is basically a Spritesheet, some of the sheet expects variable widths to be supported. Any sheets with ```_variable``` means it expects variable widths. Anything else expects fixed width (regular Spritesheet behaviour). ```cjkpunct``` has width of 10, ```kana``` and ```hangul_johab``` has width of 12, ```wenquanyi``` has width of 16.
### Parsing Glyph Tags
![Sample of Font Spritesheet with annotation](width_bit_encoding_annotated.png)
Width is encoded in binary bits, on pixels. On the font spritesheet, every glyph has vertical dots on their top-right side (to be exact, every (16k - 1)th pixel on x axis). Above image is a sample of the font, with width information coloured in magenta. From top to bottom, each dot represents 1, 2, 4 and 8. For example, in the above image, ! (exclamation mark) has width of 5, " (double quote) has width of 6, # (octothorp) has width of 8, $ (dollar sign) has width of 9.
### Glyph Tags
Rightmost vertical column (should be 20 px tall) contains the tags. Tags are defined as following:
```
(LSB) W -,
W |
W |= Width of the character
W |
W -'
m --Is this character lowheight?
K -,
K |= Tags used by the "Keming Machine"
K -'
Q ---Compiler Directive (see below)
n --,
Y -, `-Nudging Bits (see below)
X |
Y |= Diacritics Anchor Points (see below)
X -'
A -,_ 0 Align 1 Align 0 Align 1 Align before
A -' 0 left 0 right 1 centre 1 the glyph
D --Diacritics Type Bit (see below; not all diacritics are marked as one 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)
```
#### 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 | | | | |
| ------------ | ------------ | ------------ | ------------ | ------------ |
| 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:
* 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.
*10000xxx: Replace a character with xxx subchars (yes, number 0 can be used).
Replacement characters are encoded vertically from X-zero, bit by bit
(colour of the pixel doesn't matter) with LSB sitting on Y-zero.
#### Stack Up/Down
When the tag is stack-up, it'll be drawn 4 px lower if the underlying
character is lowercase.
#### Align-To-This-X-Pos
Since this tag does not make sense for diacritics, they will use the value for compeletely different purpose:
0 : Nothing special
1 : Covers previous character; it's neither stack-up nor down.
Will be drawn 2 px lower if the underlying character is lowercase
2 : Joiner.
3..15: undefined
#### Diacritics That Comes Before and After
When this tag is set, the font compiler will replace this glyph with two extra code points given in the bitmap.
To implement those, this two extra code points are needed, which are provided in the Unicode's Reference Chart (www.unicode.org/charts/PDF/Uxxxx.pdf) The code points must be "drawn" in the bitmap, in the same manor as a tagging system. The zeroth column (x = 0) has the "before" character, the first column (x = 1) has the "after". All nineteen pixels (bits) are read by the font, which encompasses U+0000..U+EFFFF
For working examples, take a note at the bengali sprite sheet.
This tag can be used as a general "replace this with these" directive, as long as you're replacing it into two letters. This directive is exploited to construct dutch ligature "IJ" (U+0132 and U+0133), in the sheet LatinExtA.
Also note that the font compiler will not "stack" these diacritics.
#### NOTES
- If glyphs are right or centre aligned, they must be aligned in the same way inside of the bitmap; the font compiler assumes every variable-width glyphs to have a width of 15, regardless of the tagged width.
- If the diacritic is aligned before the glyph, the diacritic itself is always assumed as left-aligned, as the font compiler will exchange position of said diacritic and the glyph right before it.
![Visual representation of left/right/centre align](alignment_illustration.jpg)
(fun fact: it was drawn on Rhodia memopad with Lamy 2000, then photographed and edited on my iPhone. Letter used is a Cherokee WE Ꮺ)
## Technical Limitations
- Each spritesheet is 4096x4096 maximum, which is a size of 4K Texture. However it is recommended to be smaller or equal to 1024x1024.
- Glyphs exceeding 15px of width needs to be broken down with 2 or more characters. Wider sheets WILL NOT BE IMPLEMENTED, can't waste much pixels just for few superwide glyphs.
- Due to how the compiler is coded, actual glyph must have alpha value of 255, the tags must have alpha values LESS THAN 255 (and obviously greater than zero). RGB plane of the TGA image doesn't do anything, keep it as #FFFFFF white.
## Implementation of the Korean writing system
On this font, Hangul letters are printed by assemblying two or three letter pieces. There are 10 sets of Hangul letter pieces on the font. Top 6 are initials, middle 2 are medials, and bottom 2 are finals. On the rightmost side, there's eight assembled glyphs to help you with (assuming you have basic knowledge on the writing system). Top 6 tells you how to use 6 initials, and bottom 2 tells you how to use 2 finals.
This is a Kotlin-like pseudocode for assembling the glyph:
// NOTE: this code implements modern Hangul only, in the unicode range of 0xAC00..0xD7A3.
// the spritesheet is made to accomodate Johab encoding scheme, but can still be used with the following code.
// for the code for full Johab encoding (U+1100.. that includes Old Korean), please refer to the actual code in the repo.
function getHanChosung(hanIndex: Int) = hanIndex / (21 * 28)
function getHanJungseong(hanIndex: Int) = hanIndex / 28 % 21
function getHanJongseong(hanIndex: Int) = hanIndex % 28
jungseongWide = arrayOf(9,13,14,18,19)
jungseongComplex = arrayOf(10,11,12,15,16,17,20,23)
function getHanInitialRow(hanIndex: Int): Int {
val ret: Int
if (isJungseongWide(hanIndex))
ret = 2
else if (isJungseongComplex(hanIndex))
ret = 4
else
ret = 0
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
}
function isJungseongWide(hanIndex: Int) = jungseongWide.contains(getHanJungseong(hanIndex))
function isJungseongComplex(hanIndex: Int) = jungseongComplex.contains(getHanJungseong(hanIndex))
function getHanInitialRow(hanIndex: Int): Int {
val ret: Int
if (isJungseongWide(hanIndex))
ret = 2
else if (isJungseongComplex(hanIndex))
ret = 4
else
ret = 0
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
}
function getHanMedialRow(hanIndex: Int) = if (getHanJongseong(hanIndex) == 0) 6 else 7
function getHanFinalRow(hanIndex: Int): Int {
val jungseongIndex = getHanJungseong(hanIndex)
return if (jungseongWide.contains(jungseongIndex))
8
else
9
}
function isHangul(c: Char) = c.toInt() >= 0xAC00 && c.toInt() < 0xD7A4
...
for (each Char on the string) {
if (isHangul(Char)) {
val hIndex = Char.toInt() - 0xAC00
val indexCho = getHanChosung(hIndex)
val indexJung = getHanJungseong(hIndex)
val indexJong = getHanJongseong(hIndex)
val choRow = getHanInitialRow(hIndex)
val jungRow = getHanMedialRow(hIndex)
val jongRow = getHanFinalRow(hIndex)
// get sub image from sprite sheet
val choseongImage = hangulSheet.getSubImage(indexCho, choRow)
val jungseongImage = hangulSheet.getSubImage(indexJung, jungRow)
val jongseongImage = hangulSheet.getSubImage(indexJong, jongRow)
// actual drawing part
draw choseongImage to somewhere you want
draw jungseongImage on top of choseongImage
draw jongseongImage on top of choseongImage
}
...
}

9
CONTRIBUTORS.txt Executable file
View File

@@ -0,0 +1,9 @@
Project Maintainer and Programmer
- minjaesong (Torvald)
This font was not possible without following artists:
- minjaesong (Torvald)
<< Append your name here. If you're getting consistent merge conflicts, push without this and leave a Issue on the GitHub page >>

14
FontTestGDX/FontTestGDX.iml Executable file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="BuildJAR_TerrarumSansBitmap" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
<orderEntry type="library" name="lib" level="project" />
</component>
</module>

View File

@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: FontTestGDXKt

286
FontTestGDX/src/FontTestGDX.kt Executable file
View File

@@ -0,0 +1,286 @@
import com.badlogic.gdx.*
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration
import com.badlogic.gdx.files.FileHandle
import com.badlogic.gdx.graphics.*
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.glutils.FrameBuffer
import com.badlogic.gdx.utils.ScreenUtils
import com.badlogic.gdx.utils.StreamUtils
import net.torvald.terrarumsansbitmap.gdx.TerrarumSansBitmap
import java.io.File
import java.io.IOException
import java.io.OutputStream
/**
* Created by minjaesong on 2018-07-26.
*/
class FontTestGDX : Game() {
lateinit var font: TerrarumSansBitmap
lateinit var inputText: List<String>
lateinit var batch: SpriteBatch
lateinit var frameBuffer: FrameBuffer
lateinit var camera: OrthographicCamera
private val testing = false
private val demotextName = if (testing) "testtext.txt" else "demotext.txt"
private val outimageName = if (testing) "testing.PNG" else "demo.PNG"
private lateinit var faketex: Texture
override fun create() {
font = TerrarumSansBitmap("./assets", debug = true, flipY = false, errorOnUnknownChar = false, shadowAlpha = 0.796f) // must test for two flipY cases
val inTextFile = Gdx.files.internal("./$demotextName")
val reader = inTextFile.reader("UTF-8")
inputText = reader.readLines()
reader.close()
batch = SpriteBatch()
// create faketex
val fakepix = Pixmap(1,1,Pixmap.Format.RGBA8888)
fakepix.drawPixel(0,0,-1)
faketex = Texture(fakepix)
fakepix.dispose()
frameBuffer = FrameBuffer(Pixmap.Format.RGBA8888, TEXW, TEXH, true)
camera = OrthographicCamera(TEXW.toFloat(), TEXH.toFloat())
camera.translate(TEXW.div(2f), 0f)
camera.setToOrtho(true, TEXW.toFloat(), TEXH.toFloat())
camera.update()
Gdx.input.inputProcessor = Navigator(this)
}
override fun getScreen(): Screen? {
return null
}
var scrollOffsetY = 0f
override fun setScreen(screen: Screen?) {
}
var tex: Texture? = null
var screenshotExported = false
private val backcol = Color(.141f, .141f, .141f, 1f)
override fun render() {
if (tex == null) {
frameBuffer.begin()
Gdx.gl.glClearColor(0f,0f,0f,0f)
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)
// Gdx.gl.glBlendFuncSeparate(GL20.GL_SRC_COLOR, GL20.GL_ONE_MINUS_SRC_ALPHA, GL20.GL_SRC_ALPHA, GL20.GL_ONE)
// Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA)
batch.projectionMatrix = camera.combined
batch.begin()
batch.color = backcol
batch.draw(faketex, 0f, 0f, TEXW.toFloat(), TEXH.toFloat())
batch.color = Color.WHITE
inputText.forEachIndexed { index, s ->
font.draw(batch, s, 10f, TEXH - 30f - index * font.lineHeight)
}
batch.end()
// dump to file
if (!screenshotExported) {
val pixmap = ScreenUtils.getFrameBufferPixmap(0, 0, frameBuffer.width, frameBuffer.height)
PixmapIO.writePNG(Gdx.files.local(outimageName), pixmap)
// writeTGA(Gdx.files.local(outimageName), pixmap, false)
pixmap.dispose()
screenshotExported = true
}
frameBuffer.end()
///////////////
tex = frameBuffer.colorBufferTexture
}
Gdx.gl.glClearColor(.141f, .141f, .141f, 1f)
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
Gdx.gl.glEnable(GL20.GL_TEXTURE_2D)
Gdx.gl.glEnable(GL20.GL_BLEND)
Gdx.gl.glBlendFuncSeparate(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA, GL20.GL_ONE, GL20.GL_ONE)
batch.begin()
batch.color = Color.WHITE
batch.draw(tex, 0f, (TEXH.toFloat()/HEIGHT)*TEXH - scrollOffsetY, TEXW.toFloat(), -(TEXH.toFloat() / HEIGHT) * TEXH.toFloat())
batch.end()
}
override fun pause() {
}
override fun resume() {
}
override fun resize(width: Int, height: Int) {
}
override fun dispose() {
font.dispose()
faketex.dispose()
File("./tmp_wenquanyi.tga").delete()
}
fun scrollAdd(x: Int = 1) {
scrollOffsetY -= (TEXH.toFloat() / HEIGHT) * 20f * x
}
fun scrollSub(x: Int = 1) {
scrollOffsetY += (TEXH.toFloat() / HEIGHT) * 20f * x
}
class Navigator(val main: FontTestGDX) : InputAdapter() {
override fun scrolled(amountX: Float, amountY: Float): Boolean {
if (amountY >= 0)
main.scrollSub(amountY.toInt())
else
main.scrollAdd(-amountY.toInt())
return true
}
override fun keyDown(keycode: Int): Boolean {
if (keycode == Input.Keys.UP)
main.scrollAdd()
else if (keycode == Input.Keys.DOWN)
main.scrollSub()
return true
}
}
@Throws(IOException::class)
private fun writeTGA(file: FileHandle, pixmap: Pixmap, flipY: Boolean) {
val output = file.write(false)
try {
_writeTGA(output, pixmap, true, flipY)
} finally {
StreamUtils.closeQuietly(output)
}
}
@Throws(IOException::class)
private fun _writeTGA(out: OutputStream, pixmap: Pixmap, verbatim: Boolean, flipY: Boolean) {
val width: ByteArray = toShortLittle(pixmap.width)
val height: ByteArray = toShortLittle(pixmap.height)
val zero: ByteArray = toShortLittle(0)
out.write(0) // ID field: empty
out.write(0) // no colour map, but should be ignored anyway as it being unmapped RGB
out.write(2) // 2 means unmapped RGB
out.write(byteArrayOf(0, 0, 0, 0, 0)) // color map spec: empty
out.write(zero) // x origin: 0
out.write(zero) // y origin: 0
out.write(width) // width
out.write(height) // height
out.write(32) // image pixel size: we're writing 32-bit image (8bpp BGRA)
out.write(8) // image descriptor: dunno, Photoshop writes 8 in there
// write actual image data
// since we're following Photoshop's conventional header, we also follows Photoshop's
// TGA saving scheme, that is:
// 1. BGRA order
// 2. Y-Flipped but not X-Flipped
if (!flipY) {
for (y in pixmap.height - 1 downTo 0) {
for (x in 0 until pixmap.width) {
writeTga(x, y, verbatim, pixmap, out)
}
}
} else {
for (y in 0 until pixmap.height) {
for (x in 0 until pixmap.width) {
writeTga(x, y, verbatim, pixmap, out)
}
}
}
// write footer
// 00 00 00 00 00 00 00 00 TRUEVISION-XFILE 2E 00
out.write(byteArrayOf(0, 0, 0, 0, 0, 0, 0, 0))
if (verbatim) out.write("TRUEVISION-XFILE".toByteArray()) else out.write("TerrarumHappyTGA".toByteArray())
out.write(byteArrayOf(0x2E, 0))
out.flush()
out.close()
}
private val zeroalpha = byteArrayOf(0, 0, 0, 0)
@Throws(IOException::class)
private fun writeTga(x: Int, y: Int, verbatim: Boolean, pixmap: Pixmap, out: OutputStream) {
val color = pixmap.getPixel(x, y)
// if alpha == 0, write special value instead
if (verbatim && color and 0xFF == 0) {
out.write(zeroalpha)
} else {
out.write(RGBAtoBGRA(color))
}
}
private fun toShortLittle(i: Int): ByteArray {
return byteArrayOf(
(i and 0xFF).toByte(),
(i ushr 8 and 0xFF).toByte()
)
}
private fun RGBAtoBGRA(rgba: Int): ByteArray {
return byteArrayOf(
(rgba ushr 8 and 0xFF).toByte(),
(rgba ushr 16 and 0xFF).toByte(),
(rgba ushr 24 and 0xFF).toByte(),
(rgba and 0xFF).toByte()
)
}
}
lateinit var appConfig: Lwjgl3ApplicationConfiguration
const val TEXW = 874
const val TEXH = 128 * 20
const val WIDTH = TEXW
const val HEIGHT = 768
fun main(args: Array<String>) {
appConfig = Lwjgl3ApplicationConfiguration()
appConfig.useVsync(false)
appConfig.setResizable(false)
appConfig.setWindowedMode(WIDTH, HEIGHT)
appConfig.setTitle("Terrarum Sans Bitmap Test")
Lwjgl3Application(FontTestGDX(), appConfig)
}

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) : 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 = 0xF9000
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, 40f, 40f + 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(600, 800)
appConfig.setTitle("Terrarum Typewriter Bitmap Test")
Lwjgl3Application(TypewriterGDX(600, 800, 64), 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
)

4
LICENSE.md Normal file → Executable file
View File

@@ -1,6 +1,4 @@
Terrarum Sans Bitmap
Copyright (c) 2017 Minjae Song (Torvald) and the contributors
Copyright (c) 2017-2022 see CONTRIBUTORS.txt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

2
META-INF/MANIFEST.MF Executable file
View File

@@ -0,0 +1,2 @@
Manifest-Version: 1.0

BIN
PUA_allocation_chart.xlsx Executable file

Binary file not shown.

174
README.md Normal file → Executable file
View File

@@ -1,28 +1,78 @@
# Terrarum Sans Bitmap
![Font sample](https://github.com/minjaesong/Terrarum-sans-bitmap/blob/master/font_test_3.PNG)
![Font sample — necessary information in this image is also provided below.](demo.PNG)
![Cyrillic sample Russian, Bulgarian, Serbian](https://github.com/minjaesong/Terrarum-sans-bitmap/blob/master/terrarum_sans_cyrillic_2.png)
This font is a bitmap font used in [my game project called Terrarum](https://github.com/minjaesong/Terrarum) (hence the name). The font supports more than 90 % of european languages, as well as Chinese, Japanese and Korean. More technical side, it supports Latin-1 Supplement, Latin Ext-A/B/C, IPA Extension, Greek, Cyrillic (+ Bulgarian, Serbian variants) and the supplement, Armenian, Devanagari, Bengali, Thai, Georgian (Mkhedruli and Mtavruli), General Punctuations, Super/Subscrips, CJK Punctuations, All of the Kana (minus the Hentaigana), Chinese (limited to Unihan and Ext-A), Hangul (every possible syllables) and Fullwidth forms.
(note—you can't display Bulgarian and Russian glyphs at the same time, you must ```reload()``` them upon the change of locale of your game)
**Font demo** — head to the **[Release](https://github.com/minjaesong/Terrarum-sans-bitmap/releases)** tab
This font is a bitmap font used in [my game project called Terrarum](https://gitlab.com/minjaesong/terrarum) (hence the name). The font supports more than 90 % of european languages, as well as Chinese, Japanese and Korean. More technical side, it supports Latin-1 Supplement, Latin Ext-A, Latin Ext-B, Cyrillic (Russian, Bulgarian, Serbian), Greek, Chinese (limited to Unicode BMP), Japanese, Korean (all 11 172 possible syllables).
The code for the fonts are meant to be used with Slick2d (extends ```Font``` class). If you are not using the framework, please refer to the __Font metrics__ section to implement the font metrics correctly on your system.
The JAR package is meant to be used with LibGDX (extends ```BitmapFont``` class). If you are not using the framework, please refer to the __Font metrics__ section to implement the font metrics correctly on your system.
The issue page is open. If you have some issues to submit, or have a question, please leave it on the page.
#### Little notes
- To display Bulgarian/Serbian variants, you need special Control Characters. (GameFontBase.charsetOverrideBulgarian -- U+FFFC1; GameFontBase.charsetOverrideSerbian -- U+FFFC2)
- All Han characters are in Chinese variant, no other variants are to be supported as most Chinese, Japanese and Korean people can understand other's variant and as long as I can, we don't bother anyway.
- Indian script in general is not perfect: right now this font will never do the proper ligatures (I can't draw all the 1 224 possible combinations). Hopefully it's still be able to understand without them.
- Slick2d versions are now unsupported. I couldn't extend myself to work on both versions, but I'm still welcome to merge your pull requests.
## Contribution guidelines
### Design Goals
You can contribute to the font by fixing wrong glyphs, suggesting better ones, extending character set (like Georgian and Thai), or code for other game frameworks such as LibGDX. Please leave pull request for that.
- Sans-serif
- Realise (some of) handwritten forms
- Combininig with the sans-serif, this stands for **no over-simplification**
- Condensed capitals for efficient space usage
Font Spritesheets are stored in ```assets/graphics/fonts``` directory. Image format must be TGA with Alpha — no PNG. If someone needs PNG, they can batch-convert the font using utils like ImageMagick.
## Download
- Go ahead to the [release tab](https://github.com/minjaesong/Terrarum-sans-bitmap/releases), and download the most recent version. It is **not** advised to use the .jar found within the repository, they're experimental builds I use during the development, and may contain bugs like leaking memory.
## Using on your game
- Firstly, place the .jar to your library path and assets folder to the main directory of the app, then:
### Using on LibGDX
On your code (Kotlin):
class YourGame : Game() {
lateinit var fontGame: Font
override fun create() {
fontGame = GameFontBase(path_to_assets)
...
}
override fun render() {
batch.begin()
...
fontGame.draw(batch, text, ...)
...
batch.end()
}
}
On your code (Java):
class YourGame extends BasicGame {
Font fontGame;
@Override void create() {
fontGame = new GameFontBase(path_to_assets);
...
}
@Override void render() {
batch.begin();
...
fontGame.draw(batch, text, ...);
...
batch.end();
}
}
## Using on Slick2d
### Using on Slick2d (legacy version only)
On your code (Kotlin):
@@ -31,7 +81,7 @@ On your code (Kotlin):
lateinit var fontGame: Font
override fun init(gc: GameContainer) {
fontGame = GameFontImpl()
fontGame = GameFontBase(path_to_assets)
...
}
@@ -48,7 +98,7 @@ On your code (Java):
Font fontGame;
@Override void init(GameContainer gc) {
fontGame = new GameFontImpl();
fontGame = new GameFontBase(path_to_assets);
...
}
@@ -58,98 +108,26 @@ On your code (Java):
}
}
## Font metrics
### How to Use Color Code
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``` has width of 12, ```hangul_johab``` has width of 11, ```wenquanyi``` has width of 16.
Color codes are individual unicode characters. While you can somehow make a raw character and paste in on your code, it's certainly not desirable. Fortunately, we're also providing utility functions for the color codes.
### Parsing glyph widths for variable font sheets
GameFontBase.toColorCode(argb4444: Int) -- returns String
GameFontBase.toColorCode(r: Int, g: Int, b: Int) -- returns String
GameFontBase.toColorCode(r: Int, g: Int, b: Int, a: Int) -- returns String
Width is encoded in binary number, on pixels. On the font spritesheet, every glyph has vertical dots on their right side (to be exact, every (16k - 1)th pixel on x axis). From top to bottom, each dot represents 1, 2, 4 and 8. For example, ASCII glyph 'C' has width of 9, 'W' has width of 11, " (double quote) has width of 6.
```argb4444``` takes whole ARGB (in that order) as input, that is, from 0x0000 to 0xFFFF.
```r, g, b(, a)``` takes RGB and A separately, in the range of 0x0..0xF. Any value exceeding the range **are unchecked and may wreak havoc**, so be careful.
### Implementing the Korean writing system
U+100000 is used to disable previously-applied color codes (going back to original colour), even if it looks like ARGB of all zero.
On this font, Hangul letters are printed by assemblying two or three letter pieces. There are 10 sets of Hangul letter pieces on the font. Top 6 are initials, middle 2 are medials, and bottom 2 are finals. On the rightmost side, there's eight assembled glyphs to help you with (assuming you have basic knowledge on the writing system). Top 6 tells you how to use 6 initials, and bottom 2 tells you how to use 2 finals.
This is a Kotlin-like pseudocode for assembling the glyph:
## Contribution guidelines
function getHanChosung(hanIndex: Int) = hanIndex / (21 * 28)
function getHanJungseong(hanIndex: Int) = hanIndex / 28 % 21
function getHanJongseong(hanIndex: Int) = hanIndex % 28
jungseongWide = arrayOf(8, 12, 13, 17, 18, 21)
jungseongComplex = arrayOf(9, 10, 11, 14, 15, 16, 22)
function getHanInitialRow(hanIndex: Int): Int {
val ret: Int
if (isJungseongWide(hanIndex))
ret = 2
else if (isJungseongComplex(hanIndex))
ret = 4
else
ret = 0
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
}
function isJungseongWide(hanIndex: Int) = jungseongWide.contains(getHanJungseong(hanIndex))
function isJungseongComplex(hanIndex: Int) = jungseongComplex.contains(getHanJungseong(hanIndex))
function getHanInitialRow(hanIndex: Int): Int {
val ret: Int
if (isJungseongWide(hanIndex))
ret = 2
else if (isJungseongComplex(hanIndex))
ret = 4
else
ret = 0
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
}
function getHanMedialRow(hanIndex: Int) = if (getHanJongseong(hanIndex) == 0) 6 else 7
function getHanFinalRow(hanIndex: Int): Int {
val jungseongIndex = getHanJungseong(hanIndex)
return if (jungseongWide.contains(jungseongIndex))
8
else
9
}
function isHangul(c: Char) = c.toInt() >= 0xAC00 && c.toInt() < 0xD7A4
...
for (each Char on the string) {
if (isHangul(Char)) {
val hIndex = Char.toInt() - 0xAC00
val indexCho = getHanChosung(hIndex)
val indexJung = getHanJungseong(hIndex)
val indexJong = getHanJongseong(hIndex)
val choRow = getHanInitialRow(hIndex)
val jungRow = getHanMedialRow(hIndex)
val jongRow = getHanFinalRow(hIndex)
// get sub image from sprite sheet
val choseongImage = hangulSheet.getSubImage(indexCho, choRow)
val jungseongImage = hangulSheet.getSubImage(indexJung, jungRow)
val jongseongImage = hangulSheet.getSubImage(indexJong, jongRow)
// actual drawing part
draw choseongImage to somewhere you want
draw jungseongImage on top of choseongImage
draw jongseongImage on top of choseongImage
}
...
}
Please refer to [CONTRIBUTING.md](https://github.com/minjaesong/Terrarum-sans-bitmap/blob/master/CONTRIBUTING.md)
## Acknowledgement
Thanks to kind people of [/r/Typography](https://www.reddit.com/r/typography/) for amazing feedbacks.
CJK Ideographs are powered by [WenQuanYi Font](http://wenq.org/wqy2/index.cgi?BitmapSong). The font is distributed under the GNU GPL version 2. Although the glyphs themselves are not copyrightable (the program codes—e.g. TTF—do), we would like to give a credit for the font and the people behind it.
CJK Ideographs are powered by [WenQuanYi Font](http://wenq.org/wqy2/index.cgi?BitmapSong). The font is distributed under the GNU GPL version 2. Although the shapes of typefaces are not copyrightable (the program codes—e.g. TTF—do), we would like to give a credit for the font and the people behind it.

View File

@@ -1,558 +0,0 @@
package net.torvald.imagefont
import org.lwjgl.opengl.GL11
import org.newdawn.slick.*
import org.newdawn.slick.opengl.Texture
import java.nio.ByteOrder
import java.util.*
/**
* Created by minjaesong on 16-01-27.
*/
open class GameFontBase : Font {
private fun getHan(hanIndex: Int): IntArray {
val han_x = hanIndex % JONG_COUNT
val han_y = hanIndex / JONG_COUNT
val ret = intArrayOf(han_x, han_y)
return ret
}
private fun getHanChosung(hanIndex: Int) = hanIndex / (JUNG_COUNT * JONG_COUNT)
private fun getHanJungseong(hanIndex: Int) = hanIndex / JONG_COUNT % JUNG_COUNT
private fun getHanJongseong(hanIndex: Int) = hanIndex % JONG_COUNT
private val jungseongWide = arrayOf(8, 12, 13, 17, 18, 21)
private val jungseongComplex = arrayOf(9, 10, 11, 14, 15, 16, 22)
private fun isJungseongWide(hanIndex: Int) = jungseongWide.contains(getHanJungseong(hanIndex))
private fun isJungseongComplex(hanIndex: Int) = jungseongComplex.contains(getHanJungseong(hanIndex))
private fun getHanInitialRow(hanIndex: Int): Int {
val ret: Int
if (isJungseongWide(hanIndex))
ret = 2
else if (isJungseongComplex(hanIndex))
ret = 4
else
ret = 0
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
}
private fun getHanMedialRow(hanIndex: Int) = if (getHanJongseong(hanIndex) == 0) 6 else 7
private fun getHanFinalRow(hanIndex: Int): Int {
val jungseongIndex = getHanJungseong(hanIndex)
return if (jungseongWide.contains(jungseongIndex))
8
else
9
}
private fun isHangul(c: Char) = c.toInt() in 0xAC00..0xD7A3
private fun isAscii(c: Char) = c.toInt() in 0x20..0xFF
private fun isRunic(c: Char) = runicList.contains(c)
private fun isExtA(c: Char) = c.toInt() in 0x100..0x17F
private fun isExtB(c: Char) = c.toInt() in 0x180..0x24F
private fun isKana(c: Char) = c.toInt() in 0x3040..0x30FF
private fun isCJKPunct(c: Char) = c.toInt() in 0x3000..0x303F
private fun isUniHan(c: Char) = c.toInt() in 0x3400..0x9FFF
private fun isCyrilic(c: Char) = c.toInt() in 0x400..0x45F
private fun isFullwidthUni(c: Char) = c.toInt() in 0xFF00..0xFF1F
private fun isUniPunct(c: Char) = c.toInt() in 0x2000..0x206F
private fun isGreek(c: Char) = c.toInt() in 0x370..0x3CE
private fun extAindexX(c: Char) = (c.toInt() - 0x100) % 16
private fun extAindexY(c: Char) = (c.toInt() - 0x100) / 16
private fun extBindexX(c: Char) = (c.toInt() - 0x180) % 16
private fun extBindexY(c: Char) = (c.toInt() - 0x180) / 16
private fun runicIndexX(c: Char) = runicList.indexOf(c) % 16
private fun runicIndexY(c: Char) = runicList.indexOf(c) / 16
private fun kanaIndexX(c: Char) = (c.toInt() - 0x3040) % 16
private fun kanaIndexY(c: Char) = (c.toInt() - 0x3040) / 16
private fun cjkPunctIndexX(c: Char) = (c.toInt() - 0x3000) % 16
private fun cjkPunctIndexY(c: Char) = (c.toInt() - 0x3000) / 16
private fun unihanIndexX(c: Char) = (c.toInt() - 0x3400) % 256
private fun unihanIndexY(c: Char) = (c.toInt() - 0x3400) / 256
private fun cyrilicIndexX(c: Char) = (c.toInt() - 0x400) % 16
private fun cyrilicIndexY(c: Char) = (c.toInt() - 0x400) / 16
private fun fullwidthUniIndexX(c: Char) = (c.toInt() - 0xFF00) % 16
private fun fullwidthUniIndexY(c: Char) = (c.toInt() - 0xFF00) / 16
private fun uniPunctIndexX(c: Char) = (c.toInt() - 0x2000) % 16
private fun uniPunctIndexY(c: Char) = (c.toInt() - 0x2000) / 16
private fun greekIndexX(c: Char) = (c.toInt() - 0x370) % 16
private fun greekIndexY(c: Char) = (c.toInt() - 0x370) / 16
private val unihanWidthSheets = arrayOf(
SHEET_UNIHAN,
SHEET_FW_UNI,
SHEET_UNIHAN
)
private val zeroWidthSheets = arrayOf(
SHEET_COLOURCODE
)
private val variableWidthSheets = arrayOf(
SHEET_ASCII_VARW,
SHEET_CYRILIC_VARW,
SHEET_EXTA_VARW,
SHEET_GREEK_VARW,
SHEET_EXTB_VARW
)
override fun getWidth(s: String) = getWidthSubstr(s, s.length)
private fun getWidthSubstr(s: String, endIndex: Int): Int {
var len = 0
for (i in 0..endIndex - 1) {
val chr = s[i]
val ctype = getSheetType(s[i])
if (variableWidthSheets.contains(ctype)) {
len += try {
asciiWidths[chr.toInt()]!!
}
catch (e: kotlin.KotlinNullPointerException) {
println("KotlinNullPointerException on glyph number ${Integer.toHexString(chr.toInt()).toUpperCase()}")
//System.exit(1)
W_LATIN_WIDE // failsafe
}
}
else if (zeroWidthSheets.contains(ctype))
len += 0
else if (ctype == SHEET_CJK_PUNCT)
len += W_ASIAN_PUNCT
else if (ctype == SHEET_HANGUL)
len += W_HANGUL
else if (ctype == SHEET_KANA)
len += W_KANA
else if (unihanWidthSheets.contains(ctype))
len += W_UNIHAN
else
len += W_LATIN_WIDE
if (i < endIndex - 1) len += interchar
}
return len * scale
}
override fun getHeight(s: String) = H * scale
override fun getLineHeight() = H * scale
override fun drawString(x: Float, y: Float, s: String) = drawString(x, y, s, Color.white)
override fun drawString(x: Float, y: Float, s: String, color: Color) {
GL11.glEnable(GL11.GL_BLEND)
GL11.glColorMask(true, true, true, true)
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA)
var thisCol = color
// hangul fonts first
//hangulSheet.startUse() // disabling texture binding to make the font coloured
// JOHAB
for (i in 0..s.length - 1) {
val ch = s[i]
if (ch.isColourCode()) {
thisCol = colourKey[ch]!!
continue
}
if (isHangul(ch)) {
val hIndex = ch.toInt() - 0xAC00
val indexCho = getHanChosung(hIndex)
val indexJung = getHanJungseong(hIndex)
val indexJong = getHanJongseong(hIndex)
val choRow = getHanInitialRow(hIndex)
val jungRow = getHanMedialRow(hIndex)
val jongRow = getHanFinalRow(hIndex)
val glyphW = getWidth(ch.toString())
hangulSheet.getSubImage(indexCho, choRow).drawWithShadow(
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
Math.round(y).toFloat(),
scale.toFloat(), thisCol
)
hangulSheet.getSubImage(indexJung, jungRow).drawWithShadow(
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
Math.round(y).toFloat(),
scale.toFloat(), thisCol
)
hangulSheet.getSubImage(indexJong, jongRow).drawWithShadow(
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
Math.round(y).toFloat(),
scale.toFloat(), thisCol
)
}
}
//hangulSheet.endUse()
// WenQuanYi
//uniHan.startUse()
for (i in 0..s.length - 1) {
val ch = s[i]
if (ch.isColourCode()) {
thisCol = colourKey[ch]!!
continue
}
if (isUniHan(ch)) {
val glyphW = getWidth("" + ch)
uniHan.getSubImage(unihanIndexX(ch), unihanIndexY(ch)).drawWithShadow(
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
Math.round((H - H_UNIHAN) / 2 + y).toFloat(),
scale.toFloat(), thisCol
)
}
}
//uniHan.endUse()
// regular fonts
var prevInstance = -1
for (i in 0..s.length - 1) {
val ch = s[i]
if (ch.isColourCode()) {
thisCol = colourKey[ch]!!
continue
}
if (!isHangul(ch) && !isUniHan(ch)) {
// if not init, endUse first
if (prevInstance != -1) {
//sheetKey[prevInstance].endUse()
}
//sheetKey[getSheetType(ch)].startUse()
prevInstance = getSheetType(ch)
val sheetX: Int
val sheetY: Int
when (prevInstance) {
SHEET_EXTA_VARW -> {
sheetX = extAindexX(ch)
sheetY = extAindexY(ch)
}
SHEET_EXTB_VARW -> {
sheetX = extBindexX(ch)
sheetY = extBindexY(ch)
}
SHEET_KANA -> {
sheetX = kanaIndexX(ch)
sheetY = kanaIndexY(ch)
}
SHEET_CJK_PUNCT -> {
sheetX = cjkPunctIndexX(ch)
sheetY = cjkPunctIndexY(ch)
}
SHEET_CYRILIC_VARW -> {
sheetX = cyrilicIndexX(ch)
sheetY = cyrilicIndexY(ch)
}
SHEET_FW_UNI -> {
sheetX = fullwidthUniIndexX(ch)
sheetY = fullwidthUniIndexY(ch)
}
SHEET_UNI_PUNCT -> {
sheetX = uniPunctIndexX(ch)
sheetY = uniPunctIndexY(ch)
}
SHEET_GREEK_VARW -> {
sheetX = greekIndexX(ch)
sheetY = greekIndexY(ch)
}
else -> {
sheetX = ch.toInt() % 16
sheetY = ch.toInt() / 16
}
}
val glyphW = getWidth("" + ch)
try {
sheetKey[prevInstance]!!.getSubImage(sheetX, sheetY).drawWithShadow(
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
Math.round(y).toFloat(),
scale.toFloat(), thisCol
)
}
catch (e: ArrayIndexOutOfBoundsException) {
// character that does not exist in the sheet. No render, pass.
}
catch (e1: RuntimeException) {
// System.err.println("[GameFontBase] RuntimeException raised while processing character '$ch' (U+${Integer.toHexString(ch.toInt()).toUpperCase()})")
// e1.printStackTrack()
}
}
}
if (prevInstance != -1) {
//sheetKey[prevInstance].endUse()
}
GL11.glEnd()
}
private fun getSheetType(c: Char): Int {
if (isHangul(c))
return SHEET_HANGUL
else if (isKana(c))
return SHEET_KANA
else if (isUniHan(c))
return SHEET_UNIHAN
else if (isAscii(c))
return SHEET_ASCII_VARW
else if (isExtA(c))
return SHEET_EXTA_VARW
else if (isExtB(c))
return SHEET_EXTB_VARW
else if (isCyrilic(c))
return SHEET_CYRILIC_VARW
else if (isUniPunct(c))
return SHEET_UNI_PUNCT
else if (isCJKPunct(c))
return SHEET_CJK_PUNCT
else if (isFullwidthUni(c))
return SHEET_FW_UNI
else if (isGreek(c))
return SHEET_GREEK_VARW
else if (c.isColourCode())
return SHEET_COLOURCODE
else
return SHEET_UNKNOWN// fixed width punctuations
// fixed width
// fallback
}
/**
* Draw part of a string to the screen. Note that this will still position the text as though
* it's part of the bigger string.
* @param x
* *
* @param y
* *
* @param s
* *
* @param color
* *
* @param startIndex
* *
* @param endIndex
*/
override fun drawString(x: Float, y: Float, s: String, color: Color, startIndex: Int, endIndex: Int) {
val unprintedHead = s.substring(0, startIndex)
val printedBody = s.substring(startIndex, endIndex)
val xoff = getWidth(unprintedHead)
drawString(x + xoff, y, printedBody, color)
}
fun Char.isColourCode() = colourKey.containsKey(this)
fun buildWidthTable(sheet: SpriteSheet, codeOffset: Int, codeRange: IntRange, rows: Int = 16) {
fun Byte.toUint() = java.lang.Byte.toUnsignedInt(this)
/** @return Intarray(R, G, B, A) */
fun Texture.getPixel(x: Int, y: Int): IntArray {
val textureWidth = this.textureWidth
val hasAlpha = this.hasAlpha()
val offset = (if (hasAlpha) 4 else 3) * (textureWidth * y + x) // 4: # of channels (RGBA)
if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) {
return intArrayOf(
this.textureData[offset].toUint(),
this.textureData[offset + 1].toUint(),
this.textureData[offset + 2].toUint(),
if (hasAlpha)
this.textureData[offset + 3].toUint()
else 255
)
}
else {
return intArrayOf(
this.textureData[offset + 2].toUint(),
this.textureData[offset + 1].toUint(),
this.textureData[offset].toUint(),
if (hasAlpha)
this.textureData[offset + 3].toUint()
else 255
)
}
}
val binaryCodeOffset = 15
val cellW = sheet.getSubImage(0, 0).width + 1 // should be 16
val cellH = sheet.getSubImage(0, 0).height + 1 // should be 20
// control chars
for (ccode in codeRange) {
val glyphX = ccode % rows
val glyphY = ccode / rows
val codeStartX = (glyphX * cellW) + binaryCodeOffset
val codeStartY = (glyphY * cellH)
var glyphWidth = 0
for (downCtr in 0..3) {
// if alpha is not zero, assume it's 1
if (sheet.texture.getPixel(codeStartX, codeStartY + downCtr)[3] == 255) {
glyphWidth = glyphWidth or (1 shl downCtr)
}
}
asciiWidths[codeOffset + ccode] = glyphWidth
}
}
companion object {
lateinit internal var hangulSheet: SpriteSheet
lateinit internal var asciiSheet: SpriteSheet
internal val asciiWidths: HashMap<Int, Int> = HashMap()
lateinit internal var extASheet: SpriteSheet
lateinit internal var extBSheet: SpriteSheet
lateinit internal var kanaSheet: SpriteSheet
lateinit internal var cjkPunct: SpriteSheet
lateinit internal var uniHan: SpriteSheet
lateinit internal var cyrilic: SpriteSheet
lateinit internal var fullwidthForms: SpriteSheet
lateinit internal var uniPunct: SpriteSheet
lateinit internal var greekSheet: SpriteSheet
internal val JUNG_COUNT = 21
internal val JONG_COUNT = 28
internal val W_ASIAN_PUNCT = 10
internal val W_HANGUL = 11
internal val W_KANA = 12
internal val W_UNIHAN = 16
internal val W_LATIN_WIDE = 9 // width of regular letters
internal val H = 20
internal val H_UNIHAN = 16
internal val SHEET_ASCII_VARW = 0
internal val SHEET_HANGUL = 1
internal val SHEET_EXTA_VARW = 3
internal val SHEET_EXTB_VARW = 4
internal val SHEET_KANA = 5
internal val SHEET_CJK_PUNCT = 6
internal val SHEET_UNIHAN = 7
internal val SHEET_CYRILIC_VARW = 8
internal val SHEET_FW_UNI = 9
internal val SHEET_UNI_PUNCT = 10
internal val SHEET_GREEK_VARW = 11
internal val SHEET_UNKNOWN = 254
internal val SHEET_COLOURCODE = 255
lateinit internal var sheetKey: Array<SpriteSheet?>
/**
* Runic letters list used for game. The set is
* Younger Futhark + Medieval rune 'e' + Punct + Runic Almanac
* BEWARE OF SIMILAR-LOOKING RUNES, especially:
* * Algiz ᛉ instead of Maðr ᛘ
* * Short-Twig Hagall ᚽ instead of Runic Letter E ᛂ
* * Runic Letter OE ᚯ instead of Óss ᚬ
* Examples:
* ᛭ᛋᛁᚴᚱᛁᚦᛦ᛭
* ᛭ᛂᛚᛋᛅ᛭ᛏᚱᚢᛏᚾᛁᚾᚴᚢᚾᛅ᛬ᛅᚱᚾᛅᛏᛅᛚᛋ
*/
internal val runicList = arrayOf('ᚠ', 'ᚢ', 'ᚦ', 'ᚬ', 'ᚱ', 'ᚴ', 'ᚼ', 'ᚾ', '', 'ᛅ', 'ᛋ', 'ᛏ', 'ᛒ', 'ᛘ', 'ᛚ', 'ᛦ', 'ᛂ', '', '᛫', '', 'ᛮ', 'ᛯ', 'ᛰ')
internal var interchar = 0
internal var scale = 1
set(value) {
if (value > 0) field = value
else throw IllegalArgumentException("Font scale cannot be zero or negative (input: $value)")
}
val colourKey = hashMapOf(
Pair(0x10.toChar(), Color(0xFFFFFF)), //*w hite
Pair(0x11.toChar(), Color(0xFFE080)), //*y ellow
Pair(0x12.toChar(), Color(0xFFB020)), //o range
Pair(0x13.toChar(), Color(0xFF8080)), //*r ed
Pair(0x14.toChar(), Color(0xFFA0E0)), //f uchsia
Pair(0x15.toChar(), Color(0xE0A0FF)), //*m agenta (purple)
Pair(0x16.toChar(), Color(0x8080FF)), //*b lue
Pair(0x17.toChar(), Color(0x80FFFF)), //c yan
Pair(0x18.toChar(), Color(0x80FF80)), //*g reen
Pair(0x19.toChar(), Color(0x008000)), //v iridian
Pair(0x1A.toChar(), Color(0x805030)), //x (khaki)
Pair(0x1B.toChar(), Color(0x808080)) //*k
//* marked: commonly used
)
val colToCode = hashMapOf(
Pair("w", 0x10.toChar()),
Pair("y", 0x11.toChar()),
Pair("o", 0x12.toChar()),
Pair("r", 0x13.toChar()),
Pair("f", 0x14.toChar()),
Pair("m", 0x15.toChar()),
Pair("b", 0x16.toChar()),
Pair("c", 0x17.toChar()),
Pair("g", 0x18.toChar()),
Pair("v", 0x19.toChar()),
Pair("x", 0x1A.toChar()),
Pair("k", 0x1B.toChar())
)
val codeToCol = hashMapOf(
Pair("w", colourKey[0x10.toChar()]),
Pair("y", colourKey[0x11.toChar()]),
Pair("o", colourKey[0x12.toChar()]),
Pair("r", colourKey[0x13.toChar()]),
Pair("f", colourKey[0x14.toChar()]),
Pair("m", colourKey[0x15.toChar()]),
Pair("b", colourKey[0x16.toChar()]),
Pair("c", colourKey[0x17.toChar()]),
Pair("g", colourKey[0x18.toChar()]),
Pair("v", colourKey[0x19.toChar()]),
Pair("x", colourKey[0x1A.toChar()]),
Pair("k", colourKey[0x1B.toChar()])
)
}// end of companion object
}
fun Image.drawWithShadow(x: Float, y: Float, color: Color) =
this.drawWithShadow(x, y, 1f, color)
fun Image.drawWithShadow(x: Float, y: Float, scale: Float, color: Color) {
this.draw(x + 1, y + 1, scale, color.darker(0.5f))
this.draw(x , y + 1, scale, color.darker(0.5f))
this.draw(x + 1, y , scale, color.darker(0.5f))
this.draw(x, y, scale, color)
}

View File

@@ -1,73 +0,0 @@
package net.torvald.imagefont
import net.torvald.terrarum.imagefont.GameFontDemo
import org.newdawn.slick.*
/**
* Created by minjaesong on 16-01-20.
*/
class GameFontImpl : GameFontBase() {
init {
GameFontBase.hangulSheet = SpriteSheet(
"./assets/graphics/fonts/hangul_johab.tga", GameFontBase.W_HANGUL, GameFontBase.H)
GameFontBase.asciiSheet = SpriteSheet(
"./assets/graphics/fonts/ascii_variable.tga", 15, 19, 1)
GameFontBase.extASheet = SpriteSheet(
"./assets/graphics/fonts/LatinExtA_variable.tga", 15, 19, 1)
GameFontBase.extBSheet = SpriteSheet(
"./assets/graphics/fonts/LatinExtB_variable.tga", 15, 19, 1)
GameFontBase.kanaSheet = SpriteSheet(
"./assets/graphics/fonts/kana.tga", GameFontBase.W_KANA, GameFontBase.H)
GameFontBase.cjkPunct = SpriteSheet(
"./assets/graphics/fonts/cjkpunct.tga", GameFontBase.W_ASIAN_PUNCT, GameFontBase.H)
GameFontBase.cyrilic = SpriteSheet(
when (GameFontDemo.gameLocale.substring(0..1)) {
"bg" -> "./assets/graphics/fonts/cyrilic_bulgarian_variable.tga"
"sr" -> "./assets/graphics/fonts/cyrilic_serbian_variable.tga"
else -> "./assets/graphics/fonts/cyrilic_variable.tga"
}, 15, 19, 1)
GameFontBase.fullwidthForms = SpriteSheet(
"./assets/graphics/fonts/fullwidth_forms.tga", GameFontBase.W_UNIHAN, GameFontBase.H_UNIHAN)
GameFontBase.uniPunct = SpriteSheet(
"./assets/graphics/fonts/unipunct.tga", GameFontBase.W_LATIN_WIDE, GameFontBase.H)
GameFontBase.uniHan = SpriteSheet(
"./assets/graphics/fonts/wenquanyi.tga", 16, 16)
GameFontBase.greekSheet = SpriteSheet(
"./assets/graphics/fonts/greek_variable.tga", 15, 19, 1)
val shk = arrayOf(
GameFontBase.asciiSheet,
GameFontBase.hangulSheet,
null, // here was customised runic sheet
GameFontBase.extASheet,
GameFontBase.extBSheet,
GameFontBase.kanaSheet,
GameFontBase.cjkPunct,
GameFontBase.uniHan,
GameFontBase.cyrilic,
GameFontBase.fullwidthForms,
GameFontBase.uniPunct,
GameFontBase.greekSheet
)
GameFontBase.sheetKey = shk
buildWidthTable(asciiSheet, 0, 0..0xFF)
buildWidthTable(extASheet, 0x100, 0..0x7F)
buildWidthTable(extBSheet, 0x180, 0..0xCF)
buildWidthTable(cyrilic, 0x400, 0..0x5F)
buildWidthTable(greekSheet, 0x370, 0..0x5F)
}
fun reload() {
GameFontBase.cyrilic.destroy()
GameFontBase.cyrilic = SpriteSheet(
when (GameFontDemo.gameLocale.substring(0..1)) {
"bg" -> "./assets/graphics/fonts/cyrilic_bulgarian_variable.tga"
"sr" -> "./assets/graphics/fonts/cyrilic_serbian_variable.tga"
else -> "./assets/graphics/fonts/cyrilic_variable.tga"
}, 15, 19, 1)
}
}

View File

@@ -1 +0,0 @@
Font implementations for Slick2d

BIN
alignment_illustration.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
assets/ascii_variable.tga LFS Executable file

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
assets/cyrilic_bulgarian_variable.tga LFS Executable file

Binary file not shown.

BIN
assets/cyrilic_serbian_variable.tga LFS Executable file

Binary file not shown.

BIN
assets/cyrilic_variable.tga LFS Executable file

Binary file not shown.

BIN
assets/devanagari_bengali_variable.tga LFS Executable file

Binary file not shown.

BIN
assets/diacritical_marks_variable.tga LFS Executable file

Binary file not shown.

Binary file not shown.

BIN
assets/futhark.tga Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 MiB

Binary file not shown.

BIN
assets/greek_variable.tga LFS Executable file

Binary file not shown.

Binary file not shown.

BIN
assets/hangul_johab.tga Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

BIN
assets/hayeren_variable.tga LFS Executable file

Binary file not shown.

BIN
assets/internal_variable.tga LFS Normal file

Binary file not shown.

BIN
assets/ipa_ext_variable.tga LFS Executable file

Binary file not shown.

BIN
assets/graphics/fonts/kana.tga → assets/kana.tga Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

After

Width:  |  Height:  |  Size: 210 KiB

BIN
assets/kartuli_allcaps_variable.tga LFS Executable file

Binary file not shown.

BIN
assets/kartuli_variable.tga LFS Executable file

Binary file not shown.

BIN
assets/latinExtA_variable.tga LFS Executable file

Binary file not shown.

BIN
assets/latinExtB_variable.tga LFS Executable file

Binary file not shown.

BIN
assets/latinExtC_variable.tga Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
assets/latinExtD_variable.tga LFS Normal file

Binary file not shown.

BIN
assets/latinExt_additional_variable.tga LFS Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
assets/puae000-e0ff.tga LFS Executable file

Binary file not shown.

BIN
assets/richtext_furigana.tga Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
assets/thai_variable.tga LFS Executable file

Binary file not shown.

BIN
assets/tsalagi_variable.tga LFS Executable file

Binary file not shown.

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

BIN
assets/unipunct_variable.tga Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

BIN
assets/wenquanyi.tga.gz Executable file

Binary file not shown.

BIN
demo.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

1
demo/.idea/.name generated
View File

@@ -1 +0,0 @@
TerrarumSansDemo

View File

@@ -1,15 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="unnamed">
<output-path>$PROJECT_DIR$/out/artifacts/unnamed</output-path>
<root id="archive" name="TerrarumSansDemo.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/META-INF/MANIFEST.MF" />
</element>
<element id="file-copy" path="$PROJECT_DIR$/../LICENSE.md" />
<element id="file-copy" path="$PROJECT_DIR$/config.properties" />
<element id="file-copy" path="$PROJECT_DIR$/text.txt" />
<element id="dir-copy" path="$PROJECT_DIR$/lib" />
<element id="module-output" name="TerrarumSansDemo" />
</root>
</artifact>
</component>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/TerrarumSansDemo.iml" filepath="$PROJECT_DIR$/TerrarumSansDemo.iml" />
</modules>
</component>
</project>

775
demo/.idea/workspace.xml generated
View File

@@ -1,775 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ArtifactsWorkspaceSettings">
<artifacts-to-build>
<artifact name="unnamed" />
</artifacts-to-build>
</component>
<component name="BookmarkManager">
<bookmark url="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontDemo.kt" line="46" mnemonic="9" />
</component>
<component name="ChangeListManager">
<list default="true" id="fcc8c48a-4440-438f-9e38-d42425b5efd4" name="Default" comment="" />
<ignored path="$PROJECT_DIR$/out/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FileEditorManager">
<splitter split-orientation="horizontal" split-proportion="0.5">
<split-first>
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="GameFontDemo.kt" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontDemo.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1008">
<caret line="72" column="55" lean-forward="false" selection-start-line="72" selection-start-column="55" selection-end-line="72" selection-end-column="55" />
<folding>
<element signature="e#40#238#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="GameFontImpl.kt" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontImpl.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="36" column="22" lean-forward="false" selection-start-line="36" selection-start-column="22" selection-end-line="36" selection-end-column="22" />
<folding>
<element signature="e#31#108#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="text.txt" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/text.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="252">
<caret line="18" column="0" lean-forward="false" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</split-first>
<split-second>
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="GameFontBase.kt" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontBase.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="14">
<caret line="36" column="19" lean-forward="false" selection-start-line="36" selection-start-column="19" selection-end-line="36" selection-end-column="19" />
<folding>
<element signature="e#31#171#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</split-second>
</splitter>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Kotlin File" />
</list>
</option>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>&quot;|</find>
<find>,\n</find>
<find>main</find>
</findStrings>
<replaceStrings>
<replace>\n</replace>
</replaceStrings>
</component>
<component name="GradleLocalSettings">
<option name="modificationStamps">
<map>
<entry key="$PROJECT_DIR$/../../terrarum_renewed" value="2962360935090" />
</map>
</option>
<option name="externalProjectsViewState">
<projects_view />
</option>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/text.properties" />
<option value="$PROJECT_DIR$/config.properties" />
<option value="$PROJECT_DIR$/META-INF/MANIFEST.MF" />
<option value="$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontDemo.kt" />
<option value="$PROJECT_DIR$/text.txt" />
<option value="$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontBase.kt" />
<option value="$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontImpl.kt" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="-8" />
<option name="y" value="-8" />
<option name="width" value="1936" />
<option name="height" value="1176" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="TerrarumSansDemo" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="demo" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="TerrarumSansDemo" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="demo" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="imagefont" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="TerrarumSansDemo" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="demo" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="META-INF" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="PackagesPane" />
<pane id="Scratches" />
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="settings.editor.selected.configurable" value="project.kotlinCompiler" />
<property name="settings.editor.splitter.proportion" value="0.2" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="project.structure.last.edited" value="Artifacts" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.32068965" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager" selected="Kotlin.net.torvald.terrarum.imagefont.GameFontDemoKt">
<configuration default="false" name="net.torvald.terrarum.imagefont.GameFontDemoKt" type="JetRunConfigurationType" factoryName="Kotlin" temporary="true" nameIsGenerated="true">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="net.torvald.terrarum.imagefont.GameFontDemoKt" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="TerrarumSansDemo" />
<envs />
<method />
</configuration>
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<predefined_log_file id="idea.log" enabled="true" />
<method />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<module />
<method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list />
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<method />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="JarApplication" factoryName="JAR Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<envs />
<method />
</configuration>
<configuration default="true" type="Java Scratch" factoryName="Java Scratch">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="SCRATCH_FILE_ID" value="0" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="JetRunConfigurationType" factoryName="Kotlin">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="TerrarumSansDemo" />
<envs />
<method />
</configuration>
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType" factoryName="Kotlin script">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<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" />
<envs />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="true" type="executeSpecs" factoryName="Gauge Execution">
<setting name="environment" value="" />
<setting name="specsToExecute" value="" />
<setting name="tags" value="" />
<setting name="parallelNodes" value="" />
<setting name="execInParallel" value="false" />
<setting name="programParameters" value="" />
<setting name="workingDirectory" value="" />
<setting name="moduleName" value="" />
<envMap />
<setting name="rowsRange" value="" />
<method />
</configuration>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Kotlin.net.torvald.terrarum.imagefont.GameFontDemoKt" />
</list>
<recent_temporary>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Kotlin.net.torvald.terrarum.imagefont.GameFontDemoKt" />
</list>
</recent_temporary>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="fcc8c48a-4440-438f-9e38-d42425b5efd4" name="Default" comment="" />
<created>1487243351068</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1487243351068</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1176" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32917467" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32960597" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3292683" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.21634616" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="LuaJ" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32960597" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3054371" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.2581574" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="9" side_tool="false" content_ui="combo" />
<window_info id="Code Iris" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.32960597" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Documentation" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.1544196" sideWeight="0.4651163" order="10" side_tool="false" content_ui="tabs" x="1380" y="-157" width="1720" height="857" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Gradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontDemo.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1008">
<caret line="72" column="55" lean-forward="false" selection-start-line="72" selection-start-column="55" selection-end-line="72" selection-end-column="55" />
<folding>
<element signature="e#40#238#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/text.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="252">
<caret line="18" column="0" lean-forward="false" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontImpl.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="588">
<caret line="42" column="46" lean-forward="true" selection-start-line="42" selection-start-column="46" selection-end-line="42" selection-end-column="46" />
<folding>
<element signature="e#31#108#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontBase.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#31#171#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontDemo.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="924">
<caret line="72" column="55" lean-forward="false" selection-start-line="72" selection-start-column="55" selection-end-line="72" selection-end-column="55" />
<folding>
<element signature="e#40#238#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontImpl.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="504">
<caret line="37" column="41" lean-forward="false" selection-start-line="37" selection-start-column="41" selection-end-line="37" selection-end-column="41" />
<folding>
<element signature="e#31#108#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/text.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="252">
<caret line="18" column="0" lean-forward="true" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontBase.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2800">
<caret line="204" column="48" lean-forward="false" selection-start-line="204" selection-start-column="48" selection-end-line="204" selection-end-column="48" />
<folding>
<element signature="e#31#171#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontDemo.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="924">
<caret line="72" column="55" lean-forward="false" selection-start-line="72" selection-start-column="55" selection-end-line="72" selection-end-column="55" />
<folding>
<element signature="e#40#238#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontBase.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="6846">
<caret line="493" column="0" lean-forward="false" selection-start-line="493" selection-start-column="0" selection-end-line="493" selection-end-column="0" />
<folding>
<element signature="e#31#171#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontImpl.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="658">
<caret line="48" column="26" lean-forward="false" selection-start-line="48" selection-start-column="26" selection-end-line="48" selection-end-column="26" />
<folding>
<element signature="e#31#108#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontDemo.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#40#238#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontBase.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="7168">
<caret line="516" column="36" lean-forward="false" selection-start-line="516" selection-start-column="36" selection-end-line="516" selection-end-column="36" />
<folding>
<element signature="e#31#171#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config.properties">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="10" lean-forward="true" selection-start-line="0" selection-start-column="10" selection-end-line="0" selection-end-column="10" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/text.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="95" lean-forward="false" selection-start-line="0" selection-start-column="95" selection-end-line="0" selection-end-column="95" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontImpl.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="392">
<caret line="29" column="0" lean-forward="false" selection-start-line="29" selection-start-column="0" selection-end-line="29" selection-end-column="0" />
<folding>
<element signature="e#31#108#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/META-INF/MANIFEST.MF">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="28">
<caret line="2" column="57" lean-forward="true" selection-start-line="2" selection-start-column="57" selection-end-line="2" selection-end-column="57" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Ba-AA/src/net/torvald/aa/demoplayer/BaAA.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="273">
<caret line="428" column="8" lean-forward="false" selection-start-line="428" selection-start-column="8" selection-end-line="429" selection-end-column="87" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config.properties">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="10" lean-forward="false" selection-start-line="0" selection-start-column="10" selection-end-line="0" selection-end-column="10" />
</state>
</provider>
</entry>
<entry file="jar://$KOTLIN_BUNDLED$/lib/kotlin-runtime-sources.jar!/kotlin/Primitives.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="338">
<caret line="491" column="24" lean-forward="false" selection-start-line="491" selection-start-column="24" selection-end-line="491" selection-end-column="24" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/text.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="252">
<caret line="18" column="0" lean-forward="false" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontBase.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="14">
<caret line="36" column="19" lean-forward="false" selection-start-line="36" selection-start-column="19" selection-end-line="36" selection-end-column="19" />
<folding>
<element signature="e#31#171#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontDemo.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1008">
<caret line="72" column="55" lean-forward="false" selection-start-line="72" selection-start-column="55" selection-end-line="72" selection-end-column="55" />
<folding>
<element signature="e#40#238#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontImpl.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="36" column="22" lean-forward="false" selection-start-line="36" selection-start-column="22" selection-end-line="36" selection-end-column="22" />
<folding>
<element signature="e#31#108#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<settings>
<artifact-editor>
<show-content>
<type id="artifact" />
<type id="library" />
</show-content>
</artifact-editor>
<last-edited>unnamed</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.32068965" />
<option value="0.5" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="FacetStructureConfigurable.UI">
<settings>
<last-edited>Kotlin</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.32068965" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ModuleStructureConfigurable.UI">
<settings>
<last-edited>TerrarumSansDemo</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.32068965" />
<option value="0.6" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<last-edited>KotlinJavaRuntime</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.32068965" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

View File

@@ -1,4 +0,0 @@
Manifest-Version: 1.0
Class-Path: lib/lwjgl.jar lib/lwjgl_util.jar lib/slick.jar lib/kotlin-reflect.jar lib/kotlin-runtime.jar
Main-Class: net.torvald.terrarum.imagefont.GameFontDemoKt

View File

@@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="kotlin-language" name="Kotlin">
<configuration version="1">
<option name="compilerInfo">
<KotlinCompilerInfo>
<option name="compilerSettings">
<CompilerSettings />
</option>
<option name="k2jsCompilerArguments">
<K2JSCompilerArguments />
</option>
<option name="k2jvmCompilerArguments">
<K2JVMCompilerArguments />
</option>
<option name="_commonCompilerArguments">
<DummyImpl />
</option>
</KotlinCompilerInfo>
</option>
<option name="useProjectSettings" value="false" />
<option name="versionInfo">
<KotlinVersionInfo>
<option name="apiLevel" value="1.0" />
<option name="languageLevel" value="1.0" />
<option name="targetPlatformName" value="JVM 1.6" />
</KotlinVersionInfo>
</option>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
</component>
</module>

View File

@@ -1 +0,0 @@
locale=enUS

View File

@@ -1,558 +0,0 @@
package net.torvald.imagefont
import org.lwjgl.opengl.GL11
import org.newdawn.slick.*
import org.newdawn.slick.opengl.Texture
import java.nio.ByteOrder
import java.util.*
/**
* Created by minjaesong on 16-01-27.
*/
open class GameFontBase : Font {
private fun getHan(hanIndex: Int): IntArray {
val han_x = hanIndex % JONG_COUNT
val han_y = hanIndex / JONG_COUNT
val ret = intArrayOf(han_x, han_y)
return ret
}
private fun getHanChosung(hanIndex: Int) = hanIndex / (JUNG_COUNT * JONG_COUNT)
private fun getHanJungseong(hanIndex: Int) = hanIndex / JONG_COUNT % JUNG_COUNT
private fun getHanJongseong(hanIndex: Int) = hanIndex % JONG_COUNT
private val jungseongWide = arrayOf(8, 12, 13, 17, 18, 21)
private val jungseongComplex = arrayOf(9, 10, 11, 14, 15, 16, 22)
private fun isJungseongWide(hanIndex: Int) = jungseongWide.contains(getHanJungseong(hanIndex))
private fun isJungseongComplex(hanIndex: Int) = jungseongComplex.contains(getHanJungseong(hanIndex))
private fun getHanInitialRow(hanIndex: Int): Int {
val ret: Int
if (isJungseongWide(hanIndex))
ret = 2
else if (isJungseongComplex(hanIndex))
ret = 4
else
ret = 0
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
}
private fun getHanMedialRow(hanIndex: Int) = if (getHanJongseong(hanIndex) == 0) 6 else 7
private fun getHanFinalRow(hanIndex: Int): Int {
val jungseongIndex = getHanJungseong(hanIndex)
return if (jungseongWide.contains(jungseongIndex))
8
else
9
}
private fun isHangul(c: Char) = c.toInt() in 0xAC00..0xD7A3
private fun isAscii(c: Char) = c.toInt() in 0x20..0xFF
private fun isRunic(c: Char) = runicList.contains(c)
private fun isExtA(c: Char) = c.toInt() in 0x100..0x17F
private fun isExtB(c: Char) = c.toInt() in 0x180..0x24F
private fun isKana(c: Char) = c.toInt() in 0x3040..0x30FF
private fun isCJKPunct(c: Char) = c.toInt() in 0x3000..0x303F
private fun isUniHan(c: Char) = c.toInt() in 0x3400..0x9FFF
private fun isCyrilic(c: Char) = c.toInt() in 0x400..0x45F
private fun isFullwidthUni(c: Char) = c.toInt() in 0xFF00..0xFF1F
private fun isUniPunct(c: Char) = c.toInt() in 0x2000..0x206F
private fun isGreek(c: Char) = c.toInt() in 0x370..0x3CE
private fun extAindexX(c: Char) = (c.toInt() - 0x100) % 16
private fun extAindexY(c: Char) = (c.toInt() - 0x100) / 16
private fun extBindexX(c: Char) = (c.toInt() - 0x180) % 16
private fun extBindexY(c: Char) = (c.toInt() - 0x180) / 16
private fun runicIndexX(c: Char) = runicList.indexOf(c) % 16
private fun runicIndexY(c: Char) = runicList.indexOf(c) / 16
private fun kanaIndexX(c: Char) = (c.toInt() - 0x3040) % 16
private fun kanaIndexY(c: Char) = (c.toInt() - 0x3040) / 16
private fun cjkPunctIndexX(c: Char) = (c.toInt() - 0x3000) % 16
private fun cjkPunctIndexY(c: Char) = (c.toInt() - 0x3000) / 16
private fun unihanIndexX(c: Char) = (c.toInt() - 0x3400) % 256
private fun unihanIndexY(c: Char) = (c.toInt() - 0x3400) / 256
private fun cyrilicIndexX(c: Char) = (c.toInt() - 0x400) % 16
private fun cyrilicIndexY(c: Char) = (c.toInt() - 0x400) / 16
private fun fullwidthUniIndexX(c: Char) = (c.toInt() - 0xFF00) % 16
private fun fullwidthUniIndexY(c: Char) = (c.toInt() - 0xFF00) / 16
private fun uniPunctIndexX(c: Char) = (c.toInt() - 0x2000) % 16
private fun uniPunctIndexY(c: Char) = (c.toInt() - 0x2000) / 16
private fun greekIndexX(c: Char) = (c.toInt() - 0x370) % 16
private fun greekIndexY(c: Char) = (c.toInt() - 0x370) / 16
private val unihanWidthSheets = arrayOf(
SHEET_UNIHAN,
SHEET_FW_UNI,
SHEET_UNIHAN
)
private val zeroWidthSheets = arrayOf(
SHEET_COLOURCODE
)
private val variableWidthSheets = arrayOf(
SHEET_ASCII_VARW,
SHEET_CYRILIC_VARW,
SHEET_EXTA_VARW,
SHEET_GREEK_VARW,
SHEET_EXTB_VARW
)
override fun getWidth(s: String) = getWidthSubstr(s, s.length)
private fun getWidthSubstr(s: String, endIndex: Int): Int {
var len = 0
for (i in 0..endIndex - 1) {
val chr = s[i]
val ctype = getSheetType(s[i])
if (variableWidthSheets.contains(ctype)) {
len += try {
asciiWidths[chr.toInt()]!!
}
catch (e: kotlin.KotlinNullPointerException) {
println("KotlinNullPointerException on glyph number ${Integer.toHexString(chr.toInt()).toUpperCase()}")
//System.exit(1)
W_LATIN_WIDE // failsafe
}
}
else if (zeroWidthSheets.contains(ctype))
len += 0
else if (ctype == SHEET_CJK_PUNCT)
len += W_ASIAN_PUNCT
else if (ctype == SHEET_HANGUL)
len += W_HANGUL
else if (ctype == SHEET_KANA)
len += W_KANA
else if (unihanWidthSheets.contains(ctype))
len += W_UNIHAN
else
len += W_LATIN_WIDE
if (i < endIndex - 1) len += interchar
}
return len * scale
}
override fun getHeight(s: String) = H * scale
override fun getLineHeight() = H * scale
override fun drawString(x: Float, y: Float, s: String) = drawString(x, y, s, Color.white)
override fun drawString(x: Float, y: Float, s: String, color: Color) {
GL11.glEnable(GL11.GL_BLEND)
GL11.glColorMask(true, true, true, true)
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA)
var thisCol = color
// hangul fonts first
//hangulSheet.startUse() // disabling texture binding to make the font coloured
// JOHAB
for (i in 0..s.length - 1) {
val ch = s[i]
if (ch.isColourCode()) {
thisCol = colourKey[ch]!!
continue
}
if (isHangul(ch)) {
val hIndex = ch.toInt() - 0xAC00
val indexCho = getHanChosung(hIndex)
val indexJung = getHanJungseong(hIndex)
val indexJong = getHanJongseong(hIndex)
val choRow = getHanInitialRow(hIndex)
val jungRow = getHanMedialRow(hIndex)
val jongRow = getHanFinalRow(hIndex)
val glyphW = getWidth(ch.toString())
hangulSheet.getSubImage(indexCho, choRow).drawWithShadow(
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
Math.round(y).toFloat(),
scale.toFloat(), thisCol
)
hangulSheet.getSubImage(indexJung, jungRow).drawWithShadow(
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
Math.round(y).toFloat(),
scale.toFloat(), thisCol
)
hangulSheet.getSubImage(indexJong, jongRow).drawWithShadow(
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
Math.round(y).toFloat(),
scale.toFloat(), thisCol
)
}
}
//hangulSheet.endUse()
// WenQuanYi
//uniHan.startUse()
for (i in 0..s.length - 1) {
val ch = s[i]
if (ch.isColourCode()) {
thisCol = colourKey[ch]!!
continue
}
if (isUniHan(ch)) {
val glyphW = getWidth("" + ch)
uniHan.getSubImage(unihanIndexX(ch), unihanIndexY(ch)).drawWithShadow(
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
Math.round((H - H_UNIHAN) / 2 + y).toFloat(),
scale.toFloat(), thisCol
)
}
}
//uniHan.endUse()
// regular fonts
var prevInstance = -1
for (i in 0..s.length - 1) {
val ch = s[i]
if (ch.isColourCode()) {
thisCol = colourKey[ch]!!
continue
}
if (!isHangul(ch) && !isUniHan(ch)) {
// if not init, endUse first
if (prevInstance != -1) {
//sheetKey[prevInstance].endUse()
}
//sheetKey[getSheetType(ch)].startUse()
prevInstance = getSheetType(ch)
val sheetX: Int
val sheetY: Int
when (prevInstance) {
SHEET_EXTA_VARW -> {
sheetX = extAindexX(ch)
sheetY = extAindexY(ch)
}
SHEET_EXTB_VARW -> {
sheetX = extBindexX(ch)
sheetY = extBindexY(ch)
}
SHEET_KANA -> {
sheetX = kanaIndexX(ch)
sheetY = kanaIndexY(ch)
}
SHEET_CJK_PUNCT -> {
sheetX = cjkPunctIndexX(ch)
sheetY = cjkPunctIndexY(ch)
}
SHEET_CYRILIC_VARW -> {
sheetX = cyrilicIndexX(ch)
sheetY = cyrilicIndexY(ch)
}
SHEET_FW_UNI -> {
sheetX = fullwidthUniIndexX(ch)
sheetY = fullwidthUniIndexY(ch)
}
SHEET_UNI_PUNCT -> {
sheetX = uniPunctIndexX(ch)
sheetY = uniPunctIndexY(ch)
}
SHEET_GREEK_VARW -> {
sheetX = greekIndexX(ch)
sheetY = greekIndexY(ch)
}
else -> {
sheetX = ch.toInt() % 16
sheetY = ch.toInt() / 16
}
}
val glyphW = getWidth("" + ch)
try {
sheetKey[prevInstance]!!.getSubImage(sheetX, sheetY).drawWithShadow(
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
Math.round(y).toFloat(),
scale.toFloat(), thisCol
)
}
catch (e: ArrayIndexOutOfBoundsException) {
// character that does not exist in the sheet. No render, pass.
}
catch (e1: RuntimeException) {
// System.err.println("[GameFontBase] RuntimeException raised while processing character '$ch' (U+${Integer.toHexString(ch.toInt()).toUpperCase()})")
// e1.printStackTrack()
}
}
}
if (prevInstance != -1) {
//sheetKey[prevInstance].endUse()
}
GL11.glEnd()
}
private fun getSheetType(c: Char): Int {
if (isHangul(c))
return SHEET_HANGUL
else if (isKana(c))
return SHEET_KANA
else if (isUniHan(c))
return SHEET_UNIHAN
else if (isAscii(c))
return SHEET_ASCII_VARW
else if (isExtA(c))
return SHEET_EXTA_VARW
else if (isExtB(c))
return SHEET_EXTB_VARW
else if (isCyrilic(c))
return SHEET_CYRILIC_VARW
else if (isUniPunct(c))
return SHEET_UNI_PUNCT
else if (isCJKPunct(c))
return SHEET_CJK_PUNCT
else if (isFullwidthUni(c))
return SHEET_FW_UNI
else if (isGreek(c))
return SHEET_GREEK_VARW
else if (c.isColourCode())
return SHEET_COLOURCODE
else
return SHEET_UNKNOWN// fixed width punctuations
// fixed width
// fallback
}
/**
* Draw part of a string to the screen. Note that this will still position the text as though
* it's part of the bigger string.
* @param x
* *
* @param y
* *
* @param s
* *
* @param color
* *
* @param startIndex
* *
* @param endIndex
*/
override fun drawString(x: Float, y: Float, s: String, color: Color, startIndex: Int, endIndex: Int) {
val unprintedHead = s.substring(0, startIndex)
val printedBody = s.substring(startIndex, endIndex)
val xoff = getWidth(unprintedHead)
drawString(x + xoff, y, printedBody, color)
}
fun Char.isColourCode() = colourKey.containsKey(this)
fun buildWidthTable(sheet: SpriteSheet, codeOffset: Int, codeRange: IntRange, rows: Int = 16) {
fun Byte.toUint() = java.lang.Byte.toUnsignedInt(this)
/** @return Intarray(R, G, B, A) */
fun Texture.getPixel(x: Int, y: Int): IntArray {
val textureWidth = this.textureWidth
val hasAlpha = this.hasAlpha()
val offset = (if (hasAlpha) 4 else 3) * (textureWidth * y + x) // 4: # of channels (RGBA)
if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) {
return intArrayOf(
this.textureData[offset].toUint(),
this.textureData[offset + 1].toUint(),
this.textureData[offset + 2].toUint(),
if (hasAlpha)
this.textureData[offset + 3].toUint()
else 255
)
}
else {
return intArrayOf(
this.textureData[offset + 2].toUint(),
this.textureData[offset + 1].toUint(),
this.textureData[offset].toUint(),
if (hasAlpha)
this.textureData[offset + 3].toUint()
else 255
)
}
}
val binaryCodeOffset = 15
val cellW = sheet.getSubImage(0, 0).width + 1 // should be 16
val cellH = sheet.getSubImage(0, 0).height + 1 // should be 20
// control chars
for (ccode in codeRange) {
val glyphX = ccode % rows
val glyphY = ccode / rows
val codeStartX = (glyphX * cellW) + binaryCodeOffset
val codeStartY = (glyphY * cellH)
var glyphWidth = 0
for (downCtr in 0..3) {
// if alpha is not zero, assume it's 1
if (sheet.texture.getPixel(codeStartX, codeStartY + downCtr)[3] == 255) {
glyphWidth = glyphWidth or (1 shl downCtr)
}
}
asciiWidths[codeOffset + ccode] = glyphWidth
}
}
companion object {
lateinit internal var hangulSheet: SpriteSheet
lateinit internal var asciiSheet: SpriteSheet
internal val asciiWidths: HashMap<Int, Int> = HashMap()
lateinit internal var extASheet: SpriteSheet
lateinit internal var extBSheet: SpriteSheet
lateinit internal var kanaSheet: SpriteSheet
lateinit internal var cjkPunct: SpriteSheet
lateinit internal var uniHan: SpriteSheet
lateinit internal var cyrilic: SpriteSheet
lateinit internal var fullwidthForms: SpriteSheet
lateinit internal var uniPunct: SpriteSheet
lateinit internal var greekSheet: SpriteSheet
internal val JUNG_COUNT = 21
internal val JONG_COUNT = 28
internal val W_ASIAN_PUNCT = 10
internal val W_HANGUL = 11
internal val W_KANA = 12
internal val W_UNIHAN = 16
internal val W_LATIN_WIDE = 9 // width of regular letters
internal val H = 20
internal val H_UNIHAN = 16
internal val SHEET_ASCII_VARW = 0
internal val SHEET_HANGUL = 1
internal val SHEET_EXTA_VARW = 3
internal val SHEET_EXTB_VARW = 4
internal val SHEET_KANA = 5
internal val SHEET_CJK_PUNCT = 6
internal val SHEET_UNIHAN = 7
internal val SHEET_CYRILIC_VARW = 8
internal val SHEET_FW_UNI = 9
internal val SHEET_UNI_PUNCT = 10
internal val SHEET_GREEK_VARW = 11
internal val SHEET_UNKNOWN = 254
internal val SHEET_COLOURCODE = 255
lateinit internal var sheetKey: Array<SpriteSheet?>
/**
* Runic letters list used for game. The set is
* Younger Futhark + Medieval rune 'e' + Punct + Runic Almanac
* BEWARE OF SIMILAR-LOOKING RUNES, especially:
* * Algiz ᛉ instead of Maðr ᛘ
* * Short-Twig Hagall ᚽ instead of Runic Letter E ᛂ
* * Runic Letter OE ᚯ instead of Óss ᚬ
* Examples:
* ᛭ᛋᛁᚴᚱᛁᚦᛦ᛭
* ᛭ᛂᛚᛋᛅ᛭ᛏᚱᚢᛏᚾᛁᚾᚴᚢᚾᛅ᛬ᛅᚱᚾᛅᛏᛅᛚᛋ
*/
internal val runicList = arrayOf('ᚠ', 'ᚢ', 'ᚦ', 'ᚬ', 'ᚱ', 'ᚴ', 'ᚼ', 'ᚾ', '', 'ᛅ', 'ᛋ', 'ᛏ', 'ᛒ', 'ᛘ', 'ᛚ', 'ᛦ', 'ᛂ', '', '᛫', '', 'ᛮ', 'ᛯ', 'ᛰ')
internal var interchar = 0
internal var scale = 1
set(value) {
if (value > 0) field = value
else throw IllegalArgumentException("Font scale cannot be zero or negative (input: $value)")
}
val colourKey = hashMapOf(
Pair(0x10.toChar(), Color(0xFFFFFF)), //*w hite
Pair(0x11.toChar(), Color(0xFFE080)), //*y ellow
Pair(0x12.toChar(), Color(0xFFB020)), //o range
Pair(0x13.toChar(), Color(0xFF8080)), //*r ed
Pair(0x14.toChar(), Color(0xFFA0E0)), //f uchsia
Pair(0x15.toChar(), Color(0xE0A0FF)), //*m agenta (purple)
Pair(0x16.toChar(), Color(0x8080FF)), //*b lue
Pair(0x17.toChar(), Color(0x80FFFF)), //c yan
Pair(0x18.toChar(), Color(0x80FF80)), //*g reen
Pair(0x19.toChar(), Color(0x008000)), //v iridian
Pair(0x1A.toChar(), Color(0x805030)), //x (khaki)
Pair(0x1B.toChar(), Color(0x808080)) //*k
//* marked: commonly used
)
val colToCode = hashMapOf(
Pair("w", 0x10.toChar()),
Pair("y", 0x11.toChar()),
Pair("o", 0x12.toChar()),
Pair("r", 0x13.toChar()),
Pair("f", 0x14.toChar()),
Pair("m", 0x15.toChar()),
Pair("b", 0x16.toChar()),
Pair("c", 0x17.toChar()),
Pair("g", 0x18.toChar()),
Pair("v", 0x19.toChar()),
Pair("x", 0x1A.toChar()),
Pair("k", 0x1B.toChar())
)
val codeToCol = hashMapOf(
Pair("w", colourKey[0x10.toChar()]),
Pair("y", colourKey[0x11.toChar()]),
Pair("o", colourKey[0x12.toChar()]),
Pair("r", colourKey[0x13.toChar()]),
Pair("f", colourKey[0x14.toChar()]),
Pair("m", colourKey[0x15.toChar()]),
Pair("b", colourKey[0x16.toChar()]),
Pair("c", colourKey[0x17.toChar()]),
Pair("g", colourKey[0x18.toChar()]),
Pair("v", colourKey[0x19.toChar()]),
Pair("x", colourKey[0x1A.toChar()]),
Pair("k", colourKey[0x1B.toChar()])
)
}// end of companion object
}
fun Image.drawWithShadow(x: Float, y: Float, color: Color) =
this.drawWithShadow(x, y, 1f, color)
fun Image.drawWithShadow(x: Float, y: Float, scale: Float, color: Color) {
this.draw(x + 1, y + 1, scale, color.darker(0.5f))
this.draw(x , y + 1, scale, color.darker(0.5f))
this.draw(x + 1, y , scale, color.darker(0.5f))
this.draw(x, y, scale, color)
}

View File

@@ -1,94 +0,0 @@
package net.torvald.terrarum.imagefont
import net.torvald.imagefont.GameFontImpl
import org.newdawn.slick.*
import java.io.File
import java.io.FileInputStream
import java.nio.file.FileSystems
import java.nio.file.Files
import java.util.*
/**
* Created by SKYHi14 on 2017-02-16.
*/
class GameFontDemo : BasicGame("Terrarum Sans Bitmap Demo") {
lateinit var gameFont: Font
override fun init(p0: GameContainer?) {
gameFont = GameFontImpl()
}
override fun update(gc: GameContainer, delta: Int) {
}
override fun render(gc: GameContainer, g: Graphics) {
g.font = gameFont
g.background = Color(0x282828)
text.forEachIndexed { i, s ->
g.drawString(s, 10f, 10f + i * gameFont.lineHeight)
}
}
companion object {
lateinit var gameLocale: String
var hasError: Boolean
val text = ArrayList<String>()
init {
try {
val prop = Properties()
prop.load(FileInputStream("./config.properties"))
gameLocale = prop.getProperty("locale")
if (gameLocale.length < 2)
throw IllegalArgumentException("Bad locale setting: “$gameLocale")
Files.lines(FileSystems.getDefault().getPath("./text.txt")).forEach(
{ text.add(it) }
)
hasError = false
}
catch (e: Exception) {
gameLocale = "enUS"
hasError = true
text.add("There was some problem loading the demo :(")
text.add("This is what JVM says:")
text.add("")
e.message!!.split('\n').forEach {
text.add(it)
}
}
}
}
}
fun main(args: Array<String>) {
System.setProperty("java.library.path", "lib")
System.setProperty("org.lwjgl.librarypath", File("lib").absolutePath)
val WIDTH = 1000
val HEIGHT = 800
try {
val appgc = AppGameContainer(GameFontDemo())
appgc.setDisplayMode(WIDTH, HEIGHT, false)
appgc.setMultiSample(0)
appgc.setShowFPS(false)
// game will run normally even if it is not focused
appgc.setUpdateOnlyWhenVisible(false)
appgc.alwaysRender = true
appgc.start()
}
catch (ex: Exception) {
ex.printStackTrace()
}
}

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