From 163c30cf09bfc9e02abbc85fd02905ee9136abb4 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Wed, 25 May 2016 00:37:04 +0200 Subject: stext: Non-initial glyphs in ligatures must set start/stop. Normal glyphs and inital glyphs in ligatures have their start/stop (p and q) set before determining whether to append to an existing span or insert a space. For non-initial glyphs the start/stop were never set which introduced uninitialized values into the span data structure. Now, all glyphs have their start/stop set and then if it is a non-initial glyph in a ligature the append and space detection is ignored. This means that no values are uninitialized. --- source/fitz/stext-device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/fitz/stext-device.c') diff --git a/source/fitz/stext-device.c b/source/fitz/stext-device.c index 94ff9fd6..87ba7cba 100644 --- a/source/fitz/stext-device.c +++ b/source/fitz/stext-device.c @@ -577,9 +577,6 @@ fz_add_stext_char_imp(fz_context *ctx, fz_stext_device *dev, fz_stext_style *sty float spacing = 0; float base_offset = 0; - if (glyph < 0) - goto no_glyph; - if (wmode == 0) { dir.x = 1; @@ -627,6 +624,9 @@ fz_add_stext_char_imp(fz_context *ctx, fz_stext_device *dev, fz_stext_style *sty q.y = trm->f; } + if (glyph < 0) + goto no_glyph; + if (dev->cur_span == NULL || trm->a != dev->cur_span->transform.a || trm->b != dev->cur_span->transform.b || trm->c != dev->cur_span->transform.c || trm->d != dev->cur_span->transform.d || -- cgit v1.2.3