summaryrefslogtreecommitdiff
path: root/fonts/utilities/afmtopl/wolczko
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /fonts/utilities/afmtopl/wolczko
Initial commit
Diffstat (limited to 'fonts/utilities/afmtopl/wolczko')
-rw-r--r--fonts/utilities/afmtopl/wolczko/aftopl203
-rw-r--r--fonts/utilities/afmtopl/wolczko/edsymbols4
-rw-r--r--fonts/utilities/afmtopl/wolczko/fontdimens24
-rw-r--r--fonts/utilities/afmtopl/wolczko/mk-con91
-rw-r--r--fonts/utilities/afmtopl/wolczko/mk-obl100
-rw-r--r--fonts/utilities/afmtopl/wolczko/mk-red43
-rw-r--r--fonts/utilities/afmtopl/wolczko/mk-sc99
-rw-r--r--fonts/utilities/afmtopl/wolczko/readme14
8 files changed, 578 insertions, 0 deletions
diff --git a/fonts/utilities/afmtopl/wolczko/aftopl b/fonts/utilities/afmtopl/wolczko/aftopl
new file mode 100644
index 0000000000..4c628c6b1e
--- /dev/null
+++ b/fonts/utilities/afmtopl/wolczko/aftopl
@@ -0,0 +1,203 @@
+#! /bin/awk -f
+# Translate Adobe afm file to TeX pl file.
+# usage: aftopl afm-file-name >pl-file-name
+# Greg Lee, lee@uhccux.uhcc.hawaii.edu, 12/87
+# extensively modified by Mario Wolczko, mario@uk.ac.man.cs.ux, 4/88
+BEGIN {
+ tan[ 0]=0; tan[ 1]=.017454; tan[ 2]=.034919; tan[ 3]=.052406;
+ tan[ 4]=.069926; tan[ 5]=.087487; tan[ 6]=.105102; tan[ 7]=.122783;
+ tan[ 8]=.140539; tan[ 9]=.158383; tan[10]=.176325; tan[11]=.194379;
+ tan[12]=.212555; tan[13]=.230867; tan[14]=.249325; tan[15]=.267948;
+ tan[16]=.286744; tan[17]=.305728; tan[18]=.324918; tan[19]=.344326;
+ tan[20]=.363969; tan[21]=.383863; tan[22]=.404025; tan[23]=.424473;
+ tan[24]=.445227; tan[25]=.466306; tan[26]=.487731; tan[27]=.509524;
+ tan[28]=.531707; tan[29]=.554308; tan[30]=.577349; tan[31]=.600859;
+ tan[32]=.624867; tan[33]=.649406; tan[34]=.674507; tan[35]=.700205;
+ tan[36]=.726540; tan[37]=.753552; tan[38]=.781283; tan[39]=.809782;
+ tan[40]=.839099; tan[41]=.869284; tan[42]=.900401; tan[43]=.932512;
+ tan[44]=.965686; tan[45]=.999998; tan[46]=1.035526; tan[47]=1.072368;
+ tan[48]=1.110610; tan[49]=1.150364; tan[50]=1.191750; tan[51]=1.234894;
+ tan[52]=1.279939; tan[53]=1.327040; tan[54]=1.376380; tan[55]=1.428144;
+ tan[56]=1.482555; tan[57]=1.539859; tan[58]=1.600330; tan[59]=1.664273;
+ tan[60]=1.732044; tan[61]=1.804039; tan[62]=1.880723; tan[63]=1.962604;
+ tan[64]=2.050297; tan[65]=2.144501; tan[66]=2.246033; tan[67]=2.355844;
+ tan[68]=2.475075; tan[69]=2.605080; tan[70]=2.747468; tan[71]=2.904201;
+ tan[72]=3.077671; tan[73]=3.270835; tan[74]=3.487391; tan[75]=3.732019;
+ tan[76]=4.010759; tan[77]=4.331452; tan[78]=4.704597; tan[79]=5.144493;
+ tan[80]=5.671250; tan[81]=6.313687; tan[82]=7.115264; tan[83]=8.144301;
+ tan[84]=9.514216; tan[85]=11.42988; tan[86]=14.30034; tan[87]=19.08075;
+ tan[88]=28.63500; tan[89]=57.28469;
+
+ # extra kerning and ligature info is added to these chars
+ extra= " exclam question hyphen endash quoteleft quoteright f ";
+ # same, except for \tt fonts
+ extraf= " exclam question ";
+
+ LIG = " (LIG O %o O %o)\n"
+
+ print "(DESIGNSIZE R 10.0)"
+ print "(COMMENT DESIGNSIZE IS IN POINTS)"
+ print "(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)"
+ }
+
+/^FontName/ {
+ smallcaps = index($2, "SmallCaps");
+}
+
+/^FamilyName/ {
+ family = substr($0, length("FamilyName "));
+# if (family ~ /Symbol/) {
+# print "Can't deal with Symbol fonts" >"/dev/tty";
+# exit 1;
+# }
+ if (family ~ /Dingbats/ || family ~ /Symbol/)
+ nonchar = 1;
+ print "(FAMILY " family ")";
+}
+
+/^EncodingScheme/ { print "(CODINGSCHEME " $2 ")"; }
+
+/^ItalicAngle/ {
+ angle = int($2 + .5); slant = 0;
+ if (angle < 0)
+ slant = tan[-angle];
+ else
+ slant = -tan[angle];
+}
+
+/^IsFixedPitch/ { fixed = $2; }
+
+/^XHeight/ { xheight = $2/1000; }
+
+/^C 32/ { if (fixed == "true")
+ space = $5/1000
+ else
+ space = ($5 * 1.1)/1000 # this is a frig...
+ print "(FONTDIMEN"
+ printf(" (SLANT R %1.6f)\n", slant)
+ printf(" (SPACE R %1.6f)\n", space)
+ if (fixed == "false") {
+ # ...and this...
+ printf(" (STRETCH R %1.6f)\n", space/2)
+ # ...and this...
+ printf(" (SHRINK R %1.6f)\n", space/3)
+ }
+ printf(" (XHEIGHT R %1.6f)\n", xheight)
+ # ... and this ...
+ print " (QUAD R 1.0)"
+ # ...and this
+ if (fixed == "true")
+ printf(" (EXTRASPACE R %1.6f)\n", space)
+ else
+ printf(" (EXTRASPACE R %1.6f)\n", space/3)
+ print " )"
+ }
+
+/WX/ && $2 >= 0 {
+
+ ch = $2;
+ w = $5;
+ h = $14;
+ d = -$12;
+ rp = $13 - w;
+ name[$8] = ch;
+ c = ch;
+
+ if (c < 48) printf("(CHARACTER O %o\n", c);
+ if (c >= 48 && c <= 57) printf("(CHARACTER C %c\n", c);
+ if (c > 57 && c < 65) printf("(CHARACTER O %o\n", c);
+ if (c >= 65 && c <= 90) printf("(CHARACTER C %c\n", c);
+ if (c > 90 && c < 97) printf("(CHARACTER O %o\n", c);
+ if (c >= 97 && c <= 122) printf("(CHARACTER C %c\n", c);
+ if (c > 122) printf("(CHARACTER O %o\n", c);
+
+ printf(" (CHARWD R %1.6f)\n", w/1000);
+
+ if (h > 0) printf(" (CHARHT R %1.6f)\n", h/1000);
+ if (d > 0) printf(" (CHARDP R %1.6f)\n", d/1000);
+ if (rp > 0) printf(" (CHARIC R %1.6f)\n", rp/1000);
+
+ print " )";
+}
+
+/^EndCharMetrics/ {
+ # all TeX fonts (except DingBats)
+ # map !` to upside-down! and ?` to upside-down?
+ if (nonchar) next;
+ printf("(LIGTABLE\n");
+}
+
+/^KPX/ {
+ if ($2=="quoteleft" && $3=="quoteleft") next; # these are ligatured,
+ if ($2=="quoteright" && $3=="quoteright") next;# not kerned.
+ if (ck != $2) {
+ if (ck != "") printf(" (STOP)\n");
+ c = name[$2];
+ printf(" (LABEL O %o)\n", c);
+ ck = $2;
+ if ((fixed == "false" && index(extra," "ck" ")) || (fixed == "true" && index(extraf," "ck" "))) {
+ if (ck == "exclam")
+ printf(LIG,name["quoteleft"], name["exclamdown"]);
+ else if (ck == "question")
+ printf(LIG,name["quoteleft"], name["questiondown"]);
+ else if (ck == "hyphen")
+ printf(LIG,name["hyphen"], name["endash"]);
+ else if (ck == "endash")
+ printf(LIG,name["hyphen"], name["emdash"]);
+ else if (ck == "quoteleft")
+ printf(LIG,name["quoteleft"], name["quotedblleft"]);
+ else if (ck == "quoteright")
+ printf(LIG,name["quoteright"], name["quotedblright"]);
+ else if (ck == "f") {
+ printf(" (LIG C i O %o)\n",name["fi"]);
+ printf(" (LIG C l O %o)\n",name["fl"]);
+ }
+ done[ck]=1;
+ }
+
+ }
+ cm = name[$3];
+ printf(" (KRN O %o R %1.6f)\n", cm, $4/1000)
+ }
+
+/^EndKernPairs/ {
+ printf(" (STOP)\n");
+}
+
+/^EndFontMetrics/ {
+ if (nonchar) next;
+
+ if (fixed=="true")
+ todo= substr(extraf, 2);
+ else
+ todo= substr(extra, 2);
+ while (todo) {
+ n = index(todo, " ");
+ ck = substr(todo, 1, n-1);
+ todo = substr(todo, n+1);
+ if (!done[ck]) {
+ printf(" (LABEL O %o)\n", name[ck]);
+ # this is replica of the code in KPX
+ if (ck == "exclam")
+ printf(LIG,name["quoteleft"], name["exclamdown"]);
+ else if (ck == "question")
+ printf(LIG,name["quoteleft"], name["questiondown"]);
+ else if (ck == "f") {
+ printf(" (LIG C i O %o)\n",name["fi"]);
+ printf(" (LIG C l O %o)\n",name["fl"]);
+ } else if (fixed == "false") {
+ if (ck == "hyphen")
+ printf(LIG,name["hyphen"], name["endash"]);
+ else if (ck == "endash")
+ printf(LIG,name["hyphen"], name["emdash"]);
+ else if (ck == "quoteleft")
+ printf(LIG,name["quoteleft"], name["quotedblleft"]);
+ else if (ck == "quoteright")
+ printf(LIG,name["quoteright"], name["quotedblright"]);
+ }
+ printf(" (STOP)\n");
+ }
+ }
+ printf(" )\n");
+}
+
diff --git a/fonts/utilities/afmtopl/wolczko/edsymbols b/fonts/utilities/afmtopl/wolczko/edsymbols
new file mode 100644
index 0000000000..96bb6efdb9
--- /dev/null
+++ b/fonts/utilities/afmtopl/wolczko/edsymbols
@@ -0,0 +1,4 @@
+/^(FONTDIMEN/,/^ )/d
+.-1r fontdimens
+w
+q
diff --git a/fonts/utilities/afmtopl/wolczko/fontdimens b/fonts/utilities/afmtopl/wolczko/fontdimens
new file mode 100644
index 0000000000..92d4a6f024
--- /dev/null
+++ b/fonts/utilities/afmtopl/wolczko/fontdimens
@@ -0,0 +1,24 @@
+(FONTDIMEN
+ (SLANT R 0.0)
+ (SPACE R 0.0)
+ (STRETCH R 0.0)
+ (SHRINK R 0.0)
+ (XHEIGHT R 0.500)
+ (QUAD R 1.0)
+ (EXTRASPACE R 0.0)
+ (PARAMETER D 8 R 0.677)
+ (PARAMETER D 9 R 0.394)
+ (PARAMETER D 10 R 0.444)
+ (PARAMETER D 11 R 0.686)
+ (PARAMETER D 12 R 0.345)
+ (PARAMETER D 13 R 0.413)
+ (PARAMETER D 14 R 0.363)
+ (PARAMETER D 15 R 0.289)
+ (PARAMETER D 16 R 0.150)
+ (PARAMETER D 17 R 0.247)
+ (PARAMETER D 18 R 0.386)
+ (PARAMETER D 19 R 0.050)
+ (PARAMETER D 20 R 2.390)
+ (PARAMETER D 21 R 1.010)
+ (PARAMETER D 22 R 0.250)
+ )
diff --git a/fonts/utilities/afmtopl/wolczko/mk-con b/fonts/utilities/afmtopl/wolczko/mk-con
new file mode 100644
index 0000000000..ffd92c5844
--- /dev/null
+++ b/fonts/utilities/afmtopl/wolczko/mk-con
@@ -0,0 +1,91 @@
+#! /bin/sh
+# Make a condensed version of an AFM file
+# usage: mk-con x-scaling afm-file-name >new-afm-file-name
+#
+# rounding is done with int(x+0.5) --- this is wrong for -ve values
+awk 'BEGIN {'scale=$1';
+ tan[ 0]=0; tan[ 1]=.017454; tan[ 2]=.034919; tan[ 3]=.052406;
+ tan[ 4]=.069926; tan[ 5]=.087487; tan[ 6]=.105102; tan[ 7]=.122783;
+ tan[ 8]=.140539; tan[ 9]=.158383; tan[10]=.176325; tan[11]=.194379;
+ tan[12]=.212555; tan[13]=.230867; tan[14]=.249325; tan[15]=.267948;
+ tan[16]=.286744; tan[17]=.305728; tan[18]=.324918; tan[19]=.344326;
+ tan[20]=.363969; tan[21]=.383863; tan[22]=.404025; tan[23]=.424473;
+ tan[24]=.445227; tan[25]=.466306; tan[26]=.487731; tan[27]=.509524;
+ tan[28]=.531707; tan[29]=.554308; tan[30]=.577349; tan[31]=.600859;
+ tan[32]=.624867; tan[33]=.649406; tan[34]=.674507; tan[35]=.700205;
+ tan[36]=.726540; tan[37]=.753552; tan[38]=.781283; tan[39]=.809782;
+ tan[40]=.839099; tan[41]=.869284; tan[42]=.900401; tan[43]=.932512;
+ tan[44]=.965686; tan[45]=.999998; tan[46]=1.035526; tan[47]=1.072368;
+ tan[48]=1.110610; tan[49]=1.150364; tan[50]=1.191750; tan[51]=1.234894;
+ tan[52]=1.279939; tan[53]=1.327040; tan[54]=1.376380; tan[55]=1.428144;
+ tan[56]=1.482555; tan[57]=1.539859; tan[58]=1.600330; tan[59]=1.664273;
+ tan[60]=1.732044; tan[61]=1.804039; tan[62]=1.880723; tan[63]=1.962604;
+ tan[64]=2.050297; tan[65]=2.144501; tan[66]=2.246033; tan[67]=2.355844;
+ tan[68]=2.475075; tan[69]=2.605080; tan[70]=2.747468; tan[71]=2.904201;
+ tan[72]=3.077671; tan[73]=3.270835; tan[74]=3.487391; tan[75]=3.732019;
+ tan[76]=4.010759; tan[77]=4.331452; tan[78]=4.704597; tan[79]=5.144493;
+ tan[80]=5.671250; tan[81]=6.313687; tan[82]=7.115264; tan[83]=8.144301;
+ tan[84]=9.514216; tan[85]=11.42988; tan[86]=14.30034; tan[87]=19.08075;
+ tan[88]=28.63500; tan[89]=57.28469; tan[90]=1e6;
+
+
+}
+
+/^FontName/ {
+ print $0 "-Condensed";
+ next;
+ }
+
+/^FullName/ {
+ print $0, "Condensed";
+ next;
+ }
+
+/^ItalicAngle/ {
+ if ($2 < 0) {
+ origangle = int($2 - 0.5);
+ abstanorig = tan[-origangle];
+ } else if ($2 > 0) {
+ origangle = int($2 + 0.5);
+ abstanorig = tan[origangle];
+ } else {
+ origangle = 0;
+ abstanorig = 0;
+ }
+ abstannew = scale * abstanorig;
+ newangle= 0;
+ while (tan[newangle] < abstannew)
+ ++newangle;
+ if (origangle < 0)
+ newangle = -newangle;
+ print "ItalicAngle " newangle ; next ;
+}
+
+/^UnderlinePosition/ {
+ $2 = int(scale*$2 + 0.5);
+ print $0; next;
+}
+
+/^FontBBox/ {
+ $2 = int(scale*$2 + 0.5);
+ $4 = int(scale*$4 + 0.5);
+ print $0; next;
+}
+
+
+/^C / {
+ llx = $11;
+ urx = $13;
+ w = $5;
+ $11 = int(scale*llx + 0.5);
+ $13 = int(scale*urx + 0.5);
+ $5 = int(scale*w + 0.5);
+ print $0; next;
+}
+
+/^KPX/ {
+ $4 = int($4*scale - 0.5)
+ print $0; next;
+}
+
+{print}' $2
diff --git a/fonts/utilities/afmtopl/wolczko/mk-obl b/fonts/utilities/afmtopl/wolczko/mk-obl
new file mode 100644
index 0000000000..56d7354223
--- /dev/null
+++ b/fonts/utilities/afmtopl/wolczko/mk-obl
@@ -0,0 +1,100 @@
+#! /bin/sh
+# Make an oblique version of an AFM file
+# usage: mk-obl newangle afm-file-name >new-afm-file-name
+#
+# newangle should be an integer, in degrees of anti-clockwise skew
+#
+# bugs: doesn't set these fields properly:
+# FontBBox
+# UnderlinePosition
+# KPX
+# the llx field of Character Metrics is unchanged.
+# the urx field is guesstimated
+#
+# rounding is done with int(x+0.5) --- this is wrong for -ve values
+awk 'BEGIN {'newangle=$1';
+ tan[ 0]=0; tan[ 1]=.017454; tan[ 2]=.034919; tan[ 3]=.052406;
+ tan[ 4]=.069926; tan[ 5]=.087487; tan[ 6]=.105102; tan[ 7]=.122783;
+ tan[ 8]=.140539; tan[ 9]=.158383; tan[10]=.176325; tan[11]=.194379;
+ tan[12]=.212555; tan[13]=.230867; tan[14]=.249325; tan[15]=.267948;
+ tan[16]=.286744; tan[17]=.305728; tan[18]=.324918; tan[19]=.344326;
+ tan[20]=.363969; tan[21]=.383863; tan[22]=.404025; tan[23]=.424473;
+ tan[24]=.445227; tan[25]=.466306; tan[26]=.487731; tan[27]=.509524;
+ tan[28]=.531707; tan[29]=.554308; tan[30]=.577349; tan[31]=.600859;
+ tan[32]=.624867; tan[33]=.649406; tan[34]=.674507; tan[35]=.700205;
+ tan[36]=.726540; tan[37]=.753552; tan[38]=.781283; tan[39]=.809782;
+ tan[40]=.839099; tan[41]=.869284; tan[42]=.900401; tan[43]=.932512;
+ tan[44]=.965686; tan[45]=.999998; tan[46]=1.035526; tan[47]=1.072368;
+ tan[48]=1.110610; tan[49]=1.150364; tan[50]=1.191750; tan[51]=1.234894;
+ tan[52]=1.279939; tan[53]=1.327040; tan[54]=1.376380; tan[55]=1.428144;
+ tan[56]=1.482555; tan[57]=1.539859; tan[58]=1.600330; tan[59]=1.664273;
+ tan[60]=1.732044; tan[61]=1.804039; tan[62]=1.880723; tan[63]=1.962604;
+ tan[64]=2.050297; tan[65]=2.144501; tan[66]=2.246033; tan[67]=2.355844;
+ tan[68]=2.475075; tan[69]=2.605080; tan[70]=2.747468; tan[71]=2.904201;
+ tan[72]=3.077671; tan[73]=3.270835; tan[74]=3.487391; tan[75]=3.732019;
+ tan[76]=4.010759; tan[77]=4.331452; tan[78]=4.704597; tan[79]=5.144493;
+ tan[80]=5.671250; tan[81]=6.313687; tan[82]=7.115264; tan[83]=8.144301;
+ tan[84]=9.514216; tan[85]=11.42988; tan[86]=14.30034; tan[87]=19.08075;
+ tan[88]=28.63500; tan[89]=57.28469;
+
+ if (newangle != int(newangle)) {
+ print "Angle must be an integer" >"/dev/tty";
+ exit 1;
+ }
+ if (newangle < 0) {
+ tannew = -tan[-newangle];
+ } else if (newangle > 0) {
+ tannew = tan[newangle];
+ } else {
+ tannew = 0;
+ }
+}
+
+/^FontName/ {
+ print $0 "-Oblique";
+ next;
+ }
+
+/^FullName/ {
+ print $0, "Oblique";
+ next;
+ }
+
+/^ItalicAngle/ {
+ if ($2 < 0) {
+ origangle = int($2 - 0.5);
+ tanorig = -tan[-origangle];
+ } else if ($2 > 0) {
+ origangle = int($2 + 0.5);
+ tanorig = tan[origangle];
+ } else {
+ origangle = 0;
+ tanorig = 0;
+ }
+ print "ItalicAngle " newangle ; next ;
+}
+
+/^C / {
+ llx = $11;
+ lly = $12;
+ urx = $13;
+ ury = $14;
+ h = ury - lly;
+ if (origangle < 0)
+ urx = urx + h * tanorig;
+ else if (origangle > 0)
+ llx = llx + h * tanorig;
+
+ # now llx and urx are correct for an upright font
+ # so apply the desired slope
+ if (newangle < 0)
+ urx = urx - h * tannew;
+ else if (newangle > 0)
+ llx = llx - h * tannew;
+
+ $11 = int(llx + 0.5);
+ $13 = int(urx + 0.5);
+ print $0; next;
+}
+
+{print}' $2
diff --git a/fonts/utilities/afmtopl/wolczko/mk-red b/fonts/utilities/afmtopl/wolczko/mk-red
new file mode 100644
index 0000000000..f6bfeb045f
--- /dev/null
+++ b/fonts/utilities/afmtopl/wolczko/mk-red
@@ -0,0 +1,43 @@
+#! /bin/sh
+# Make a reduced version of an AFM file
+# usage: mk-red scale afm-file-name >new-afm-file-name
+#
+# rounding is done with int(x+0.5) --- this is wrong for -ve values
+# doesn't deal with composites
+awk 'BEGIN {'scale=$1'; }
+
+/^FontName/ {
+ print $0 "-Reduced";
+ next;
+ }
+
+/^FullName/ {
+ print $0, "Reduced";
+ next;
+ }
+
+/^Underline/ || /^CapHeight/ || /^XHeight/ || /^Descender/ || /^Ascender/ {
+ print $1, int($2*scale + 0.5); next;
+}
+
+/^FontBBox/ {
+ print "FontBBox", int($2*scale+0.5), int($3*scale+0.5), int($4*scale+0.5), int($5*scale+0.5);
+ next;
+}
+
+
+/^C / {
+ $5 = int($5 * scale + 0.5);
+ $11 = int($11 * scale + 0.5);
+ $12 = int($12 * scale + 0.5);
+ $13 = int($13 * scale + 0.5);
+ $14 = int($14 * scale + 0.5);
+ print $0; next;
+}
+
+/^KPX/ {
+ $4 = int($4*scale - 0.5)
+ print $0; next;
+}
+
+{print}' $2
diff --git a/fonts/utilities/afmtopl/wolczko/mk-sc b/fonts/utilities/afmtopl/wolczko/mk-sc
new file mode 100644
index 0000000000..8b74dac630
--- /dev/null
+++ b/fonts/utilities/afmtopl/wolczko/mk-sc
@@ -0,0 +1,99 @@
+#! /bin/sh
+# Make a small-caps version of an AFM file
+# usage: mk-sc scale afm-file-name >new-afm-file-name
+#
+# scale is the ratio between the small and the large caps (e.g, 0.8)
+#
+# bugs: doesn't set these fields properly:
+# FontBBox
+# KPX data for lowercase is discarded
+#
+# rounding is done with int(x+0.5) --- this is wrong for -ve values
+
+trap "rm -f /tmp/afm$$0[012] /tmp/kern$$" 0
+
+csplit -f /tmp/afm$$ -s $2 /StartKernPairs/+1 /EndKernPairs/
+
+# chardata now in /tmp/afm$$00, kern in /tmp/afm$$01,
+# composites in /tmp/afm$$02
+
+# first do the kern data
+
+awk 'BEGIN {
+ lower= "abcdefghijklmnopqrstuvwxyz";
+ upper= "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ }
+
+ /^$/ { next; }
+
+ /^KPX/ && $2 ~ /^[A-Z]$/ && $3 ~ /^[A-Z]$/ {
+ # insert extra kerning data for lower case, based on upper case
+ lwr2=substr(lower, index(upper, $2), 1);
+ lwr3=substr(lower, index(upper, $3), 1);
+ print "KPX", lwr2, $3, $4
+ print "KPX", $2, lwr3, $4
+ print "KPX", lwr2, lwr3, $4
+ print $0
+ next;
+ }
+
+ /^KPX/ && ($2 ~ /^[a-z]$/ || $3 ~ /^[a-z]$/) {
+ # filter out kerning applied to lower-case
+ next;
+ }
+ { print ; }' /tmp/afm$$01 |
+sort +1 -3 |
+awk '
+ $2 != last { printf "\n" ; last= $2 }
+ { print }
+' >/tmp/kern$$
+
+# now process the chardata, and put the bits together
+awk 'BEGIN {'scale=$1';}
+
+ /^FontName/ {
+ print $0 "-SmallCaps";
+ next;
+ }
+
+ /^FullName/ {
+ print $0, "SmallCaps";
+ next;
+ }
+
+ /^CapHeight/ {
+ print "XHeight", int($2*scale + 0.5)
+ }
+
+ /^XHeight/ { next;}
+
+ /^Descender/ {
+ print "Descender 0";
+ next;
+ }
+
+ /^C / {
+ ch = $2;
+ if (ch >= 65 && ch <= 90) {
+ # it is an upper case letter, so save the (scaled) metric info
+ ch += 32;
+ w[ch] = int($5 * scale + 0.5);
+ llx[ch] = int($11 * scale + 0.5);
+ lly[ch] = int($12 * scale + 0.5);
+ urx[ch] = int($13 * scale + 0.5);
+ ury[ch] = int($14 * scale + 0.5);
+ print;
+ } else if (ch >= 97 && ch <= 122) {
+ # it is a lower case letter -- substitute the saved info
+ printf "C %d ; WX %d ; N %s ; B %d %d %d %d\n", \
+ ch, w[ch], $8, llx[ch], lly[ch], urx[ch], ury[ch], ";";
+ # do not want any ligature info
+ } else
+ print;
+
+ next;
+ }
+
+ {print}' /tmp/afm$$00 |
+cat - /tmp/kern$$ /tmp/afm$$02
+
diff --git a/fonts/utilities/afmtopl/wolczko/readme b/fonts/utilities/afmtopl/wolczko/readme
new file mode 100644
index 0000000000..9d2bc101ef
--- /dev/null
+++ b/fonts/utilities/afmtopl/wolczko/readme
@@ -0,0 +1,14 @@
+This directory contains several UNIX utilities for converting AFM to
+PL files.
+
+aftopl - an awk script that does basic AFM to PL conversion
+
+edsymbols & fontdimens - used by the Makefile in the TFM directory to
+ make a Symbol font
+
+mk-con - makes a condensed AFM font (ie, squeezed horizontally)
+mk-obl - makes an oblique AFM font
+mk-red - makes a reduced (in both x and y) AFM font
+mk-sc - makes a smallcaps AFM fonts
+
+getmetrics - alternative way of getting AFM data...asks the printer for it!