Wed 04 Mar 2015 07:58:23 AM UTC, original submission:
It seems if FT_Face reads font data from stream, the crash happens.
I've tried to use like this :
FT_Library ftlibrary;
FT_Init_FreeType(&ftlibrary);
FT_Open_Args args;
args.flags = FT_OPEN_PATHNAME;
args.pathname = (FT_String*)"/system/fonts/DroidSans.ttf";
DEBUG("Opening face: %s", args.pathname);
FT_Face face;
if (FT_Open_Face(pFTLibrary, &args, 0, &face))
return 0;
DEBUG("Opening face: %s, done. family_name = %s", args.pathname, face->family_name);
FT_ULong size;
DEBUG("Loading whole font..");
FT_Load_Sfnt_Table(face, 0, 0, NULL, &size);
DEBUG("Loading whole font..done. size = %lu", size);
and I got debug messages:
Opening face: /system/fonts/DroidSans.ttf
Opening face: /system/fonts/DroidSans.ttf, done. family_name = Roboto
Loading whole font..
--------- beginning of crash
Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 2948 (com.testfreetype)
The same crash happens when I open face with customized FT_Stream and read&close functions of my stream.
I'm using NDK-r10 and target android platform is API21, target arch is x86_x64.
I run following configs:
./configure --prefix=/home/s/fttt/ --host=x86_64-linux-android --without-zlib --with-harfbuzz=no --with-png=no
thanks a lot :)
|