summaryrefslogtreecommitdiff
path: root/fonts/utilities/afmtopl/wolczko/mk-con
diff options
context:
space:
mode:
Diffstat (limited to 'fonts/utilities/afmtopl/wolczko/mk-con')
-rw-r--r--fonts/utilities/afmtopl/wolczko/mk-con91
1 files changed, 91 insertions, 0 deletions
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