#include #include FT_FREETYPE_H int main() { FT_Library library; FT_Face face; FT_GlyphSlot slot; FT_Error error; FT_UInt glyph_index; error = FT_Init_FreeType(&library); if (error) { printf("Error: FT_Init_FreeType(): error code %d\n", error); exit(1); } error = FT_New_Face(library,"Vera.ttf", 0, &face); if (error) { printf("Error: FT_New_Face(): error code %d\n", error); exit(1); } error = FT_Set_Pixel_Sizes(face, 0, 16); if (error) { printf("Error: FT_Set_Pixel_Sizes(): error code %d\n", error); exit(1); } glyph_index = FT_Get_Char_Index(face, ' '); printf("glyph_index = %d\n", glyph_index); error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT); if (error) { printf("Error: FT_Load_Glyph(): error code %d\n", error); exit(1); } error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_MONO); if (error) { printf("Error: FT_Render_Glyph(): error code %d\n", error); exit(1); } return 0; }