#!/usr/local/bin/nawk -f # # Convert TeX encoding from otftotfm to groff format # BEGIN { FS = "\n" } /^[[:space:]]*%/ { next } /^.*\[[[:space:]]*$/ { next } /\/[^\/[:space:]]+/ { tmp = $0 while (1) { if (! (p = match(tmp, /\/[^\/[:space:]]+/))) break c = substr(tmp, p + 1) sub(/([[:space:]]+|\/).*$/, "", c) char[n++] = c tmp = substr(tmp, p + length(c) + 1) } } function quit() { system("rm -f " tmpfile) exit } END { if (! n) { print "No characters found" exit } for (i = 0; i < n; i++) { if (char[i] != ".notdef") printf "%s %d\n", char[i], i } } .