Mercurial > pidgin
diff src/util.c @ 764:a566fc987db9
[gaim-migrate @ 774]
apply default fonts and colors to an away message
committer: Tailor Script <tailor@pidgin.im>
| author | Todd Kulesza <fflewddur> |
|---|---|
| date | Fri, 25 Aug 2000 04:17:06 +0000 |
| parents | 9389216aae29 |
| children | bf31bf916f53 |
line wrap: on
line diff
--- a/src/util.c Fri Aug 25 02:59:42 2000 +0000 +++ b/src/util.c Fri Aug 25 04:17:06 2000 +0000 @@ -1106,3 +1106,30 @@ return; } + +void stylize(gchar *text, int length) +{ + gchar *buf; + + buf = g_malloc(length); + + if (font_options & OPT_FONT_FACE) + { + g_snprintf(buf, length, "<FONT FACE=\"%s\">%s</FONT>", fontface, text); + strcpy(text, buf); + } + + if (font_options & OPT_FONT_FGCOL) + { + g_snprintf(buf, length, "<FONT COLOR=\"#%02X%02X%02X\">%s</FONT>", fgcolor.red, fgcolor.green, fgcolor.blue, text); + strcpy(text, buf); + } + + if (font_options & OPT_FONT_BGCOL) + { + g_snprintf(buf, length, "<BODY BGCOLOR=\"#%02X%02X%02X\">%s</BODY>", bgcolor.red, bgcolor.green, bgcolor.blue, text); + strcpy(text, buf); + } + + g_free(buf); +} \ No newline at end of file
