diff --git a/ChangeLog b/ChangeLog index c3dff2805..ab0fb4085 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2011-01-15 Werner Lemberg + + [raster] Make bbox handling the same as with Microsoft's rasterizer. + + Right before B/W rasterizing, the bbox gets simply rounded to + integers. This fixes, for example, glyph `three' in font `Helvetica + Neue LT Com 65 Medium' at 11ppem. + + Thanks to Greg Hitchcock who explained this behaviour. + + * src/raster/ftrend1.c (ft_raster1_render): Implement it. + 2011-01-15 suzuki toshiya Copy -mcpu=* & -march=* options from CFLAGS to LDFLAGS. diff --git a/src/raster/ftrend1.c b/src/raster/ftrend1.c index 1ed8af612..d8a89f28a 100644 --- a/src/raster/ftrend1.c +++ b/src/raster/ftrend1.c @@ -161,10 +161,18 @@ /* compute the control box, and grid fit it */ FT_Outline_Get_CBox( outline, &cbox ); + /* undocumented but confirmed: bbox values get rounded */ +#if 1 + cbox.xMin = FT_PIX_ROUND( cbox.xMin ); + cbox.yMin = FT_PIX_ROUND( cbox.yMin ); + cbox.xMax = FT_PIX_ROUND( cbox.xMax ); + cbox.yMax = FT_PIX_ROUND( cbox.yMax ); +#else cbox.xMin = FT_PIX_FLOOR( cbox.xMin ); cbox.yMin = FT_PIX_FLOOR( cbox.yMin ); cbox.xMax = FT_PIX_CEIL( cbox.xMax ); cbox.yMax = FT_PIX_CEIL( cbox.yMax ); +#endif width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 ); height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );