Browse Source

Bold/italic attribute support for export to svg

tags/v0.99.beta20
Bastian Maerkisch 7 years ago
parent
commit
eebfb1eb65
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      caca/codec/export.c

+ 5
- 2
caca/codec/export.c View File

@@ -888,10 +888,13 @@ static void *export_svg(caca_canvas_t const *cv, size_t *bytes)
continue;
}

cur += sprintf(cur, "<text style=\"fill:#%.03x\" "
cur += sprintf(cur, "<text style=\"fill:#%.03x\"%s%s "
"x=\"%d\" y=\"%d\">",
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++ = '?';


Loading…
Cancel
Save