X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/9d18e10afb2439a6a9ba6978a799259746a837b7..bb58af2076c30e41d353ec193deddf54f6c3b8e8:/project/commands/drawing/cmd_text.c?ds=inline diff --git a/project/commands/drawing/cmd_text.c b/project/commands/drawing/cmd_text.c index ac3bc7c..871d5e0 100644 --- a/project/commands/drawing/cmd_text.c +++ b/project/commands/drawing/cmd_text.c @@ -48,6 +48,12 @@ #include "drivers/lcd/tft/drawing.h" #include "drivers/lcd/tft/fonts/dejavusans9.h" + // Only include this w/UART since there isn't enough space otherwise! + #ifdef CFG_PRINTF_UART + #include "drivers/lcd/tft/fonts/dejavusansmono8.h" + #include "drivers/lcd/tft/fonts/dejavusansbold9.h" + #endif + /**************************************************************************/ /*! Displays the supplied text on the LCD. @@ -77,8 +83,24 @@ void cmd_text(uint8_t argc, char **argv) } *data_ptr++ = '\0'; - // Only Vera Mono 9 is used by default - drawString((uint16_t)x, (uint16_t)y, (uint16_t)color, &dejaVuSans9ptFontInfo, (char *)&data); + // Only include this w/UART since there isn't enough space otherwise! + #ifdef CFG_PRINTF_UART + switch (font) + { + case 1: // DejaVu Sans Mono 8 + drawString((uint16_t)x, (uint16_t)y, (uint16_t)color, &dejaVuSansMono8ptFontInfo, (char *)&data); + break; + case 2: // DejaVu Sans Bold 9 + drawString((uint16_t)x, (uint16_t)y, (uint16_t)color, &dejaVuSansBold9ptFontInfo, (char *)&data); + break; + default: // DejaVu Sans 9 + drawString((uint16_t)x, (uint16_t)y, (uint16_t)color, &dejaVuSans9ptFontInfo, (char *)&data); + break; + } + #else + // Always use Vera Mono 9 is used by default + drawString((uint16_t)x, (uint16_t)y, (uint16_t)color, &dejaVuSans9ptFontInfo, (char *)&data); + #endif } #endif