From eebfb1eb6517ff6441613bb3280ba57746f361ea Mon Sep 17 00:00:00 2001 From: Bastian Maerkisch Date: Wed, 6 Dec 2017 07:10:55 +0100 Subject: [PATCH] Bold/italic attribute support for export to svg --- caca/codec/export.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/caca/codec/export.c b/caca/codec/export.c index 1bb7bab..0bc4718 100644 --- a/caca/codec/export.c +++ b/caca/codec/export.c @@ -888,10 +888,13 @@ static void *export_svg(caca_canvas_t const *cv, size_t *bytes) continue; } - cur += sprintf(cur, "", - caca_attr_to_rgb12_fg(*lineattr++), + caca_attr_to_rgb12_fg(*lineattr), + (*lineattr & CACA_BOLD) ? " font-weight=\"bold\"" : "", + (*lineattr & CACA_ITALICS) ? " font-style=\"italic\"" : "", x * 6, (y * 10) + 8); + lineattr++; if(ch < 0x00000020) *cur++ = '?';