diff --git a/ChangeLog b/ChangeLog index 362bc5ec9..2a102390d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,17 @@ -2010-01-27 Ken Sharp +2010-02-10 Ken Sharp + + 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 Really fix Savannah bug #28678 (part 1). diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c index b97228d11..9330c0588 100644 --- a/src/cff/cffgload.c +++ b/src/cff/cffgload.c @@ -2919,9 +2919,12 @@ if ( has_vertical_info ) metrics->vertBearingX = metrics->horiBearingX - metrics->horiAdvance / 2; - else - ft_synthesize_vertical_metrics( metrics, - metrics->vertAdvance ); + else + { + if ( load_flags & FT_LOAD_VERTICAL_LAYOUT ) + ft_synthesize_vertical_metrics( metrics, + metrics->vertAdvance ); + } } } diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c index 0a4619c81..ea61b4e12 100644 --- a/src/cid/cidgload.c +++ b/src/cid/cidgload.c @@ -427,9 +427,12 @@ metrics->horiBearingX = cbox.xMin; metrics->horiBearingY = cbox.yMax; - /* make up vertical ones */ - ft_synthesize_vertical_metrics( metrics, - metrics->vertAdvance ); + if ( load_flags & FT_LOAD_VERTICAL_LAYOUT ) + { + /* make up vertical ones */ + ft_synthesize_vertical_metrics( metrics, + metrics->vertAdvance ); + } } Exit: diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c index 1fbc63e46..f3fad4f5d 100644 --- a/src/type1/t1gload.c +++ b/src/type1/t1gload.c @@ -401,17 +401,20 @@ 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 + if ( load_flags & FT_LOAD_VERTICAL_LAYOUT ) + { + /* 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 ); + } glyph->root.format = FT_GLYPH_FORMAT_OUTLINE; @@ -471,9 +474,12 @@ metrics->horiBearingX = cbox.xMin; metrics->horiBearingY = cbox.yMax; - /* make up vertical ones */ - ft_synthesize_vertical_metrics( metrics, - metrics->vertAdvance ); + if ( load_flags & FT_LOAD_VERTICAL_LAYOUT ) + { + /* make up vertical ones */ + ft_synthesize_vertical_metrics( metrics, + metrics->vertAdvance ); + } } /* Set control data to the glyph charstrings. Note that this is */