") print_line(" Last update: " Current_Date_and_Time "") print_line("
") } function end_html() { print_line(" ") print_line("") close(Outfile) } function initialize() { "date" | getline Current_Date_and_Time close("date") if (USER == "") { USER = shell_command("whoami") if (USER == "") { if ("USER" in ENVIRON) UserName = ENVIRON["USER"] else if ("LOGNAME" in ENVIRON) UserName = ENVIRON["LOGNAME"] else UserName = "unknown" } else UserName = USER } else UserName = USER if (HOST == "") HostName = shell_command_with_default("hostname", \ ((("HOST" in ENVIRON) && (ENVIRON["HOST"] != "") ? ENVIRON["HOST"] : "unknown"))) else HostName = HOST # [10-Feb-1999] at the author's site, we prefer mail addresses to # be user@math.utah.edu, instead of # user@workstation.math.utah.edu, so that they are tied, not to a # specific machine, but rather, to a longer-lived domain of # machines. However, allow the invoker to override this with a # command-line option "-v MAILHOST = someotherhost". # # Sadly, there is no portable way to determine the mailhost name: # UNIX systems that run BIND (most probably do) should have an # entry in /etc/resolv.conf that is a domain name, but that might # not work as a mailhost name at a few sites. if (MAILHOST == "") MAILHOST = shell_command_with_default("awk '/^[ \t]*(domain|search)[ \t]/ { print $2 }' /etc/resolv.conf", \ HostName) } function less(a,b) { # We want the font lists to be ordered independent of lettercase: return (tolower(a) < tolower(b)) } function partition(array,left,right, i,j,swap,v) { i = left - 1 j = right v = array[right] for (;;) { while (less(array[++i],v)) ; while (less(v,array[--j])) { if (j == left) break } if (i >= j) break swap = array[i] array[i] = array[j] array[j] = swap } swap = array[i] array[i] = array[right] array[right] = swap return (i) } function print_directory( k,letter,vendor_count) { vendor_count = 0 for (file in Vendors_by_Filename) vendor_count++ Outfile = "fonts-to-vendors.html" begin_html("Font names by vendor") print_upindex() print_line("") print_line(" It is sometimes useful to map a font name to a font vendor.") print_line(" Here is a directory of such mappings for " Font_Count " fonts from " vendor_count " vendors.") print_line(" Select a section according to the first character of the font name,") print_line(" ignoring letter case:") print_line("
") print_line("") for (k = 1; k <= 36; ++k) { letter = substr("0123456789abcdefghijklmnopqrstuvwxyz",k,1) if (letter in Initials_Used) print_line(" " \ letter "" ((k < 36) ? " |" : "")) } print_line("
") } function print_entries( last_initial,k,key,n,next_initial,parts,sorted_fontlist) { n = 0 for (key in Fontlist) sorted_fontlist[++n] = Fontlist[key] Font_Count = n # global variable for use in print_directory() quicksort(sorted_fontlist,1,n) last_initial = "" for (k = 1; k <= n; ++k) { next_initial = tolower(substr(sorted_fontlist[k],1,1)) if (last_initial != next_initial) { if (last_initial != "") { print_line(" ") print_uplink() end_html() } Initials_Used[next_initial] = 1 Outfile = "fonts-to-vendors-" next_initial ".html" begin_html("Fonts " toupper(next_initial) "... by vendor") print_uplink() print_vendor_directory(next_initial) print_line("| " ((last_initial != next_initial) ? \ ("" parts[1] "") : parts[1]) \ " | " parts[2] " |
|---|
") print_line(" The software used to prepare this font index is freely available:") print_line("
") print_line("") print_line(" The html-ncheck program used in the Makefile") print_line(" for HTML validation is available in the sp-x.y.z binary") print_line(" distributions at") print_line(" ") print_line(" http://www.math.utah.edu/pub/sgml/.") print_line(" ") print_line("
") print_line("") print_line(" Preparation and validation of this index takes only about 45 sec") print_line(" wall clock time on the author's Sun UltraSPARC 170 workstation.") print_line(" An automated nightly make run ensures that it is kept up-to-date") print_line(" if other files in this directory are updated.") print_line("
") } function print_upindex() { print_line("") print_line(" ") print_line(" Up to notes on fonts") print_line(" ") print_line("
") } function print_uplink() { print_line("") print_line(" ") print_line(" Up to index of font names by vendor") print_line(" ") print_line("
") } function print_vendor_directory(this_initial, file,filenames_by_vendor, \ k,key,n,parts,sorted_vendors,vendors, \ vendors_used_in_this_section) { # First build vendors_used_in_this_section[], indexed by vendor if (this_initial == "") # fast case { # this_initial is an empty string, so all vendors are wanted. # We can compute that list faster than by scanning the entire # Fontlist and splitting it into vendor names. for (file in Vendors_by_Filename) vendors_used_in_this_section[Vendors_by_Filename[file]] = 1 } else # slow case { # this_initial is a single character, so we have to examine # the entire Fontlist, split out the vendors used in this # section, and add them to vendors_used_in_this_section[] for (key in Fontlist) { if (tolower(substr(Fontlist[key],1,1)) == this_initial) { split(Fontlist[key],parts,SUBSEP) n = split(parts[2],vendors,", ") for (k = 1; k <= n; ++k) vendors_used_in_this_section[vendors[k]] = 1 } } } # Next build sorted_vendors[], an (still unsorted) list of # vendors indexed by an integer 1, 2, ..., n n = 0 for (file in Vendors_by_Filename) { if (Vendors_by_Filename[file] in vendors_used_in_this_section) { sorted_vendors[++n] = Vendors_by_Filename[file] filenames_by_vendor[Vendors_by_Filename[file]] = file } } quicksort(sorted_vendors,1,n) print_line("