v1.0.0 reorg
[hackover2013-badge-firmware.git] / project / commands / drawing / cmd_textw.c
index 53d57d3..fdcd0aa 100644 (file)
 #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"  
+  #include "drivers/displays/tft/fonts/dejavusans9.h"
+
+  // Only include this w/UART since there isn't enough space otherwise!
+  #ifdef CFG_PRINTF_UART
+  #include "drivers/displays/tft/fonts/dejavusansmono8.h"
+  #include "drivers/displays/tft/fonts/dejavusansbold9.h"
+  #endif
 
 /**************************************************************************/
 /*! 
@@ -73,8 +79,25 @@ 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);
+  // Only include this w/UART since there isn't enough space otherwise!
+  #ifdef CFG_PRINTF_UART
+    switch (font)
+    {
+      case 1:   // DejaVu Sans Mono 8
+        printf("%d %s", fontsGetStringWidth(&dejaVuSansMono8ptFontInfo, data), CFG_PRINTF_NEWLINE);
+        break;
+      case 2:   // DejaVu Sans Bold 9
+        printf("%d %s", fontsGetStringWidth(&dejaVuSansBold9ptFontInfo, data), CFG_PRINTF_NEWLINE);
+        break;
+      default:  // DejaVu Sans 9        
+        printf("%d %s", fontsGetStringWidth(&dejaVuSans9ptFontInfo, data), CFG_PRINTF_NEWLINE);
+        break;
+    }
+  #else
+    // Always use DejaVu Sans 9 by default
+    printf("%d %s", fontsGetStringWidth(&dejaVuSans9ptFontInfo, data), CFG_PRINTF_NEWLINE);
+  #endif
+
 
   return;
 }
This page took 0.02043 seconds and 4 git commands to generate.