Support for getting ligature information from AFM files, which was the
authorben <ben@cda61777-01e9-0310-a592-d414129be87e>
Sun, 7 Jan 2007 00:15:52 +0000 (00:15 +0000)
committerben <ben@cda61777-01e9-0310-a592-d414129be87e>
Sun, 7 Jan 2007 00:15:52 +0000 (00:15 +0000)
whole point of the glyph renumbering.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7066 cda61777-01e9-0310-a592-d414129be87e

in_afm.c

index 69cd1e3..d0b2088 100644 (file)
--- a/in_afm.c
+++ b/in_afm.c
@@ -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");