ref: cea9d7a6820bf7cca8d79d813908ce085a3d3d5d
parent: a03cb019aa1d0c73c4be9a4e79f5f21c89ca6a44
author: Alexei Podtelezhnikov <[email protected]>
date: Fri Jun 15 02:33:46 EDT 2012
* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Improve spacing. * docs/CHANGES: Updated.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-15 Alexei Podtelezhnikov <[email protected]>
+
+ * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Improve spacing.
+
+ * docs/CHANGES: Updated.
+
2012-06-14 suzuki toshiya <[email protected]>
* builds/exports.mk: Add CCexe_CFLAGS and CCexe_LDFLAGS.
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -12,8 +12,11 @@
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.
--- 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 @@
/* 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 );
--- 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 )