diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index 18d356ebf..4cd80190c 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -500,18 +500,18 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u continue; } + //kerning + if (use_kerning) + { + FT_Get_Kerning(face, lastindex, index, 0, &kerning); + //x+=(kerning.x+32)>>6; // kerning! + x += (kerning.x) >> 6; // kerning! + } + // width clip if (x + glyph->xadvance + spread_by > left + width) break; - //kerning - if(use_kerning) - { - FT_Get_Kerning(face,lastindex,index,0,&kerning); - //x+=(kerning.x+32)>>6; // kerning! - x+=(kerning.x)>>6; // kerning! - } - #ifndef USE_NEVIS_GXA int stride = frameBuffer->getStride(); int ap=(x + glyph->left) * sizeof(fb_pixel_t) + stride * (y - glyph->top); @@ -638,10 +638,10 @@ int Font::getRenderWidth(const char *text, const bool utf8_encoded) continue; } //kerning - if(use_kerning) + if (use_kerning) { - FT_Get_Kerning(face,lastindex,index,0,&kerning); - x+=(kerning.x+32)>>6; // kerning! + FT_Get_Kerning(face, lastindex, index, 0, &kerning); + x += (kerning.x) >> 6; // kerning! } x+=glyph->xadvance+1;