• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

BASIC compiler/interpreter for PIC32MX/MZ-80K


Commit MetaInfo

Revision3bb49c390cae5881022825182c0a91a13facaa63 (tree)
Time2019-03-03 09:29:36
AuthorKatsumi <kmorimatsu@sour...>
CommiterKatsumi

Log Message

Update font-creating scrips for CKNJ12 and CKNJ16

Change Summary

Incremental Difference

--- a/mips/classes/CKNJ12/font/k12shnm2jis.php
+++ b/mips/classes/CKNJ12/font/k12shnm2jis.php
@@ -10,6 +10,44 @@
1010
1111 */
1212
13+$tfile=file_get_contents('./shnm6x12a.bdf');
14+$ftable=array();
15+preg_replace_callback('/STARTCHAR[\s]+([0-9a-f]{2})[\s\S]*?(([0-9a-f]{2}[\s]+){12})/',function($m) use(&$ftable){
16+ /* 0x23 # */
17+ /* example:
18+ STARTCHAR 23
19+ ENCODING 35
20+ SWIDTH 960 0
21+ DWIDTH 6 0
22+ BBX 6 12 0 -2
23+ BITMAP
24+ 00
25+ 50
26+ 50
27+ f8
28+ 50
29+ 50
30+ 50
31+ f8
32+ 50
33+ 50
34+ 00
35+ 00
36+ ENDCHAR
37+ */
38+ $ftable[hexdec($m[1])]=preg_replace('/([0-9a-f]{2})[\s]+/','$1',$m[2]);
39+},$tfile);
40+//print_r($ftable);exit;
41+
42+$result='';
43+for($code=0x20;$code<=0x7f;$code++){
44+ for($i=0;$i<24;$i+=2){
45+ $result.=chr(hexdec(substr($ftable[$code],$i,2)));
46+ }
47+}
48+// half font area is 1152 bytes (12*96)
49+//file_put_contents('./result',$result);exit;
50+
1351 $tfile=file_get_contents('./shnmk12.bdf');
1452 $ftable=array();
1553 preg_replace_callback('/STARTCHAR[\s]+([0-9a-f]{4})[\s\S]*?(([0-9a-f]{4}[\s]+){12})/',function($m) use(&$ftable){
@@ -39,7 +77,6 @@ preg_replace_callback('/STARTCHAR[\s]+([0-9a-f]{4})[\s\S]*?(([0-9a-f]{4}[\s]+){1
3977 },$tfile);
4078 //print_r($ftable);exit;
4179
42-$result='';
4380 for($code=0x2121;$code<=0x7426;$code++){
4481 if (isset($ftable[$code])) {
4582 for($i=0;$i<36;$i+=2){
--- a/mips/classes/CKNJ12/font/k12shnmk2uni.php
+++ b/mips/classes/CKNJ12/font/k12shnmk2uni.php
@@ -2,6 +2,7 @@
22 /*
33
44 Binary font file generator for Shinonome 12x12 font.
5+ Place 'shnm6x12a.bdf' in the same directory and run this script.
56 Place 'shnmk16.bdf' in the same directory and run this script.
67 Place 'JIS0208.TXT' in the same directory and run this script.
78 The font file is used for UTF-8.
@@ -11,6 +12,44 @@
1112
1213 */
1314
15+$tfile=file_get_contents('./shnm6x12a.bdf');
16+$ftable=array();
17+preg_replace_callback('/STARTCHAR[\s]+([0-9a-f]{2})[\s\S]*?(([0-9a-f]{2}[\s]+){12})/',function($m) use(&$ftable){
18+ /* 0x23 # */
19+ /* example:
20+ STARTCHAR 23
21+ ENCODING 35
22+ SWIDTH 960 0
23+ DWIDTH 6 0
24+ BBX 6 12 0 -2
25+ BITMAP
26+ 00
27+ 50
28+ 50
29+ f8
30+ 50
31+ 50
32+ 50
33+ f8
34+ 50
35+ 50
36+ 00
37+ 00
38+ ENDCHAR
39+ */
40+ $ftable[hexdec($m[1])]=preg_replace('/([0-9a-f]{2})[\s]+/','$1',$m[2]);
41+},$tfile);
42+//print_r($ftable);exit;
43+
44+$result='';
45+for($code=0x20;$code<=0x7f;$code++){
46+ for($i=0;$i<24;$i+=2){
47+ $result.=chr(hexdec(substr($ftable[$code],$i,2)));
48+ }
49+}
50+// half font area is 1152 bytes (12*96)
51+//file_put_contents('./result',$result);exit;
52+
1453 $tfile=file_get_contents('./shnmk12.bdf');
1554 $ftable=array();
1655 preg_replace_callback('/STARTCHAR[\s]+([0-9a-f]{4})[\s\S]*?(([0-9a-f]{4}[\s]+){12})/',function($m) use(&$ftable){
@@ -49,7 +88,6 @@ preg_replace_callback('/[\r\n]0x([0-9A-F]{4})[\s]+0x([0-9A-F]{4})[\s]+0x([0-9A-F
4988 }
5089 },$tfile);
5190
52-$result='';
5391 for($code=0x0000;$code<=0xffff;$code++){
5492 /*
5593 Skip:
--- a/mips/classes/CKNJ16/font/shinonome2jis.php
+++ b/mips/classes/CKNJ16/font/shinonome2jis.php
@@ -4,11 +4,55 @@
44
55 Binary font file generator for Shinonome 16x16 font.
66 Place 'shnmk16.bdf' in the same directory and run this script.
7+ Place 'shnm8x16.bdf' in the same directory and run this script.
78 The font file is used for EUC-JP.
89 On 2/23/2019, Shinonome font is available from: https://www.mgo-tec.com/kanji-font-shinonome
910
1011 */
1112
13+$tfile=file_get_contents('./shnm8x16.bdf');
14+$ftable=array();
15+preg_replace_callback('/STARTCHAR[\s]+([0-9a-f]{2})[\s\S]*?(([0-9a-f]{2}[\s]+){16})/',function($m) use(&$ftable){
16+ /* 0x23: # */
17+ /* example:
18+ STARTCHAR 23
19+ ENCODING 35
20+ SWIDTH 480 0
21+ DWIDTH 8 0
22+ BBX 8 16 0 -2
23+ BITMAP
24+ 00
25+ 12
26+ 12
27+ 12
28+ 7f
29+ 24
30+ 24
31+ 24
32+ 24
33+ 24
34+ fe
35+ 48
36+ 48
37+ 48
38+ 48
39+ 00
40+ ENDCHAR
41+ */
42+ $ftable[hexdec($m[1])]=preg_replace('/[\s]+/','',$m[2]);
43+},$tfile);
44+$ftable[0x7f]='00000000000000000000000000000000';
45+//print_r($ftable);exit;
46+
47+$result='';
48+for($code=0x20;$code<=0x7f;$code++){
49+ for($i=0;$i<32;$i+=2){
50+ $result.=chr(hexdec(substr($ftable[$code],$i,2)));
51+ }
52+}
53+// half font area is 1536 bytes (16*96)
54+//file_put_contents('./result',$result);exit;
55+
1256 $tfile=file_get_contents('./shnmk16.bdf');
1357 $ftable=array();
1458 preg_replace_callback('/STARTCHAR[\s]+([0-9a-f]{4})[\s\S]*?(([0-9a-f]{4}[\s]+){16})/',function($m) use(&$ftable){
@@ -42,7 +86,6 @@ preg_replace_callback('/STARTCHAR[\s]+([0-9a-f]{4})[\s\S]*?(([0-9a-f]{4}[\s]+){1
4286 },$tfile);
4387 //print_r($ftable);exit;
4488
45-$result='';
4689 for($code=0x2121;$code<=0x7426;$code++){
4790 if (isset($ftable[$code])) {
4891 for($i=0;$i<64;$i+=2){
--- a/mips/classes/CKNJ16/font/shinonome2uni.php
+++ b/mips/classes/CKNJ16/font/shinonome2uni.php
@@ -3,6 +3,7 @@
33
44 Binary font file generator for Shinonome 16x16 font.
55 Place 'shnmk16.bdf' in the same directory and run this script.
6+ Place 'shnm8x16.bdf' in the same directory and run this script.
67 Place 'JIS0208.TXT' in the same directory and run this script.
78 The font file is used for UTF-8.
89 On 2/23/2019, Shinonome font is available from: https://www.mgo-tec.com/kanji-font-shinonome
@@ -10,6 +11,49 @@
1011
1112 */
1213
14+$tfile=file_get_contents('./shnm8x16.bdf');
15+$ftable=array();
16+preg_replace_callback('/STARTCHAR[\s]+([0-9a-f]{2})[\s\S]*?(([0-9a-f]{2}[\s]+){16})/',function($m) use(&$ftable){
17+ /* 0x23: # */
18+ /* example:
19+ STARTCHAR 23
20+ ENCODING 35
21+ SWIDTH 480 0
22+ DWIDTH 8 0
23+ BBX 8 16 0 -2
24+ BITMAP
25+ 00
26+ 12
27+ 12
28+ 12
29+ 7f
30+ 24
31+ 24
32+ 24
33+ 24
34+ 24
35+ fe
36+ 48
37+ 48
38+ 48
39+ 48
40+ 00
41+ ENDCHAR
42+ */
43+ $ftable[hexdec($m[1])]=preg_replace('/[\s]+/','',$m[2]);
44+},$tfile);
45+$ftable[0x7f]='00000000000000000000000000000000';
46+//print_r($ftable);exit;
47+
48+$result='';
49+for($code=0x20;$code<=0x7f;$code++){
50+ for($i=0;$i<32;$i+=2){
51+ $result.=chr(hexdec(substr($ftable[$code],$i,2)));
52+ }
53+}
54+// half font area is 1536 bytes (16*96)
55+//file_put_contents('./result',$result);exit;
56+
1357 $tfile=file_get_contents('./shnmk16.bdf');
1458 $ftable=array();
1559 preg_replace_callback('/STARTCHAR[\s]+([0-9a-f]{4})[\s\S]*?(([0-9a-f]{4}[\s]+){16})/',function($m) use(&$ftable){
@@ -52,7 +96,6 @@ preg_replace_callback('/[\r\n]0x([0-9A-F]{4})[\s]+0x([0-9A-F]{4})[\s]+0x([0-9A-F
5296 }
5397 },$tfile);
5498
55-$result='';
5699 for($code=0x0000;$code<=0xffff;$code++){
57100 /*
58101 Skip: