freetype
[Top][All Lists]
Advanced

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

[Freetype] Newbie question


From: Hung Kei Yuen Kelvin (Research Student)
Subject: [Freetype] Newbie question
Date: Thu, 3 May 2001 00:53:35 +0800 (HKT)

Hi,
    I'm a research student and my project is related to Chinese
computing. In one part of the project, I need to read the truetype font
and I choose freetype 2.0.1 to help me. 
    I follow the tutorial to try out the library but not success ... Below
is the code I used for testing ... nearly same as the example in tutorial
1,
After the function FT_Load_Glyph( ...) was executed, an error code 1090
was generated. What does it means?
 
Thanks a lot
Kelvin
 
 
-----------------------------------------------
#include <freetype/freetype.h>
#include <iostream>
 
FT_Library  library;
 
void main () {
 
 FT_Library  library;   /* handle to library     */
 FT_Face     face;      /* handle to face object */
 
 
   int error = FT_Init_FreeType( &library );
 if ( error ) {
    cout << "Error!" << endl;
 
   }
 
   error = FT_New_Face( library,
                         "C:\\WINDOWS\\FONTS\\ARIAL.TTF",
                         0,
                         &face );
    if ( error == FT_Err_Unknown_File_Format )
    {
      cout << "the font file could be opened and read, but it appears " <<
              "that its font format is unsupported" << endl;
    }
    else if ( error )
    {
      cout << "another error code means that the font file could not " <<
        "be opened or read, or that it is broken" << endl;
    }
    
 FT_UInt  glyph_index;
  glyph_index = FT_Get_Char_Index(face, 65);
  cout << "glyph index " << glyph_index << endl;
 
   // load glyph image into the slot (erase previous one) 
   error = FT_Load_Glyph( face, glyph_index, FT_LOAD_DEFAULT );
   if ( error ) {
    cout << "Error! " << error << endl;
   }
}
 





reply via email to

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