diff --git a/ChangeLog b/ChangeLog index d85617a16..cd54ab20b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-06-15 Alexei Podtelezhnikov + + * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Improve spacing. + + * docs/CHANGES: Updated. + 2012-06-14 suzuki toshiya * builds/exports.mk: Add CCexe_CFLAGS and CCexe_LDFLAGS. diff --git a/docs/CHANGES b/docs/CHANGES index 82a01ca12..75042d593 100644 --- a/docs/CHANGES +++ b/docs/CHANGES @@ -12,9 +12,12 @@ CHANGES BETWEEN 2.4.9 and 2.4.10 Podtelezhnikov. - In the `ftview' demo program, key `e' has been replaced with `x' - and `y' to embolden in horizontal and vertical directions, + and `y' to embolden in the horizontal and vertical direction, respectively. + - The glyph spacing computation in `FT_GlyphSlot_Embolden' (and + similar code in `ftview') has been improved. + - Minor improvements to the TrueType bytecode interpreter and glyph loader, the auto-hinter, and the B/W rasterizer. diff --git a/include/freetype/ftsynth.h b/include/freetype/ftsynth.h index a068b7928..2074503cf 100644 --- a/include/freetype/ftsynth.h +++ b/include/freetype/ftsynth.h @@ -5,7 +5,7 @@ /* FreeType synthesizing code for emboldening and slanting */ /* (specification). */ /* */ -/* Copyright 2000-2001, 2003, 2006, 2008 by */ +/* Copyright 2000-2001, 2003, 2006, 2008, 2012 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -61,8 +61,9 @@ FT_BEGIN_HEADER /* taste). This function is actually a convenience function, providing */ /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */ /* */ - /* For emboldened outlines the metrics are estimates only; if you need */ - /* precise values you should call @FT_Outline_Get_CBox. */ + /* For emboldened outlines the height, width, and advance metrics are */ + /* increased by the strength of the emboldening. You can also call */ + /* @FT_Outline_Get_CBox to get precise values. */ FT_EXPORT( void ) FT_GlyphSlot_Embolden( FT_GlyphSlot slot ); diff --git a/src/base/ftsynth.c b/src/base/ftsynth.c index d4ec0da57..81e2ed246 100644 --- a/src/base/ftsynth.c +++ b/src/base/ftsynth.c @@ -4,7 +4,7 @@ /* */ /* FreeType synthesizing code for emboldening and slanting (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2010 by */ +/* Copyright 2000-2006, 2010, 2012 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -33,6 +33,7 @@ #undef FT_COMPONENT #define FT_COMPONENT trace_synth + /*************************************************************************/ /*************************************************************************/ /**** ****/ @@ -72,7 +73,7 @@ /*************************************************************************/ /*************************************************************************/ /**** ****/ - /**** EXPERIMENTAL EMBOLDENING/OUTLINING SUPPORT ****/ + /**** EXPERIMENTAL EMBOLDENING SUPPORT ****/ /**** ****/ /*************************************************************************/ /*************************************************************************/ @@ -101,12 +102,7 @@ if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) { /* ignore error */ - (void)FT_Outline_Embolden( &slot->outline, xstr ); - - /* this is more than enough for most glyphs; if you need accurate */ - /* values, you have to call FT_Outline_Get_CBox */ - xstr = xstr * 2; - ystr = xstr; + (void)FT_Outline_EmboldenXY( &slot->outline, xstr, ystr ); } else /* slot->format == FT_GLYPH_FORMAT_BITMAP */ { @@ -143,13 +139,10 @@ if ( slot->advance.y ) slot->advance.y += ystr; - slot->metrics.width += xstr; - slot->metrics.height += ystr; - slot->metrics.horiBearingY += ystr; - slot->metrics.horiAdvance += xstr; - slot->metrics.vertBearingX -= xstr / 2; - slot->metrics.vertBearingY += ystr; - slot->metrics.vertAdvance += ystr; + slot->metrics.width += xstr; + slot->metrics.height += ystr; + slot->metrics.horiAdvance += xstr; + slot->metrics.vertAdvance += ystr; /* XXX: 16-bit overflow case must be excluded before here */ if ( slot->format == FT_GLYPH_FORMAT_BITMAP )