|
From: | Louis Desjardins |
Subject: | Re: [ft-devel] FT_New_Memory_Face crashes |
Date: | Wed, 7 Sep 2011 20:52:50 -0700 |
Thanks Chris. The freetype source I used for the linux example is the same, I simply had to change the way I logged outputs, and had to generate a different Makefile.
The main difference between the standalone and Android app is the way that the input TTF file is read in, however I verified that my TTF file is read in correctly in Android, by writing out the buffer that I read in to a new file, and then comparing the original with this - they are identical. Note that I am also on a Windows machine so I have built my standalone app using Cygwin. > From: address@hidden > Date: Wed, 7 Sep 2011 21:07:08 -0400 > Subject: Re: [ft-devel] FT_New_Memory_Face crashes > To: address@hidden > CC: address@hidden > > On the contrary, now you have a baseline / comparison case and a > useful test point. > > Have you modified your Android example such that it more closely > matches the Linux app example? I'm wondering how different they might > be as those differences may point to different behavior. > > Are you using the same source code to generate the freetype libraries > for instance or at least the same version of the library? > > Chris > > > > On Wed, Sep 7, 2011 at 8:49 PM, Louis Desjardins > <address@hidden> wrote: > > I have managed to create a standalone linux app that builds using the same > > freetype library files and should reproduce the error, however in this case, > > FT_New_Memory_Face succeeds, but in the Android it fails (despite my checks > > that the input file integrity and size is maintained.) So unfortunately my > > standalone app will not be useful afterall. > > > > ________________________________ > > From: address@hidden > > To: address@hidden > > CC: address@hidden > > Subject: RE: [ft-devel] FT_New_Memory_Face crashes > > Date: Wed, 7 Sep 2011 12:02:19 -0700 > > > > Thanks for your reply. I am still trying to get a successful Makefile going > > so I have not been able to test this standalone app yet, however in case it > > helps, I have attached the code that should provide the crash in the > > meanwhile. The main program is in Standalone.cpp and crashes within > > FT_New_Memory_Face. I have also provided a sample ttf and the freetype > > library that I am using with Android (though I have added various 'printfs' > > for debugging). > > > > Thank-you > > ________________________________ > > From: address@hidden > > Date: Wed, 7 Sep 2011 13:06:36 -0400 > > Subject: Re: [ft-devel] FT_New_Memory_Face crashes > > To: address@hidden > > CC: address@hidden > > > > It should be possible to create a self standing example that will compile on > > a Linux box. It might not have to be fully equivalent as long as it fails in > > the same way and aids in debugging > > Chris > > > > On Sep 7, 2011, at 12:23 PM, Louis Desjardins <address@hidden> > > wrote: > > > > I apologize, I made a copy\paste error when providing the sample, I have > > corrected it below as they are in fact the same buffers in the code I'm > > running. > > > > Unfortunately I cannot provide a complete standalone sample as I am working > > in the Android NDK. > > LD > > ________________________________ > > From: address@hidden > > To: address@hidden > > Date: Wed, 7 Sep 2011 03:47:26 -0400 > > Subject: RE: [ft-devel] FT_New_Memory_Face crashes > > > > In the code sample, FT_NEW_MEMORY_Face() is passed a different buffer from > > the one created by LoadFile(). > > > > > > > > ________________________________ > > > > From: address@hidden > > [mailto:address@hidden On Behalf Of > > Louis Desjardins > > Sent: 07 September 2011 00:13 > > To: address@hidden > > Subject: [ft-devel] FT_New_Memory_Face crashes > > > > > > > > I have loaded an "arial.ttf" file (taken from my /Windows/Fonts folder) into > > memory, however passing this into FT_New_Memory_Face crashes (I have also > > tried other ttf files, and this function still crashes). Any clues as to > > what I might be doing wrong? Note that I am using Freetype with the Android > > NDK, so it is difficult to debug, however I find that eventually, the crash > > occurs within: > > > > FT_New_Memory_Face -> FT_Open_Face -> FT_Stream_ReadLong -> crashes at: > > > > if ( p ) > > > > { > > > > result = FT_NEXT_LONG( p ); //crashes here, in file ftstream.c, > > method FT_Stream_ReadLong > > > > } > > > > And below is my code: > > > > unsigned char *fontBuffer = LoadFile("arial.ttf"); > > > > zip_uint64_t fSize = GetFileSize("arial.ttf"); // I checked this, and it > > returns the correct size > > > > FT_Library library; > > > > FT_Face face; > > > > int error = FT_Init_FreeType( &library ); // I checked this, this step > > succeeds > > > > if( error != 0 ) > > > > printf("FT_Init_FreeType failed"); > > > > > > > > error = FT_New_Memory_Face( library, > > > > (FT_Byte*)fontBuffer, > > > > fSize, > > > > 0, > > > > &face ); > > > > _______________________________________________ > > Freetype-devel mailing list > > address@hidden > > https://lists.nongnu.org/mailman/listinfo/freetype-devel > > > > _______________________________________________ > > Freetype-devel mailing list > > address@hidden > > https://lists.nongnu.org/mailman/listinfo/freetype-devel > > > > |
[Prev in Thread] | Current Thread | [Next in Thread] |