* src/base/ftoutln.c (FT_Outline_Embolden): Strength should be

halved.

* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Change the default
strength.
Don't increase slot->advance.y.



* include/freetype/freetype.h (FREETYPE_MINOR): Set to 2.
(FREETYPE_PATCH): Set to 0.

* builds/unix/configure.ac (version_info): Set to 9:9:3.
Currently, we are still binary compatible.

* builds/win32/visualc/index.html,
builds/win32/visualc/freetype.dsp,
builds/win32/visualc/freetype.vcproj: s/219/2110/, s/2.1.9/2.1.10/.

* builds/freetype.mk (refdoc), README, Jamfile (RefDoc):
s/2.1.9/2.1.10/.

* docs/CHANGES, docs/VERSION.DLL: Updated.

* ChangeLog: Split off older entries into...
* ChangeLog.20, ChangeLog.21: These new files.



The next release will be 2.2.0, so don't worry about source code
backwards compatibility.

* include/freetype/ftimage.h (FT_Outline_MoveToFunc,
FT_Outline_LineToFunc, FT_Outline_ConicToFunc,
FT_Outline_CubicToFunc, FT_SpanFunc, FT_Raster_RenderFunc),
include/freetype/ftrender.h (FT_Glyph_TransformFunc,
FT_Renderer_RenderFunc, FT_Renderer_TransformFunc): Decorate
parameters with `const' where appropriate.



* src/sfnt/ttsbit.c (tt_face_load_sbit_image): Compute vertBearingY
to make glyphs centered vertically.

* src/truetype/ttgload.c (compute_glyph_metrics): Compute
vertBearingY to make glyphs centered vertically.
Fix some bugs in vertical metrics:

  . loader->pp3.y and loader->pp4.y are in 26.6 format, not in font
    units.
  . As we use the glyph's cbox to calculate the top bearing now
    there iss no need to adjust `top'.



* src/otvalid/otvcommn.h (OTV_OPTIONAL_TABLE): Use FT_UShort to be
in sync with OTV_OPTIONAL_OFFSET.  Reported by YAMATO Masatake.


* docs/release: Update.
This commit is contained in:
Werner Lemberg 2005-06-16 19:07:08 +00:00
parent 765cb0fa70
commit 49f4d34ed3
18 changed files with 12227 additions and 12111 deletions

12047
ChangeLog

File diff suppressed because it is too large Load Diff

2613
ChangeLog.20 Normal file

File diff suppressed because it is too large Load Diff

9439
ChangeLog.21 Normal file

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@ AC_CONFIG_SRCDIR([ftconfig.in])
# Don't forget to update docs/VERSION.DLL! # Don't forget to update docs/VERSION.DLL!
version_info='9:8:3' version_info='9:9:3'
AC_SUBST([version_info]) AC_SUBST([version_info])
ft_version=`echo $version_info | tr : .` ft_version=`echo $version_info | tr : .`
AC_SUBST([ft_version]) AC_SUBST([ft_version])

View File

