3
# translate a ghostscript config to a graphviz ps_font_equiv.h table
9
"sans-serif" => "sans-Serif",
10
"typewriter" => "monospace"
13
# weight normal or bold
14
# style normal or italic
16
if ($#ARGV + 1 != 2) { die "usage: cf2psfe.pl fontmap.cfg ps_font_equiv.txt";}
18
open(CONFIG,"< $ARGV[0]");
21
if (/\[(.+)\]/) { $fontname = $1;}
22
if (/features\s*=\s*(.+)/) { $features{$fontname} = $1;}
25
open(SOURCE,"< $ARGV[1]");
27
my ($fontfam, $weight, $style);
30
while (($key,$value) = each(%map)) {
31
$fontfam = $value if ($f =~ /$key/);
33
$style = ($f =~ /italic/? q("italic") : 0);
34
$weight= ($f =~ /bold/? q("bold") : 0);
35
if ($fontfam eq "") {warn "don't know about $1\n"; $fontfam = "fantasy";}
36
$_ =~ s/},$/,\t\"$fontfam\",\t$weight,\t$style},/;