|
|
|
@ -3073,18 +3073,37 @@ |
|
|
|
|
|
|
|
|
|
if ( kern_mode != FT_KERNING_UNFITTED ) |
|
|
|
|
{ |
|
|
|
|
FT_Pos orig_x = akerning->x; |
|
|
|
|
FT_Pos orig_y = akerning->y; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* we scale down kerning values for small ppem values */ |
|
|
|
|
/* to avoid that rounding makes them too big. */ |
|
|
|
|
/* `25' has been determined heuristically. */ |
|
|
|
|
if ( face->size->metrics.x_ppem < 25 ) |
|
|
|
|
akerning->x = FT_MulDiv( akerning->x, |
|
|
|
|
akerning->x = FT_MulDiv( orig_x, |
|
|
|
|
face->size->metrics.x_ppem, 25 ); |
|
|
|
|
if ( face->size->metrics.y_ppem < 25 ) |
|
|
|
|
akerning->y = FT_MulDiv( akerning->y, |
|
|
|
|
akerning->y = FT_MulDiv( orig_y, |
|
|
|
|
face->size->metrics.y_ppem, 25 ); |
|
|
|
|
|
|
|
|
|
akerning->x = FT_PIX_ROUND( akerning->x ); |
|
|
|
|
akerning->y = FT_PIX_ROUND( akerning->y ); |
|
|
|
|
|
|
|
|
|
#ifdef FT_DEBUG_LEVEL_TRACE |
|
|
|
|
{ |
|
|
|
|
FT_Pos orig_x_rounded = FT_PIX_ROUND( orig_x ); |
|
|
|
|
FT_Pos orig_y_rounded = FT_PIX_ROUND( orig_y ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( akerning->x != orig_x_rounded || |
|
|
|
|
akerning->y != orig_y_rounded ) |
|
|
|
|
FT_TRACE5(( "FT_Get_Kerning: horizontal kerning" |
|
|
|
|
" (%d, %d) scaled down to (%d, %d) pixels\n", |
|
|
|
|
orig_x_rounded / 64, orig_y_rounded / 64, |
|
|
|
|
akerning->x / 64, akerning->y / 64 )); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|