freetype
[Top][All Lists]
Advanced

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

[Freetype] Keep getting error after


From: Mendrak
Subject: [Freetype] Keep getting error after
Date: Tue, 30 Jul 2002 08:53:12 -0700

I have tried to follow the tutorial for using freetype.  I have a piece of code as follows:
Unfortunately I always get back an error 151 (0x97) which appears to be Invalid_CharMap_Format.

I've specified the Arial.ttf font as a test font (this is on a Windows 98 machine) and it seemed to load
the font, but upon trying to load the character I get that error for every character.  I'm sure I'm doing
something simple wrong, but I'm currently stuck.  Any ideas?

....
 int err = FT_Init_FreeType( &library );
 if ( err )
 {
  printf("Couldn't initialize FT library\n");
  exit(1);
 }

 err = FT_New_Face(library, argv[1], 0, &face);
 if ( err == FT_Err_Unknown_File_Format )
 {
  printf("Couldn't understand the format\n");
  exit(1);
 }
 else if (err)
 {
  printf("Unexpected error reading font\n");
  exit(1);
 }

 for (int i=64; i<72; i++)
 {
  int glyph_index = FT_Get_Char_Index(face, i);

  err = FT_Load_Char(face, glyph_index, FT_LOAD_RENDER);
  if (err)
  {
   printf("Unexpected error creating glyph: %d\n", err);
   exit(1);
  }
...


reply via email to

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