diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2012-07-17 18:05:05 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-07-17 18:05:05 +0200 |
commit | 4091b7a357728aed033216baafed540b795bcf9e (patch) | |
tree | ad0cd73cc428bc8922d1eaa94663479c04192edb /fitz/res_path.c | |
parent | 2b857ab9878d5ca8acd862ae58dafa8d269bc502 (diff) | |
download | mupdf-4091b7a357728aed033216baafed540b795bcf9e.tar.xz |
Handle glyphs that are too large to render as pixmaps.
Diffstat (limited to 'fitz/res_path.c')
-rw-r--r-- | fitz/res_path.c | 34 |
1 files changed, 34 insertions, 0 deletions
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) { |