From fa0bffa57e7e2164f0201b0f2fdc984d475674ae Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 9 Oct 2015 11:07:42 +0200 Subject: Keep spans of multiple fonts and sizes in one fz_text object. --- source/xps/xps-glyphs.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'source/xps') diff --git a/source/xps/xps-glyphs.c b/source/xps/xps-glyphs.c index 06d2820d..4434c4ed 100644 --- a/source/xps/xps-glyphs.c +++ b/source/xps/xps-glyphs.c @@ -348,7 +348,6 @@ xps_parse_glyphs_imp(fz_context *ctx, xps_document *doc, const fz_matrix *ctm, xps_glyph_metrics mtx; fz_text *text; fz_matrix tm; - float e, f; float x = originx; float y = originy; char *us = unicode; @@ -372,7 +371,7 @@ xps_parse_glyphs_imp(fz_context *ctx, xps_document *doc, const fz_matrix *ctm, else fz_scale(&tm, size, -size); - text = fz_new_text(ctx, font, &tm, is_sideways); + text = fz_new_text(ctx); while ((us && un > 0) || (is && *is)) { @@ -440,16 +439,16 @@ xps_parse_glyphs_imp(fz_context *ctx, xps_document *doc, const fz_matrix *ctm, if (is_sideways) { - e = x + u_offset + (mtx.vorg * size); - f = y - v_offset + (mtx.hadv * 0.5f * size); + tm.e = x + u_offset + (mtx.vorg * size); + tm.f = y - v_offset + (mtx.hadv * 0.5f * size); } else { - e = x + u_offset; - f = y - v_offset; + tm.e = x + u_offset; + tm.f = y - v_offset; } - fz_add_text(ctx, text, glyph_index, char_code, e, f); + fz_add_text(ctx, text, font, is_sideways, &tm, glyph_index, char_code); x += advance * 0.01f * size; } -- cgit v1.2.3