diff options
author | Mattias Andrée <maandree@kth.se> | 2022-07-17 16:59:23 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2022-07-17 17:00:04 +0200 |
commit | 5321d4ea143407b9f1233c46978bbbb17f2d64d3 (patch) | |
tree | 5bed7cbf584ddb7c600ae670262cc7c41e94b7ab | |
parent | Fix two bugs and add documentation (diff) | |
download | libparsepsf-5321d4ea143407b9f1233c46978bbbb17f2d64d3.tar.gz libparsepsf-5321d4ea143407b9f1233c46978bbbb17f2d64d3.tar.bz2 libparsepsf-5321d4ea143407b9f1233c46978bbbb17f2d64d3.tar.xz |
Fix support for unimap-free fonts
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | libparsepsf.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libparsepsf.c b/libparsepsf.c index 485cce1..a3be5f3 100644 --- a/libparsepsf.c +++ b/libparsepsf.c @@ -417,14 +417,14 @@ libparsepsf_get_glyph(const struct libparsepsf_font *font, const char *c, size_t errno = EILSEQ; return 0; } - if (remp) - rem = *remp - n; - c = &c[n]; glyph = (size_t)cp; if (glyph >= font->num_glyphs) return 0; - glyph += 1; - goto out; + if (next_cp) + *next_cp = &c[n]; + if (remp) + *remp = *remp - n; + return glyph + 1; } else if (remp) { rem = *remp; @@ -459,7 +459,6 @@ libparsepsf_get_glyph(const struct libparsepsf_font *font, const char *c, size_t } glyph = node->terminal[*(const uint8_t *)c]; -out: if (glyph) { if (next_cp) *next_cp = &c[1]; |