I encountered a problem with FT_Load_Glyph() using the "Helvetica Italic"
font (HELVI.PFB) that is included with OS/2. It fails for one glyph (499
starting from 0) with error code 0xa0 ("opcode syntax error"). The short
program below demonstrates it. I can easily provide the font, if needed.
Now, to find out if it's the font that is broken or FreeType just stumbles
over a quirk in a correct font, I tried to verify the problem with FontForge.
Perhaps I don't know how to properly handle that program, but it doesn't
expose any problems. (Just that FontForge seems to sort the glyphs
differently, 499 is not the one that I am trying to load, the ones around
it have different names, too).
Thanks in advance for any hints!
Peter.
---------------------- brokenHelvI_test.c -----------------------
// sample output for broken font:
// $ brokenHelvI_test.exe HELVI.PFB 499
// 1: error=0xa0 for HELVI.PFB glyph 499
// 2: error=0xa0 for HELVI.PFB glyph 499
#include "ft2build.h"
#include FT_FREETYPE_H
#include <stdio.h>
int main(int argc, char *argv[])
{
FT_Library ftlib;
FT_Init_FreeType(&ftlib);
FT_Face face;
FT_Error error = FT_New_Face(ftlib, argv[1], 0, &face);
if (error) {
printf("error=0x%x loading %s\n", error, argv[1]);
FT_Done_FreeType(ftlib);
return 1;
}
error = FT_Load_Glyph(face, atoi(argv[2]), FT_LOAD_NO_SCALE |
FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP | FT_LOAD_IGNORE_TRANSFORM);
if (error) {
printf("1: error=0x%x for %s glyph %d\n", error, argv[1], atoi(argv[2]));
}
error = FT_Load_Glyph(face, atoi(argv[2]), FT_LOAD_DEFAULT);
if (error) {
printf("2: error=0x%x for %s glyph %d\n", error, argv[1], atoi(argv[2]));
}
FT_Done_Face(face);
FT_Done_FreeType(ftlib);
return 0;
}
_______________________________________________
Freetype mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype