- int glyph_index = 0;
- for (std::vector<FT_Face>::const_iterator j = fonts.begin(); j != fonts.end(); ++j) {
- glyph_index = FT_Get_Char_Index(*j, *i);
- if (glyph_index == 0)
- continue;
-
- if (use_lcd) {
- if (FT_Load_Glyph(*j, glyph_index, FT_LOAD_RENDER | FT_LOAD_TARGET_LCD))
- throw std::runtime_error("Couldn't load glyph");
- } else {
- if (FT_Load_Glyph(*j, glyph_index, FT_LOAD_RENDER))
- throw std::runtime_error("Couldn't load glyph");
- }
- slot = (*j)->glyph;
- break;
- }
+ FT_Face face;
+ int glyph_index;
+ get_glyph(fonts, *i, &face, &glyph_index);