diff --git a/freetype2gl3.cc b/freetype2gl3.cc index aa1a027..95b188a 100644 --- a/freetype2gl3.cc +++ b/freetype2gl3.cc @@ -9,6 +9,9 @@ using namespace std; #define WIDTH 500 #define HEIGHT 500 +static FT_Library ft; +static FT_Face face; + void init(void) { glClearColor (0.0, 0.0, 0.0, 0.0); @@ -59,12 +62,20 @@ int main(int argc, char *argv[]) return 2; } - FT_Library ft; if (FT_Init_FreeType(&ft) != 0) { cerr << "Could not FT_Init_FreeType()" << endl; + return 2; } + if (FT_New_Face(ft, "/usr/share/fonts/truetype/freefont/FreeMono.ttf", 0, &face) != 0) + { + cerr << "Could not load FreeMono.ttf" << endl; + return 2; + } + + FT_Set_Pixel_Sizes(face, 0, 20); + init(); display(window); SDL_Event event;