Skip to content

Commit

Permalink
ofTruetypeFont: Fix kerning factor. #6136
Browse files Browse the repository at this point in the history
We where using a calculated factor for the font size to scale the kerning
but that doesn't seem to work. We are now instead right shifting by 6
which is the truetype default
  • Loading branch information
arturoc committed Nov 14, 2018
1 parent 19e083d commit e192b47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/openFrameworks/graphics/ofTrueTypeFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ int ofTrueTypeFont::getKerning(uint32_t c, uint32_t prevC) const{
if(FT_HAS_KERNING( face )){
FT_Vector kerning;
FT_Get_Kerning(face.get(), FT_Get_Char_Index(face.get(), c), FT_Get_Char_Index(face.get(), prevC), FT_KERNING_UNFITTED, &kerning);
return kerning.x * fontUnitScale;
return kerning.x >> 6;
}else{
return 0;
}
Expand Down

0 comments on commit e192b47

Please sign in to comment.