# For you hacking pleasure ! # # Copyright (C) 1991 by Frank Ridderbusch # (Feel free to distribute) # # AWK script, to generate a batch file to be executed by Gulam. # This script was inspired by a similar script, which Michal # Jaegermann included in his port of GNU-AWK to the ST. This script # depends on the fact, that the DVI-drivers, which I'm using, produce # a file called 'missing.fnt', which contains a line for every font, # which couldn't be opened. A sample entry looks as follows: # # res101.scr cmtt10 magstep0 # | | | # | | +----> magnification # | +------------> font name # +---------------------> output device # res101.scr => Screen Previewer # res180.nel => NEC P6 180 dpi # res300.slm => Atari Laser Printer # res360.neh => NEC P6 360 dpi # # The resulting PK fonts go into the following directory structure: # # f:\tex\prtfonts\res101.scr\mag____1.000 # \mag____1.095 # ..... # f:\tex\prtfonts\res180.nel\mag____1.000 # \mag____1.095 # ..... # ......... # BEGIN { fontbase = "f:\\tex\\prtfonts\\" tfmdir = "f:\\tex\\texinput\\tfm" pkfonts["res101.scr"] = fontbase "res101.scr" "\\mag____" pkfonts["res180.nel"] = fontbase "res180.nel" "\\mag____" pkfonts["res300.slm"] = fontbase "res300.slm" "\\mag____" pkfonts["res360.neh"] = fontbase "res360.neh" "\\mag____" mode["res101.scr"] = "stscreen" mode["res180.nel"] = "psix_low" mode["res300.slm"] = "stlaser" mode["res360.neh"] = "psix_high" magnification["magstep0"] = "1.000" magnification["magstep1"] = "1.200" magnification["magstep2"] = "1.440" magnification["magstep3"] = "1.728" magnification["magstep4"] = "2.074" magnification["magstep5"] = "2.488" print "#" print "# gulam script to generate pk-fonts created by gawk" print "# it assumes that subdirectory tfm already exists" print "#" print "alias virmf h:\\tex\\virmf.ttp" print "alias gftopk h:\\tex\\gftopk.ttp" print "#" } { printf "virmf '&plain \\mode:=%s;\\mag:=%s;input %s'\n", mode[$1], $3, $2 if ( $3 ~ /magstep/ ) mag = magnification[$3] else mag = $3 match ( $1, /[0-9]+/ ) res = int (( substr ( $1, RSTART, RLENGTH ) * mag) + 0.5) printf "if { -e %s%s } == 0\n\tmkdir %s%s\nendif\n", \ pkfonts[$1], mag, pkfonts[$1], mag printf "gftopk .\\%s.%sgf %s%s\\%s.pk\n", $2, res, pkfonts[$1], mag, $2 printf "if { -e %s\\%s.tfm } == 0\n\tmv %s.tfm %s\nef\n\trm %s.tfm\nendif\n", \ tfmdir, $2, $2, tfmdir, $2 printf "rm %s.log %s.%s\n#\n", $2, $2, res }