@ -54,7 +54,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LIB32=link.exe -lib LIB32=link.exe -lib
# ADD BASE LIB32 /nologo # ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2110.lib" # ADD LIB32 /nologo /out:"..\..\..\objs\freetype220.lib"
!ELSEIF "$(CFG)" == "freetype - Win32 Debug" !ELSEIF "$(CFG)" == "freetype - Win32 Debug"
@ -78,7 +78,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LIB32=link.exe -lib LIB32=link.exe -lib
# ADD BASE LIB32 /nologo # ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2110_D.lib" # ADD LIB32 /nologo /out:"..\..\..\objs\freetype220_D.lib"
!ELSEIF "$(CFG)" == "freetype - Win32 Debug Multithreaded" !ELSEIF "$(CFG)" == "freetype - Win32 Debug Multithreaded"
@ -103,7 +103,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LIB32=link.exe -lib LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"lib\freetype200b8_D.lib" # ADD BASE LIB32 /nologo /out:"lib\freetype200b8_D.lib"
# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2110MT_D.lib" # ADD LIB32 /nologo /out:"..\..\..\objs\freetype220MT_D.lib"
!ELSEIF "$(CFG)" == "freetype - Win32 Release Multithreaded" !ELSEIF "$(CFG)" == "freetype - Win32 Release Multithreaded"
@ -127,7 +127,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LIB32=link.exe -lib LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"lib\freetype200b8.lib" # ADD BASE LIB32 /nologo /out:"lib\freetype200b8.lib"
# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2110MT.lib" # ADD LIB32 /nologo /out:"..\..\..\objs\freetype220MT.lib"
!ELSEIF "$(CFG)" == "freetype - Win32 Release Singlethreaded" !ELSEIF "$(CFG)" == "freetype - Win32 Release Singlethreaded"
@ -152,7 +152,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LIB32=link.exe -lib LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206.lib" # ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206.lib"
# ADD LIB32 /out:"..\..\..\objs\freetype2110ST.lib" # ADD LIB32 /out:"..\..\..\objs\freetype220ST.lib"
# SUBTRACT LIB32 /nologo # SUBTRACT LIB32 /nologo
!ELSEIF "$(CFG)" == "freetype - Win32 Debug Singlethreaded" !ELSEIF "$(CFG)" == "freetype - Win32 Debug Singlethreaded"
@ -178,7 +178,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LIB32=link.exe -lib LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206_D.lib" # ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206_D.lib"
# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2110ST_D.lib" # ADD LIB32 /nologo /out:"..\..\..\objs\freetype220ST_D.lib"
!ENDIF !ENDIF

View File

@ -41,7 +41,7 @@
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLibrarianTool" Name="VCLibrarianTool"
OutputFile="..\..\..\objs\freetype2110.lib" OutputFile="..\..\..\objs\freetype220.lib"
SuppressStartupBanner="TRUE"/> SuppressStartupBanner="TRUE"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
@ -94,7 +94,7 @@
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLibrarianTool" Name="VCLibrarianTool"
OutputFile="..\..\..\objs\freetype2110MT.lib" OutputFile="..\..\..\objs\freetype220MT.lib"
SuppressStartupBanner="TRUE"/> SuppressStartupBanner="TRUE"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
@ -147,7 +147,7 @@
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLibrarianTool" Name="VCLibrarianTool"
OutputFile="..\..\..\objs\freetype2110ST.lib"/> OutputFile="..\..\..\objs\freetype220ST.lib"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
<Tool <Tool
@ -197,7 +197,7 @@
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLibrarianTool" Name="VCLibrarianTool"
OutputFile="..\..\..\objs\freetype2110_D.lib" OutputFile="..\..\..\objs\freetype220_D.lib"
SuppressStartupBanner="TRUE"/> SuppressStartupBanner="TRUE"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
@ -248,7 +248,7 @@
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLibrarianTool" Name="VCLibrarianTool"
OutputFile="..\..\..\objs\freetype2110ST_D.lib" OutputFile="..\..\..\objs\freetype220ST_D.lib"
SuppressStartupBanner="TRUE"/> SuppressStartupBanner="TRUE"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
@ -300,7 +300,7 @@
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLibrarianTool" Name="VCLibrarianTool"
OutputFile="..\..\..\objs\freetype2110MT_D.lib" OutputFile="..\..\..\objs\freetype220MT_D.lib"
SuppressStartupBanner="TRUE"/> SuppressStartupBanner="TRUE"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>

View File

@ -12,14 +12,14 @@
<p>This directory contains project files for Visual C++, named <p>This directory contains project files for Visual C++, named
<tt>freetype.dsp</tt>, and Visual Studio, called <tt>freetype.sln</tt>. It <tt>freetype.dsp</tt>, and Visual Studio, called <tt>freetype.sln</tt>. It
will compile the following libraries from the FreeType 2.1.10 sources:</p> will compile the following libraries from the FreeType 2.2.0 sources:</p>
<ul> <ul>
<pre> <pre>
freetype2110.lib - release build; single threaded freetype220.lib - release build; single threaded
freetype2110_D.lib - debug build; single threaded freetype220_D.lib - debug build; single threaded
freetype2110MT.lib - release build; multi-threaded freetype220MT.lib - release build; multi-threaded
freetype2110MT_D.lib - debug build; multi-threaded</pre> freetype220MT_D.lib - debug build; multi-threaded</pre>
</ul> </ul>
<p>Be sure to extract the files with the Windows (CR+LF) line endings. ZIP <p>Be sure to extract the files with the Windows (CR+LF) line endings. ZIP

