Fri 13 Apr 2007 07:14:53 AM UTC, comment #1:
I can't reproduce this. The code below returns
FT_New_Memory_Face returns 0
FT_Set_Char_Size returns 0
face->glyph.bitmap.rows == 17
face->glyph.bitmap.width == 15
as expected.
I've used the current CVS of FreeType; valgrind
doesn't report any problem either.
------------------------------------------------------
#include <stdio.h>
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
#define FONT_NAME "arial.ttf" // version 3.00
#define FONT_SIZE 367112
int
main (void)
{
unsigned char translate[FONT_SIZE];
FILE *f;
FT_UInt ttt;
FT_Library library;
FT_Error error = 0;
FT_Face face;
FT_Glyph glyph;
f = fopen(FONT_NAME, "r");
fread(translate, FONT_SIZE, 1, f);
FT_Init_FreeType(&library);
error = FT_New_Memory_Face(library, FT_Byte*)translate,
FONT_SIZE, 0, &face);
printf("FT_New_Memory_Face returns %d\n", error);
error = FT_Set_Char_Size(face, 24 << 6, 24 << 6, 72, 72);
printf("FT_Set_Char_Size returns %d\n", error);
ttt = FT_Get_Char_Index(face, 'C');
error = FT_Load_Glyph(face, ttt, FT_LOAD_RENDER);
FT_Get_Glyph(face->glyph, &glyph);
printf("face->glyph.bitmap.rows == %d\n",
face->glyph->bitmap.rows);
printf("face->glyph.bitmap.width == %d\n",
face->glyph->bitmap.width);
return 0;
}
|