From e6130f4f65e122c49dc9ec5fb87645750c73fc75 Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 27 Jul 2011 05:41:22 +0000 Subject: magic bold escape char by Andrew Thompson git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1155 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- drv_generic_graphic.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drv_generic_graphic.c b/drv_generic_graphic.c index 985544f..57d4cdc 100644 --- a/drv_generic_graphic.c +++ b/drv_generic_graphic.c @@ -233,6 +233,7 @@ static void drv_generic_graphic_render(const int layer, const int row, const int const char *style, const char *txt) { int c, r, x, y, len; + int bold; /* sanity checks */ if (layer < 0 || layer >= LAYERS) { @@ -249,10 +250,17 @@ static void drv_generic_graphic_render(const int layer, const int row, const int c = col; /* render text into layout FB */ + bold = 0; while (*txt != '\0') { unsigned char *chr; - if (strstr(style, "bold") != NULL) { + /* magic char to toggle bold */ + if (*txt == '\a') { + bold ^= 1; + txt++; + continue; + } + if (bold || strstr(style, "bold") != NULL) { chr = Font_6x8_bold[(int) *(unsigned char *) txt]; } else { chr = Font_6x8[(int) *(unsigned char *) txt]; -- cgit v1.2.3