ref: 63e7aac34f899f1e251bc4846f2c9ce95098953b
parent: 980b76ea5e189f42259d559df19024cd4fe22aca
author: Ken Sharp <[email protected]>
date: Wed Feb 10 02:13:27 EST 2010
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.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,17 @@
-2010-01-27 Ken Sharp <[email protected]>
+2010-02-10 Ken Sharp <[email protected]>
+
+ 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 <[email protected]>
Really fix Savannah bug #28678 (part 1).
--- 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 );
+ }
}
}
--- 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:
--- 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 */