summaryrefslogtreecommitdiff
path: root/src/cff
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2010-02-10 07:02:43 +0100
committerWerner Lemberg <wl@gnu.org>2010-02-10 07:02:43 +0100
commit980b76ea5e189f42259d559df19024cd4fe22aca (patch)
treeccfe29f2dbf27412ddce173d166b2a3cc0d3d3af /src/cff
parentdb9a41e81baafe5e87cfe73e9bdb247a7e27638b (diff)
Really fix Savannah bug #28678 (part 1).
After long discussion, we now consider the character width vector (wx,wy) returned by the `sbw' Type 1 operator as being part of *one* direction only. For example, if you are using the horizontal writing direction, you get the horizontal and vertical components of the advance width for this direction. Note that OpenType and CFF fonts don't have such a vertical component; instead, the GPOS table can be used to generate two-dimensional advance widths (but this isn't handled by FreeType). * include/freetype/ftincrem.h (FT_Incremental_MetricsRec): Add `advance_v' field to hold the vertical component of the advance value. * src/truetype/ttgload.c (tt_get_metrics), src/cff/cffgload.c (cff_slot_load), src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String), src/cid/cidgload.c (cid_load_glyph): Use it.
Diffstat (limited to 'src/cff')
-rw-r--r--src/cff/cffgload.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index d598f84c..b97228d1 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -2764,8 +2764,8 @@
#ifdef FT_CONFIG_OPTION_INCREMENTAL
/* Incremental fonts can optionally override the metrics. */
- if ( !error &&
- face->root.internal->incremental_interface &&
+ if ( !error &&
+ face->root.internal->incremental_interface &&
face->root.internal->incremental_interface->funcs->get_glyph_metrics )
{
FT_Incremental_MetricsRec metrics;
@@ -2774,6 +2774,7 @@
metrics.bearing_x = decoder.builder.left_bearing.x;
metrics.bearing_y = 0;
metrics.advance = decoder.builder.advance.x;
+ metrics.advance_v = decoder.builder.advance.y;
error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(
face->root.internal->incremental_interface->object,
@@ -2781,20 +2782,7 @@
decoder.builder.left_bearing.x = metrics.bearing_x;
decoder.builder.advance.x = metrics.advance;
-
- 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;
- }
+ decoder.builder.advance.y = metrics.advance_v;
}
#endif /* FT_CONFIG_OPTION_INCREMENTAL */