* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Improve spacing. * docs/CHANGES: Updated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
diff --git a/ChangeLog b/ChangeLog
index d85617a..cd54ab2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-15 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Improve spacing.
+
+ * docs/CHANGES: Updated.
+
2012-06-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
* builds/exports.mk: Add CCexe_CFLAGS and CCexe_LDFLAGS.
diff --git a/docs/CHANGES b/docs/CHANGES
index 82a01ca..75042d5 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 a068b79..2074503 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 d4ec0da..81e2ed2 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 )