char c;
int i, j;
char *sp, *sp2;
- wchar_t *wsp, *wsp2;
+ wchar_t *wsp, *wsp2, wc;
filepos fpos, fpos2, *fposp;
int flags = 0;
sprintf(error, "font has an invalid header");
flags = FILEPOS;
break;
+ case err_sfntbadglyph:
+ fpos = *va_arg(ap, filepos *);
+ wc = va_arg(ap, wchar_t);
+ sprintf(error,
+ "warning: character U+%04X references an non-existent glyph",
+ wc);
+ flags = FILEPOS;
+ break;
case err_whatever:
sp = va_arg(ap, char *);
vsprintf(error, sp, ap);
err_sfntnounicmap, /* sfnt has no UCS-2 cmap */
err_sfnttablevers, /* sfnt table version unknown */
err_sfntbadhdr, /* sfnt has bad header */
+ err_sfntbadglyph, /* sfnt cmap references bad glyph */
err_whatever /* random error of another type */
};
for (k = startCode[j]; k <= endCode[j]; k++) {
idx = (k + idDelta[j]) & 0xffff;
if (idx != 0) {
- if (idx > sf->nglyphs) goto bad;
+ if (idx > sf->nglyphs) {
+ error(err_sfntbadglyph, &sf->pos,
+ (wchar_t)k);
+ continue;
+ }
fi->bmp[k] = sfnt_indextoglyph(sf, idx);
}
}
} else {
unsigned startidx = idRangeOffset[j]/2 - segcount + j;
for (k = startCode[j]; k <= endCode[j]; k++) {
- if (startidx + k - startCode[j] >= nglyphindex)
- goto bad;
+ if (startidx + k - startCode[j] >=
+ nglyphindex) {
+ error(err_sfntbadglyph, &sf->pos,
+ (wchar_t)k);
+ continue;
+ }
idx = glyphIndexArray[startidx + k - startCode[j]];
if (idx != 0) {
idx = (idx + idDelta[j]) & 0xffff;
- if (idx > sf->nglyphs) goto bad;
+ if (idx > sf->nglyphs) {
+ error(err_sfntbadglyph, &sf->pos,
+ (wchar_t)k);
+ continue;
+ }
fi->bmp[k] = sfnt_indextoglyph(sf, idx);
}
}
\cfg{info-dir-entry}{Florbles}{test.but}{Subsection of Halibut test
document}{sub-sub}
\cfg{info-section-underline}{2}{~}
+\cfg{info-charset}{utf-8}
\cfg{man-headnumbers}{true}
\cfg{contents}{Contents(edited)}