diff options
author | michael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2011-07-27 05:41:22 +0000 |
---|---|---|
committer | michael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2011-07-27 05:41:22 +0000 |
commit | e6130f4f65e122c49dc9ec5fb87645750c73fc75 (patch) | |
tree | e6729e826bf20a2bae4ad69c8cd10b8a8020af0e | |
parent | bd2948ce2f83dfac5095f9cefc80b76e402198c2 (diff) | |
download | lcd4linux-e6130f4f65e122c49dc9ec5fb87645750c73fc75.tar.gz |
magic bold escape char by Andrew Thompson
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1155 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to '')
-rw-r--r-- | drv_generic_graphic.c | 10 |
1 files changed, 9 insertions, 1 deletions
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]; |