From a3785935df081674d048655048984bcba09f8387 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 2 Mar 2016 08:03:53 -0800 Subject: Rejig Bidirectional and Text code. We move to using bidirectional "levels" throughout. This should give us better behaviour vis-a-vis nested l2r/l2r text. This also allows us to carry xps levels throughout with no loss of information. This also avoids the need to special case numbers. We accordingly carry more information into fz_text. As well as wmode, also hold additional details about the text spans. We now include the directionality of the bidi level text (either as derived from bidi code, or from the original document (e.g. xps)), the directionality of text (as specified in the original document (e.g. html)), and the language of the text (if specified in the original document). --- source/xps/xps-glyphs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/xps') diff --git a/source/xps/xps-glyphs.c b/source/xps/xps-glyphs.c index 624276f8..91c53743 100644 --- a/source/xps/xps-glyphs.c +++ b/source/xps/xps-glyphs.c @@ -408,6 +408,7 @@ xps_parse_glyphs_imp(fz_context *ctx, xps_document *doc, const fz_matrix *ctm, float u_offset = 0; float v_offset = 0; float advance; + int dir; if (is && *is) is = xps_parse_glyph_index(is, &glyph_index); @@ -450,7 +451,8 @@ xps_parse_glyphs_imp(fz_context *ctx, xps_document *doc, const fz_matrix *ctm, tm.f = y - v_offset; } - fz_show_glyph(ctx, text, font, &tm, glyph_index, char_code, is_sideways); + dir = bidi_level & 1 ? FZ_DIR_R2L : FZ_DIR_L2R; + fz_show_glyph(ctx, text, font, &tm, glyph_index, char_code, is_sideways, bidi_level, dir, fz_lang_unset); x += advance * 0.01f * size; } -- cgit v1.2.3