View File

@ -1,3 +1,32 @@
LATEST CHANGES BETWEEN 2.2.0 and 2.1.10
I. IMPORTANT BUG FIXES
- Vertical metrics for SFNT fonts were incorrect sometimes.
II. IMPORTANT CHANGES
- The following callback function types have changed slightly (by
adding the `const' keyword where appropriate):
FT_Outline_MoveToFunc
FT_Outline_LineToFunc
FT_Outline_ConicToFunc
FT_Outline_CubicToFunc
FT_SpanFunc
FT_Raster_RenderFunc
FT_Glyph_TransformFunc
FT_Renderer_RenderFunc
FT_Renderer_TransformFunc
Note that this doesn't affect binary backwards compatibility.
III. MISCELLANEOUS
======================================================================
LATEST CHANGES BETWEEN 2.1.10 and 2.1.9 LATEST CHANGES BETWEEN 2.1.10 and 2.1.9
I. IMPORTANT BUG FIXES I. IMPORTANT BUG FIXES

View File

@ -52,6 +52,7 @@ systems, but not all of them:
release libtool so release libtool so
------------------------------- -------------------------------
2.2.0 9.9.3 6.3.9
2.1.10 9.8.3 6.3.8 2.1.10 9.8.3 6.3.8
2.1.9 9.7.3 6.3.7 2.1.9 9.7.3 6.3.7
2.1.8 9.6.3 6.3.6 2.1.8 9.6.3 6.3.6
@ -109,7 +110,7 @@ other release numbers.
------------------------------------------------------------------------ ------------------------------------------------------------------------
Copyright 2002, 2003, 2004 by Copyright 2002, 2003, 2004, 2005 by
David Turner, Robert Wilhelm, and Werner Lemberg. David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, This file is part of the FreeType project, and may only be used,

View File

@ -6,8 +6,8 @@ How to prepare a new release
. builds/unix/configure.ac (version_info): Update according to the libtool . builds/unix/configure.ac (version_info): Update according to the libtool
rules, then regenerate the configure script with the top-level rules, then regenerate the configure script with the top-level
`autogen.sh'. After that, update `config.guess' and `config.sub' to `autogen.sh'. After that, update `config.guess' and `config.sub' to the
the most recent versions (from the `config' CVS repository). most recent versions (from the `config' CVS repository).
. builds/freetype.mk (refdoc): Update the `--title' option. . builds/freetype.mk (refdoc): Update the `--title' option.
@ -19,24 +19,32 @@ How to prepare a new release
. ChangeLog: Announce new release. . ChangeLog: Announce new release.
********* The items below should be done but are out-of-date due *********
********* to the move of the FreeType CVS and web pages. *********
. Call `make refdoc' to update HTML reference. Copy it to . Call `make refdoc' to update HTML reference. Copy it to
freetype2/docs/reference in the `www' CVS module and update the CVS. freetype.freedesktop.org:/srv/freetype.freedesktop.org/\
Then call `update-www' in ~/cvs/scripts on www.freetype.org to freetype2/docs/reference.
update and distribute everything to sourceforge.
. Tag the CVS (freetype, ft2demos, www/freetype2/docs). TODO: Create FreeType home page CVS on savannah.nongnu.org and update it
accordingly.
. Update `make-release' and `make-current' in ~/cvs/scripts/ on Write script to automatically do this.
www.freetype.org, then call them.
. Create an md5 checksum file (with md5sum). Mirror FreeType's savannah home page everywhere.
. Announce new release on announce@freetype.org and to relevant newsgroups. . Tag the CVS (freetype2, ft2demos).
TODO: Tag the home page CVS on savannah.nongnu.org.
. Create packages for freetype2, ft2demos, and documentation.
TODO: Write scripts and/or provide make targets to do that.
. Create signature files with `gpg -b' and upload files to savannah and
sourceforge.
TODO: Write script to do this. Cf. automake's `gnupload' script.
. Announce new release on freetype-announce@nongnu.org and to relevant
newsgroups.
------------------------------------------------------------------------ ------------------------------------------------------------------------

