forked from minhngoc25a/freetype2
Fix Savannah bug #28678.
* src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c (cid_load_glyph): Handle vertical metrics correctly. * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Handle vertical metrics correctly. (T1_Load_Glyph): Don't synthesize vertical metrics.
This commit is contained in:
parent
f0760ca6e8
commit
f19e46f3ba
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2010-01-27 Ken Sharp <ken.sharp@artifex.com>
|
||||
|
||||
Fix Savannah bug #28678.
|
||||
|
||||
* src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
|
||||
(cid_load_glyph): Handle vertical metrics correctly.
|
||||
|
||||
* src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Handle
|
||||
vertical metrics correctly.
|
||||
(T1_Load_Glyph): Don't synthesize vertical metrics.
|
||||
|
||||
2010-01-14 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
Make FT_Set_Transform work if no renderer is available.
|
||||
|
|
|
@ -315,7 +315,7 @@ FT_BEGIN_HEADER
|
|||
/* contain no glyph data, but supply it via a callback function. */
|
||||
/* This is required by clients supporting document formats which */
|
||||
/* supply font data incrementally as the document is parsed, such */
|
||||
/* as the Ghostscript interpreter for the PostScript language. */
|
||||
/* as the Ghostscript interpreter for the PostScript language. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_INCREMENTAL
|
||||
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
/* */
|
||||
/* OpenType Glyph Loader (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
|
||||
/* 2010 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -694,7 +695,7 @@
|
|||
data.length = length;
|
||||
|
||||
face->root.internal->incremental_interface->funcs->free_glyph_data(
|
||||
face->root.internal->incremental_interface->object,&data );
|
||||
face->root.internal->incremental_interface->object, &data );
|
||||
}
|
||||
else
|
||||
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
|
||||
|
@ -2771,15 +2772,29 @@
|
|||
|
||||
|
||||
metrics.bearing_x = decoder.builder.left_bearing.x;
|
||||
metrics.bearing_y = decoder.builder.left_bearing.y;
|
||||
metrics.bearing_y = 0;
|
||||
metrics.advance = decoder.builder.advance.x;
|
||||
|
||||
error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(
|
||||
face->root.internal->incremental_interface->object,
|
||||
glyph_index, FALSE, &metrics );
|
||||
|
||||
decoder.builder.left_bearing.x = metrics.bearing_x;
|
||||
decoder.builder.left_bearing.y = metrics.bearing_y;
|
||||
decoder.builder.advance.x = metrics.advance;
|
||||
decoder.builder.advance.y = 0;
|
||||
|
||||
if ( !error )
|
||||
{
|
||||
metrics.bearing_x = 0;
|
||||
metrics.bearing_y = decoder.builder.left_bearing.y;
|
||||
metrics.advance = decoder.builder.advance.y;
|
||||
|
||||
error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(
|
||||
face->root.internal->incremental_interface->object,
|
||||
glyph_index, TRUE, &metrics );
|
||||
|
||||
decoder.builder.left_bearing.y = metrics.bearing_y;
|
||||
decoder.builder.advance.y = metrics.advance;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* CID-keyed Type1 Glyph Loader (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -173,16 +173,27 @@
|
|||
|
||||
|
||||
metrics.bearing_x = FIXED_TO_INT( decoder->builder.left_bearing.x );
|
||||
metrics.bearing_y = FIXED_TO_INT( decoder->builder.left_bearing.y );
|
||||
metrics.bearing_y = 0;
|
||||
metrics.advance = FIXED_TO_INT( decoder->builder.advance.x );
|
||||
|
||||
error = inc->funcs->get_glyph_metrics( inc->object,
|
||||
glyph_index, FALSE, &metrics );
|
||||
|
||||
decoder->builder.left_bearing.x = INT_TO_FIXED( metrics.bearing_x );
|
||||
decoder->builder.left_bearing.y = INT_TO_FIXED( metrics.bearing_y );
|
||||
decoder->builder.advance.x = INT_TO_FIXED( metrics.advance );
|
||||
decoder->builder.advance.y = 0;
|
||||
|
||||
if ( !error )
|
||||
{
|
||||
metrics.bearing_x = 0;
|
||||
metrics.bearing_y = FIXED_TO_INT( decoder->builder.left_bearing.y );
|
||||
metrics.advance = FIXED_TO_INT( decoder->builder.advance.y );
|
||||
|
||||
error = inc->funcs->get_glyph_metrics( inc->object,
|
||||
glyph_index, TRUE, &metrics );
|
||||
|
||||
decoder->builder.left_bearing.y = INT_TO_FIXED( metrics.bearing_y );
|
||||
decoder->builder.advance.y = INT_TO_FIXED( metrics.advance );
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
|
||||
|
|
|
@ -103,16 +103,27 @@
|
|||
|
||||
|
||||
metrics.bearing_x = FIXED_TO_INT( decoder->builder.left_bearing.x );
|
||||
metrics.bearing_y = FIXED_TO_INT( decoder->builder.left_bearing.y );
|
||||
metrics.bearing_y = 0;
|
||||
metrics.advance = FIXED_TO_INT( decoder->builder.advance.x );
|
||||
|
||||
error = inc->funcs->get_glyph_metrics( inc->object,
|
||||
glyph_index, FALSE, &metrics );
|
||||
|
||||
decoder->builder.left_bearing.x = INT_TO_FIXED( metrics.bearing_x );
|
||||
decoder->builder.left_bearing.y = INT_TO_FIXED( metrics.bearing_y );
|
||||
decoder->builder.advance.x = INT_TO_FIXED( metrics.advance );
|
||||
decoder->builder.advance.y = 0;
|
||||
|
||||
if ( !error )
|
||||
{
|
||||
metrics.bearing_x = 0;
|
||||
metrics.bearing_y = FIXED_TO_INT( decoder->builder.left_bearing.y );
|
||||
metrics.advance = FIXED_TO_INT( decoder->builder.advance.y );
|
||||
|
||||
error = inc->funcs->get_glyph_metrics( inc->object,
|
||||
glyph_index, TRUE, &metrics );
|
||||
|
||||
decoder->builder.left_bearing.y = INT_TO_FIXED( metrics.bearing_y );
|
||||
decoder->builder.advance.y = INT_TO_FIXED( metrics.advance );
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
|
||||
|
@ -401,10 +412,17 @@
|
|||
FIXED_TO_INT( decoder.builder.advance.x );
|
||||
glyph->root.internal->glyph_transformed = 0;
|
||||
|
||||
#if 0
|
||||
/* make up vertical ones */
|
||||
metrics->vertAdvance = ( face->type1.font_bbox.yMax -
|
||||
face->type1.font_bbox.yMin ) >> 16;
|
||||
glyph->root.linearVertAdvance = metrics->vertAdvance;
|
||||
#else
|
||||
metrics->vertAdvance =
|
||||
FIXED_TO_INT( decoder.builder.advance.y );
|
||||
glyph->root.linearVertAdvance =
|
||||
FIXED_TO_INT( decoder.builder.advance.y );
|
||||
#endif
|
||||
|
||||
glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;
|
||||
|
||||
|
|
Loading…
Reference in New Issue