X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/halibut/blobdiff_plain/36e8f0f56f85d20f939091301d65c7f4f6889998..944c4044572da20ed1fb9bc01085221856b53c1f:/in_afm.c diff --git a/in_afm.c b/in_afm.c index 69cd1e3..559bb5d 100644 --- 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"); @@ -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)