Remove a bunch of unused variables spotted by Ubuntu 12.04's gcc.
[sgt/halibut] / in_afm.c
index d3d5ecb..559bb5d 100644 (file)
--- a/in_afm.c
+++ b/in_afm.c
@@ -56,7 +56,7 @@ void read_afm_file(input *in) {
     fi = snew(font_info);
     fi->name = NULL;
     fi->widths = newtree234(width_cmp);
-    fi->fp = NULL;
+    fi->fontfile = NULL;
     fi->kerns = newtree234(kern_cmp);
     fi->ligs = newtree234(lig_cmp);
     fi->fontbbox[0] = fi->fontbbox[1] = fi->fontbbox[2] = fi->fontbbox[3] = 0;
@@ -181,6 +181,28 @@ void read_afm_file(input *in) {
                            goto giveup;
                        }
                        g = glyph_intern(val);
+                   } else if (strcmp(key, "L") == 0) {
+                       glyph succ, lig;
+                       if (!(val = strtok(NULL, " \t")) ||
+                           !strcmp(val, ";")) {
+                           error(err_afmval, &in->pos, key, 1);
+                           goto giveup;
+                       }
+                       succ = glyph_intern(val);
+                       if (!(val = strtok(NULL, " \t")) ||
+                           !strcmp(val, ";")) {
+                           error(err_afmval, &in->pos, key, 1);
+                           goto giveup;
+                       }
+                       lig = glyph_intern(val);
+                       if (g != NOGLYPH && succ != NOGLYPH &&
+                           lig != NOGLYPH) {
+                           ligature *l = snew(ligature);
+                           l->left = g;
+                           l->right = succ;
+                           l->lig = lig;
+                           add234(fi->ligs, l);
+                       }
                    }
                    do {
                        key = strtok(NULL, " \t");
@@ -194,7 +216,7 @@ void read_afm_file(input *in) {
                    w->glyph = g;
                    w->width = width;
                    add234(fi->widths, w);
-                   ucs = ps_glyph_to_unicode(glyph_extern(g));
+                   ucs = ps_glyph_to_unicode(g);
                    if (ucs < 0xFFFF)
                        fi->bmp[ucs] = g;
                }
@@ -207,14 +229,12 @@ void read_afm_file(input *in) {
        } else if (strcmp(key, "StartKernPairs") == 0 ||
                   strcmp(key, "StartKernPairs0") == 0) {
            int nkerns, i;
-           kern_pair *kerns;
            if (!(val = strtok(NULL, " \t"))) {
                error(err_afmval, &in->pos, key, 1);
                goto giveup;
            }
            nkerns = atoi(val);
            sfree(line);
-           kerns = snewn(nkerns, kern_pair);
            for (i = 0; i < nkerns; i++) {
                line = afm_read_line(in);
                if (line == NULL)