[truetype] Fix font height.

* src/truetype/ttobjs.c (tt_size_reset): The Windows rendering
engine uses rounded values of the ascender and descender to compute
the TrueType font height.
This commit is contained in:
Werner Lemberg 2013-01-22 11:07:07 +01:00
parent 7190098098
commit e0469372be
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2013-01-22 Werner Lemberg <wl@gnu.org>
[truetype] Fix font height.
* src/truetype/ttobjs.c (tt_size_reset): The Windows rendering
engine uses rounded values of the ascender and descender to compute
the TrueType font height.
2013-01-16 Behdad Esfahbod <behdad@behdad.org>
[sfnt] Fix optimized sbit loader.

View File

@ -4,7 +4,7 @@
/* */
/* Objects manager (body). */
/* */
/* Copyright 1996-2012 */
/* Copyright 1996-2013 */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -1177,11 +1177,12 @@
FT_PIX_ROUND( FT_MulFix( face->root.ascender, metrics->y_scale ) );
metrics->descender =
FT_PIX_ROUND( FT_MulFix( face->root.descender, metrics->y_scale ) );
metrics->height =
FT_PIX_ROUND( FT_MulFix( face->root.height, metrics->y_scale ) );
metrics->max_advance =
FT_PIX_ROUND( FT_MulFix( face->root.max_advance_width,
metrics->x_scale ) );
/* the height is derived from rounded values */
metrics->height = metrics->ascender - metrics->descender;
}
/* compute new transformation */