From 4091b7a357728aed033216baafed540b795bcf9e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 17 Jul 2012 18:05:05 +0200 Subject: Handle glyphs that are too large to render as pixmaps. --- fitz/res_path.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'fitz/res_path.c') diff --git a/fitz/res_path.c b/fitz/res_path.c index 7b429c43..d02ea560 100644 --- a/fitz/res_path.c +++ b/fitz/res_path.c @@ -63,6 +63,40 @@ grow_path(fz_context *ctx, fz_path *path, int n) path->last = path->len; } +fz_point +fz_currentpoint(fz_context *ctx, fz_path *path) +{ + fz_point c, m; + int i; + + c.x = c.y = m.x = m.y = 0; + i = 0; + + while (i < path->len) + { + switch (path->items[i++].k) + { + case FZ_MOVETO: + m.x = c.x = path->items[i++].v; + m.y = c.y = path->items[i++].v; + break; + case FZ_LINETO: + c.x = path->items[i++].v; + c.y = path->items[i++].v; + break; + case FZ_CURVETO: + i += 4; + c.x = path->items[i++].v; + c.y = path->items[i++].v; + break; + case FZ_CLOSE_PATH: + c = m; + } + } + + return c; +} + void fz_moveto(fz_context *ctx, fz_path *path, float x, float y) { -- cgit v1.2.3