A better fix for Savannah bug #43392. Suggested by Doug Felt <dougfelt@gmail.com>. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Set `vertAdvance' to zero... * src/truetype/ttgload.c (TT_Load_Glyph): ... and set here a default value for `vertAdvance' based on `linearVertAdvance' in case `vertAdvance' is zero. Note that the previous computed ad-hoc value for `linearVertAdvance' was apparently not tested in a real-life situation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
diff --git a/ChangeLog b/ChangeLog
index a71b8f0..b94ec5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,20 @@
out of range.
(Ins_DELTAP, Ins_DELTAC): Optimize for legal delta_shift.
+2014-10-16 Werner Lemberg <wl@gnu.org>
+
+ A better fix for Savannah bug #43392.
+ Suggested by Doug Felt <dougfelt@gmail.com>.
+
+ * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Set
+ `vertAdvance' to zero...
+
+ * src/truetype/ttgload.c (TT_Load_Glyph): ... and set here a default
+ value for `vertAdvance' based on `linearVertAdvance' in case
+ `vertAdvance' is zero. Note that the previous computed ad-hoc value
+ for `linearVertAdvance' was apparently not tested in a real-life
+ situation.
+
2014-10-14 David Weiß <David.Weiss@ptvgroup.com>
[build] Better optimization settings for vc2010 solution file.
diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c
index 8899a03..7450b4b 100644
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -510,7 +510,7 @@
/* avoid uninitialized data in case there is no vertical info -- */
metrics->vertBearingX = 0;
metrics->vertBearingY = 0;
- metrics->vertAdvance = metrics->width;
+ metrics->vertAdvance = 0;
}
decoder->metrics_loaded = 1;
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index ff2b339..2ab6f76 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -2373,15 +2373,18 @@
(void)tt_loader_init( &loader, size, glyph, load_flags, TRUE );
(void)load_truetype_glyph( &loader, glyph_index, 0, TRUE );
glyph->linearHoriAdvance = loader.linear;
- glyph->linearVertAdvance = loader.top_bearing + loader.bbox.yMax -
- loader.vadvance;
+ glyph->linearVertAdvance = loader.vadvance;
- /* sanity check: if `horiAdvance' in the sbit metric */
- /* structure isn't set, use `linearHoriAdvance' */
+ /* sanity checks: if `xxxAdvance' in the sbit metric */
+ /* structure isn't set, use `linearXXXAdvance' */
if ( !glyph->metrics.horiAdvance && glyph->linearHoriAdvance )
glyph->metrics.horiAdvance =
FT_MulFix( glyph->linearHoriAdvance,
size->root.metrics.x_scale );
+ if ( !glyph->metrics.vertAdvance && glyph->linearVertAdvance )
+ glyph->metrics.vertAdvance =
+ FT_MulFix( glyph->linearVertAdvance,
+ size->root.metrics.y_scale );
}
return FT_Err_Ok;