]> git.webhop.me Git - lcd4linux.git/commitdiff
magic bold escape char by Andrew Thompson
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Wed, 27 Jul 2011 05:41:22 +0000 (05:41 +0000)
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Wed, 27 Jul 2011 05:41:22 +0000 (05:41 +0000)
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1155 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

drv_generic_graphic.c

index 985544fe257ad6a73d1b67af14086eb18e6aa7f7..57d4cdc8ca195caa27bfd468ee1f437aac5419f3 100644 (file)
@@ -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];