static FT_Face testfreetype(const char * text, int len)
{
FT_Error error=FT_Init_FreeType(&ft);
if(error)
{
printf("error");
return NULL;
}
error =FT_New_Face(ft, "//字体文件", 0, &face);
if (error==FT_Err_Unknown_File_Format) {
printf("error");
return NULL;
}else if(error)
{
printf("error");
return NULL;
}
error = FT_Set_Pixel_Sizes(face, 0, 300);
if (error) {
printf("error");
return NULL;
}
FT_UInt uiGlyphindex=FT_Get_Char_Index(face,60);
if (uiGlyphindex==0) {
return NULL;
}
FT_Load_Glyph(face, uiGlyphindex, FT_LOAD_DEFAULT);
FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL);
return face;
}