summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-24 04:54:30 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-24 04:54:30 (GMT)
commit92662815ab7866d560436dcd98fd0236013a8d96 (patch)
treec1cc0026a3dd4a9191d9a34805d480cc0f61bcb7 /gfx
parent9639d046d91df27835e615db56b2debbc6249c58 (diff)
downloadeeshow-92662815ab7866d560436dcd98fd0236013a8d96.zip
eeshow-92662815ab7866d560436dcd98fd0236013a8d96.tar.gz
eeshow-92662815ab7866d560436dcd98fd0236013a8d96.tar.bz2
gfx/cro.c (cr_text_width): remove ~ (used for overlining)
Diffstat (limited to 'gfx')
-rw-r--r--gfx/cro.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gfx/cro.c b/gfx/cro.c
index 7dcb695..0be7cce 100644
--- a/gfx/cro.c
+++ b/gfx/cro.c
@@ -441,10 +441,19 @@ static unsigned cr_text_width(void *ctx, const char *s, unsigned size,
{
struct cro_ctx *cc = ctx;
cairo_text_extents_t ext;
+ char *t, *to;
+ const char *from;
+
+ t = stralloc(s);
+ for (from = to = t; *from; from++)
+ if (*from != '~')
+ *to++ = *from;
+ *to = 0;
select_font(cc, style);
cairo_set_font_size(cc->cr, cd(cc, size) * TEXT_STRETCH);
- cairo_text_extents(cc->cr, s, &ext);
+ cairo_text_extents(cc->cr, t, &ext);
+ free(t);
return dc(cc, ext.width);
}