summaryrefslogtreecommitdiff
path: root/source/xps
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-10-09 11:07:42 +0200
committerTor Andersson <tor.andersson@artifex.com>2015-12-11 13:02:33 +0100
commitfa0bffa57e7e2164f0201b0f2fdc984d475674ae (patch)
treead6a7d7bc8641e390552ba8c49fdba351de00f82 /source/xps
parente3275837d5738c5092b2e452829919e31ad553e5 (diff)
downloadmupdf-fa0bffa57e7e2164f0201b0f2fdc984d475674ae.tar.xz
Keep spans of multiple fonts and sizes in one fz_text object.
Diffstat (limited to 'source/xps')
-rw-r--r--source/xps/xps-glyphs.c13
1 files changed, 6 insertions, 7 deletions
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;
}