+ Missing glyphs search tools

This commit is contained in:
Vovanium 2022-04-26 19:54:00 +03:00
parent 3fa328b708
commit 501711c013
1 changed files with 25 additions and 0 deletions

25
tools/check-missing.awk Normal file
View File

@ -0,0 +1,25 @@
#!/usr/bin/gawk -f
function hex(x, i, y, d) {
y = 0;
for(i = 1; i <= length(x); i++) {
d = index("0123456789ABCDEF", toupper(substr(x, i, 1)));
if(!(d > 0 && d <= 16)) {
print "Hexadecimal character required" > "/dev/stderr";
}
y = y * 16 + d - 1;
}
return y;
}
function missing(x) {
if(!(x < 32 || x >= 127 && x < 160) && !(x in C)) {
printf("U+%x %c\n", x, x)
}
}
FILENAME ~ /\.bdf$/ && $1 == "ENCODING" {
C[$2] = 1;
}
FILENAME ~ /\.(512|256)$/ && match($0, "U\\+([0-9A-Fa-f]+)", A) {
missing(hex(A[1]))
}