freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] problem with new face.


From: Joe Freeze
Subject: [Devel] problem with new face.
Date: Fri, 10 May 2002 14:24:51 -0400

Hi, I'm having a problem with a new face i'm implementing. the face is very small, and it only contains once font, one glyph, the glyph being a square. This square is a default glyph, one that will be displayed if there is a problem displaying the correct font(the font file cannot be found....etc). Since I am not using a file when implementing this face, I am using FT_New_Memory_Face instead of FT_New_Face. you can see in the code here the parameters i am using.
 
//Make a default face.
        FT_Face face;
        char temp[21]; 
        strcpy(temp,"default_driver_class");
        rcode = FT_New_Memory_Face( library,
                                                        reinterpret_cast<const unsigned char *>(&temp[0]),
                                                        strlen(temp) + 150,//note, the + 150 is a temporary
                                                                                   //fix needed to pass certain
                                                                                   //freetype checks.
                                                         0,
                                                         &face);
 
As you can see I am passing in the strlen of my default_driver_class as the length of my file. I have to add 150 though because of some freetype checks. When open_face spins through the different drivers, it gets into CID_New_Parser
in cidparse.c. where this code is called
 
if ( ACCESS_Frame( 31 ) )
      goto Exit;
 
now, the length of my file will not be 31 or greater so it will assert on me. I had to add this check before ACCESS_Frame was called
 
if(stream->size < 31)
        return FT_Err_Unknown_File_Format;
 
Shouldn't this check be there anyway? Obviously the font is not CID if it does not pass its size test. Can anyone help me in this matter? much appreciated.
 
    -Joe Freeze
 
 
 
 
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]