diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index 4635a10e4..bfd70e7b9 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -289,20 +289,21 @@ return 0; int tM=glyph->top; fontwidth = glyph->width; -#if defined BOXMODEL_CST_HD1 - // too hard loop below for HD1 - fontwidth_widest = fontwidth; -#else - // walk through all chars to find fontwidth_widest - FT_UInt gindex = 0; - FT_ULong charcode = FT_Get_First_Char(face, &gindex); - while (gindex != 0) + std::string fontname = face->family_name; + if (fontname.find("Font Awesome") != std::string::npos) { - getGlyphBitmap(gindex, &glyph); - fontwidth_widest = std::max(fontwidth, (int)glyph->width); - charcode = FT_Get_Next_Char(face, charcode, &gindex); + // walk through all chars to find fontwidth_widest + FT_UInt gindex = 0; + FT_ULong charcode = FT_Get_First_Char(face, &gindex); + while (gindex != 0) + { + getGlyphBitmap(gindex, &glyph); + fontwidth_widest = std::max(fontwidth, (int)glyph->width); + charcode = FT_Get_Next_Char(face, charcode, &gindex); + } } -#endif + else + fontwidth_widest = fontwidth; //printf("Font::setSize() %s: fontwidth=%d fontwidth_widest=%d\n", face->family_name, fontwidth, fontwidth_widest); index=FT_Get_Char_Index(face, 'g'); // "g" gives us descender