* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Improve spacing.

* docs/CHANGES: Updated.
This commit is contained in:
Alexei Podtelezhnikov 2012-06-15 06:33:46 +02:00 committed by Werner Lemberg
parent a03cb019aa
commit cea9d7a682
4 changed files with 22 additions and 19 deletions

View File

@ -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.

View File

@ -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.

View File

@ -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 );

View File

@ -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 )