View File

@ -43,8 +43,8 @@
/* drivers. It starts at 2.0. */ /* drivers. It starts at 2.0. */
/* */ /* */
#define FREETYPE_MAJOR 2 #define FREETYPE_MAJOR 2
#define FREETYPE_MINOR 1 #define FREETYPE_MINOR 2
#define FREETYPE_PATCH 10 #define FREETYPE_PATCH 0
#include <ft2build.h> #include <ft2build.h>

View File

@ -486,8 +486,8 @@ FT_BEGIN_HEADER
/* Error code. 0 means success. */ /* Error code. 0 means success. */
/* */ /* */
typedef int typedef int
(*FT_Outline_MoveToFunc)( FT_Vector* to, (*FT_Outline_MoveToFunc)( const FT_Vector* to,
void* user ); void* user );
#define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc #define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc
@ -512,8 +512,8 @@ FT_BEGIN_HEADER
/* Error code. 0 means success. */ /* Error code. 0 means success. */
/* */ /* */
typedef int typedef int
(*FT_Outline_LineToFunc)( FT_Vector* to, (*FT_Outline_LineToFunc)( const FT_Vector* to,
void* user ); void* user );
#define FT_Outline_LineTo_Func FT_Outline_LineToFunc #define FT_Outline_LineTo_Func FT_Outline_LineToFunc
@ -542,9 +542,9 @@ FT_BEGIN_HEADER
/* Error code. 0 means success. */ /* Error code. 0 means success. */
/* */ /* */
typedef int typedef int
(*FT_Outline_ConicToFunc)( FT_Vector* control, (*FT_Outline_ConicToFunc)( const FT_Vector* control,
FT_Vector* to, const FT_Vector* to,
void* user ); void* user );
#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc #define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc
@ -573,10 +573,10 @@ FT_BEGIN_HEADER
/* Error code. 0 means success. */ /* Error code. 0 means success. */
/* */ /* */
typedef int typedef int
(*FT_Outline_CubicToFunc)( FT_Vector* control1, (*FT_Outline_CubicToFunc)( const FT_Vector* control1,
FT_Vector* control2, const FT_Vector* control2,
FT_Vector* to, const FT_Vector* to,
void* user ); void* user );
#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc #define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc
@ -861,10 +861,10 @@ FT_BEGIN_HEADER
/* only for those scanlines that do have `gray' pixels on them. */ /* only for those scanlines that do have `gray' pixels on them. */
/* */ /* */
typedef void typedef void
(*FT_SpanFunc)( int y, (*FT_SpanFunc)( int y,
int count, int count,
FT_Span* spans, const FT_Span* spans,
void* user ); void* user );
#define FT_Raster_Span_Func FT_SpanFunc #define FT_Raster_Span_Func FT_SpanFunc
@ -1183,8 +1183,8 @@ FT_BEGIN_HEADER
/* composition). */ /* composition). */
/* */ /* */
typedef int typedef int
(*FT_Raster_RenderFunc)( FT_Raster raster, (*FT_Raster_RenderFunc)( FT_Raster raster,
FT_Raster_Params* params ); const FT_Raster_Params* params );
#define FT_Raster_Render_Func FT_Raster_RenderFunc #define FT_Raster_Render_Func FT_Raster_RenderFunc

View File

