Really fix Savannah bug #28678 (part 2).

Since we consider `sbw' for the horizontal direction only, we still have
to synthesize vertical metrics if the user wants to use the vertical
writing direction.

* src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
(cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph):
Synthesize vertical metrics (only) if FT_LOAD_VERTICAL_LAYOUT is
set.
This commit is contained in:
Ken Sharp 2010-02-10 07:13:27 +01:00 committed by Werner Lemberg
parent 980b76ea5e
commit 63e7aac34f
4 changed files with 46 additions and 21 deletions

View File

@ -1,4 +1,17 @@
2010-01-27 Ken Sharp <ken.sharp@artifex.com> 2010-02-10 Ken Sharp <ken.sharp@artifex.com>
Really fix Savannah bug #28678 (part 2).
Since we consider `sbw' for the horizontal direction only, we still have
to synthesize vertical metrics if the user wants to use the vertical
writing direction.
* src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
(cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph):
Synthesize vertical metrics (only) if FT_LOAD_VERTICAL_LAYOUT is
set.
2010-02-10 Ken Sharp <ken.sharp@artifex.com>
Really fix Savannah bug #28678 (part 1). Really fix Savannah bug #28678 (part 1).

View File

@ -2920,10 +2920,13 @@
metrics->vertBearingX = metrics->horiBearingX - metrics->vertBearingX = metrics->horiBearingX -
metrics->horiAdvance / 2; metrics->horiAdvance / 2;
else else
{
if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
ft_synthesize_vertical_metrics( metrics, ft_synthesize_vertical_metrics( metrics,
metrics->vertAdvance ); metrics->vertAdvance );
} }
} }
}
return error; return error;
} }

View File

@ -427,10 +427,13 @@
metrics->horiBearingX = cbox.xMin; metrics->horiBearingX = cbox.xMin;
metrics->horiBearingY = cbox.yMax; metrics->horiBearingY = cbox.yMax;
if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
{
/* make up vertical ones */ /* make up vertical ones */
ft_synthesize_vertical_metrics( metrics, ft_synthesize_vertical_metrics( metrics,
metrics->vertAdvance ); metrics->vertAdvance );
} }
}
Exit: Exit:
return error; return error;

View File

@ -401,17 +401,20 @@
FIXED_TO_INT( decoder.builder.advance.x ); FIXED_TO_INT( decoder.builder.advance.x );
glyph->root.internal->glyph_transformed = 0; glyph->root.internal->glyph_transformed = 0;
#if 0 if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
{
/* make up vertical ones */ /* make up vertical ones */
metrics->vertAdvance = ( face->type1.font_bbox.yMax - metrics->vertAdvance = ( face->type1.font_bbox.yMax -
face->type1.font_bbox.yMin ) >> 16; face->type1.font_bbox.yMin ) >> 16;
glyph->root.linearVertAdvance = metrics->vertAdvance; glyph->root.linearVertAdvance = metrics->vertAdvance;
#else }
else
{
metrics->vertAdvance = metrics->vertAdvance =
FIXED_TO_INT( decoder.builder.advance.y ); FIXED_TO_INT( decoder.builder.advance.y );
glyph->root.linearVertAdvance = glyph->root.linearVertAdvance =
FIXED_TO_INT( decoder.builder.advance.y ); FIXED_TO_INT( decoder.builder.advance.y );
#endif }
glyph->root.format = FT_GLYPH_FORMAT_OUTLINE; glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;
@ -471,10 +474,13 @@
metrics->horiBearingX = cbox.xMin; metrics->horiBearingX = cbox.xMin;
metrics->horiBearingY = cbox.yMax; metrics->horiBearingY = cbox.yMax;
if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
{
/* make up vertical ones */ /* make up vertical ones */
ft_synthesize_vertical_metrics( metrics, ft_synthesize_vertical_metrics( metrics,
metrics->vertAdvance ); metrics->vertAdvance );
} }
}
/* Set control data to the glyph charstrings. Note that this is */ /* Set control data to the glyph charstrings. Note that this is */
/* _not_ zero-terminated. */ /* _not_ zero-terminated. */