X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/9d18e10afb2439a6a9ba6978a799259746a837b7..b7864004487e7cc6129c3775dd66f8ad9a07528f:/project/commands/drawing/cmd_textw.c?ds=sidebyside diff --git a/project/commands/drawing/cmd_textw.c b/project/commands/drawing/cmd_textw.c index 53d57d3..151c344 100644 --- a/project/commands/drawing/cmd_textw.c +++ b/project/commands/drawing/cmd_textw.c @@ -44,9 +44,8 @@ #include "project/commands.h" // Generic helper functions #ifdef CFG_TFTLCD - #include "drivers/lcd/tft/lcd.h" - #include "drivers/lcd/tft/drawing.h" - #include "drivers/lcd/tft/fonts/dejavusans9.h" + #include "drivers/displays/tft/lcd.h" + #include "drivers/displays/tft/drawing.h" /**************************************************************************/ /*! @@ -73,8 +72,21 @@ void cmd_textw(uint8_t argc, char **argv) } *data_ptr++ = '\0'; - // User Vera Mono 9 by default for now - printf("%d %s", drawGetStringWidth(&dejaVuSans9ptFontInfo, data), CFG_PRINTF_NEWLINE); + #if CFG_TFTLCD_USEAAFONTS + switch (font) + { + default: // Only enough space for one font for now + printf("%d %s", aafontsGetStringWidth(&THEME_FONT, data), CFG_PRINTF_NEWLINE); + break; + } + #else + switch (font) + { + default: // Only enough space for one font for now + printf("%d %s", fontsGetStringWidth(&THEME_FONT, data), CFG_PRINTF_NEWLINE); + break; + } + #endif return; }