@ -46,9 +46,9 @@ FT_BEGIN_HEADER
(*FT_Glyph_DoneFunc)( FT_Glyph glyph ); (*FT_Glyph_DoneFunc)( FT_Glyph glyph );
typedef void typedef void
(*FT_Glyph_TransformFunc)( FT_Glyph glyph, (*FT_Glyph_TransformFunc)( FT_Glyph glyph,
FT_Matrix* matrix, const FT_Matrix* matrix,
FT_Vector* delta ); const FT_Vector* delta );
typedef void typedef void
(*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph, (*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph,
@ -85,16 +85,16 @@ FT_BEGIN_HEADER
typedef FT_Error typedef FT_Error
(*FT_Renderer_RenderFunc)( FT_Renderer renderer, (*FT_Renderer_RenderFunc)( FT_Renderer renderer,
FT_GlyphSlot slot, FT_GlyphSlot slot,
FT_UInt mode, FT_UInt mode,
FT_Vector* origin ); const FT_Vector* origin );
typedef FT_Error typedef FT_Error
(*FT_Renderer_TransformFunc)( FT_Renderer renderer, (*FT_Renderer_TransformFunc)( FT_Renderer renderer,
FT_GlyphSlot slot, FT_GlyphSlot slot,
FT_Matrix* matrix, const FT_Matrix* matrix,
FT_Vector* delta ); const FT_Vector* delta );
typedef void typedef void

View File

@ -683,6 +683,7 @@
if ( !outline ) if ( !outline )
return FT_Err_Invalid_Argument; return FT_Err_Invalid_Argument;
strength /= 2;
if ( strength == 0 ) if ( strength == 0 )
return FT_Err_Ok; return FT_Err_Ok;

View File

@ -81,7 +81,7 @@
/* some reasonable strength */ /* some reasonable strength */
xstr = FT_MulFix( face->units_per_EM, xstr = FT_MulFix( face->units_per_EM,
face->size->metrics.y_scale ) / 42; face->size->metrics.y_scale ) / 24;
ystr = xstr; ystr = xstr;
if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
@ -122,8 +122,8 @@
/* modify the metrics accordingly */ /* modify the metrics accordingly */
if ( !error ) if ( !error )
{ {
/* assume the layout is horizontal */
slot->advance.x += xstr; slot->advance.x += xstr;
slot->advance.y += ystr;
slot->metrics.width += xstr; slot->metrics.width += xstr;
slot->metrics.height += ystr; slot->metrics.height += ystr;

View File

@ -4,7 +4,7 @@
/* */ /* */
/* OpenType common tables validation (specification). */ /* OpenType common tables validation (specification). */
/* */ /* */
/* Copyright 2004 by */ /* Copyright 2004, 2005 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -70,8 +70,8 @@ FT_BEGIN_HEADER
#define FT_INVALID_( _prefix, _error ) \ #define FT_INVALID_( _prefix, _error ) \
ft_validator_error( valid->root, _prefix ## _error ) ft_validator_error( valid->root, _prefix ## _error )
#define OTV_OPTIONAL_TABLE( _table ) FT_UInt _table; \ #define OTV_OPTIONAL_TABLE( _table ) FT_UShort _table; \
FT_Bytes _table ## _p FT_Bytes _table ## _p
#define OTV_OPTIONAL_OFFSET( _offset ) \ #define OTV_OPTIONAL_OFFSET( _offset ) \
FT_BEGIN_STMNT \ FT_BEGIN_STMNT \

View File

@ -1501,7 +1501,7 @@
/* some heuristic values */ /* some heuristic values */
metrics->vertBearingX = (FT_Char)(-metrics->width / 2 ); metrics->vertBearingX = (FT_Char)(-metrics->width / 2 );
metrics->vertBearingY = (FT_Char)( advance / 10 ); metrics->vertBearingY = (FT_Char)( ( advance - metrics->height ) / 2 );
metrics->vertAdvance = (FT_Char)( advance * 12 / 10 ); metrics->vertAdvance = (FT_Char)( advance * 12 / 10 );
} }

View File

@ -1765,41 +1765,43 @@
if ( face->vertical_info && if ( face->vertical_info &&
face->vertical.number_Of_VMetrics > 0 ) face->vertical.number_Of_VMetrics > 0 )
{ {
advance_height = (FT_UShort)( loader->pp4.y - loader->pp3.y ); top_bearing = (FT_Short)FT_DivFix( loader->pp3.y - bbox.yMax,
top_bearing = (FT_Short)( loader->pp3.y - bbox.yMax ); y_scale );
if ( loader->pp3.y <= loader->pp4.y )
advance_height = 0;
else
advance_height = (FT_UShort)FT_DivFix( loader->pp3.y - loader->pp4.y,
y_scale );
} }
else else
{ {
/* Make up the distances from the horizontal header. */ FT_Short max_height, height;
/* XXX Compute top side bearing and advance height in */
/* Get_VMetrics instead of here. */
/* NOTE: The OS/2 values are the only `portable' ones, */ /* NOTE: The OS/2 values are the only `portable' ones, */
/* which is why we use them, if there is an OS/2 */ /* which is why we use them, if there is an OS/2 */
/* table in the font. Otherwise, we use the */ /* table in the font. Otherwise, we use the */
/* values defined in the horizontal header. */ /* values defined in the horizontal header. */
/* */
/* NOTE2: The sTypoDescender is negative, which is why */ height = FT_DivFix( bbox.yMax - bbox.yMin, y_scale );
/* we compute the baseline-to-baseline distance */
/* here with: */
/* ascender - descender + linegap */
/* */
/* NOTE3: This is different from what MS's rasterizer */
/* appears to do when getting default values */
/* for the vertical phantom points. We leave */
/* the old code untouched, but relying on */
/* phantom points alone might be reasonable */
/* (i.e., removing the `if' above). */
if ( face->os2.version != 0xFFFFU ) if ( face->os2.version != 0xFFFFU )
{ {
top_bearing = (FT_Short)( face->os2.sTypoLineGap / 2 ); /* sTypoDescender is negative */
advance_height = (FT_UShort)( face->os2.sTypoAscender - max_height = face->os2.sTypoAscender - face->os2.sTypoDescender;
face->os2.sTypoDescender +
face->os2.sTypoLineGap ); top_bearing = (FT_Short)( ( max_height - height ) / 2 );
advance_height = (FT_UShort)( max_height + face->os2.sTypoLineGap );
} }
else else
{ {
top_bearing = (FT_Short)( face->horizontal.Line_Gap / 2 ); max_height = face->horizontal.Ascender + face->horizontal.Descender;
advance_height = (FT_UShort)( face->horizontal.Ascender +
face->horizontal.Descender + top_bearing = (FT_Short)( ( max_height - height ) / 2 );
advance_height = (FT_UShort)( max_height +
face->horizontal.Line_Gap ); face->horizontal.Line_Gap );
} }
} }
@ -1817,7 +1819,7 @@
metrics.bearing_x = 0; metrics.bearing_x = 0;
metrics.bearing_y = top_bearing; metrics.bearing_y = top_bearing;
metrics.advance = advance_height; metrics.advance = advance_height;
error = error =
face->root.internal->incremental_interface->funcs->get_glyph_metrics( face->root.internal->incremental_interface->funcs->get_glyph_metrics(
face->root.internal->incremental_interface->object, face->root.internal->incremental_interface->object,
@ -1834,20 +1836,15 @@
#endif /* FT_CONFIG_OPTION_INCREMENTAL */ #endif /* FT_CONFIG_OPTION_INCREMENTAL */
/* We must adjust the top_bearing value from the bounding box given */
/* in the glyph header to the bounding box calculated with */
/* FT_Get_Outline_CBox(). */
/* scale the metrics */ /* scale the metrics */
if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) ) if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) )
{ {
top = FT_MulFix( top_bearing + loader->bbox.yMax, y_scale ) top = FT_MulFix( top_bearing, y_scale );
- bbox.yMax;
advance = FT_MulFix( advance_height, y_scale ); advance = FT_MulFix( advance_height, y_scale );
} }
else else
{ {
top = top_bearing + loader->bbox.yMax - bbox.yMax; top = top_bearing;
advance = advance_height; advance = advance_height;
} }
@ -1864,7 +1861,8 @@
if ( IS_HINTED( loader->load_flags ) ) if ( IS_HINTED( loader->load_flags ) )
{ {
left = FT_PIX_FLOOR( left ); left = FT_PIX_FLOOR( left );
top = FT_PIX_CEIL( top ); /* top should be floor'ed */
top = FT_PIX_FLOOR( top );
advance = FT_PIX_ROUND( advance ); advance = FT_PIX_ROUND( advance );
} }