Add unicode character table for font subsetting

This commit is contained in:
kichikuou
2019-01-20 21:31:19 +09:00
parent bea272611a
commit ca3a4b2ea3
3 changed files with 7768 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
uchars.txt: uchars
./uchars > $@
uchars: uchars.c
gcc -o $@ $<
+37
View File
@@ -0,0 +1,37 @@
#include <stdio.h>
#include "../src/s2utbl.h"
void print_utf8(int code) {
if (code <= 0x7f) {
putchar(code);
} else if (code <= 0x7ff) {
putchar(0xc0 | code >> 6);
putchar(0x80 | (code & 0x3f));
} else {
putchar(0xe0 | code >> 12);
putchar(0x80 | (code >> 6 & 0x3f));
putchar(0x80 | (code & 0x3f));
}
}
int main() {
// ASCII
for (int c = ' '; c <= '~'; c++)
putchar(c);
putchar('\n');
// Half-width kana
for (int c = 0xff61; c <= 0xff9f; c++)
print_utf8(c);
putchar('\n');
for (int hi = 0; hi < 0x80; hi++) {
for (int lo = 0; lo < 0xc0; lo++) {
int code = s2u[hi][lo];
if (code == 0x30fb && !(hi == 0x01 && lo == 0x05))
continue;
print_utf8(code);
putchar('\n');
}
}
}
+7726
View File
File diff suppressed because it is too large Load Diff