25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

28 lines
526 B

  1. #include "core/display.h"
  2. #include "epaper/EPD.h"
  3. #include "PagePrinter.h"
  4. #include "esp_log.h"
  5. static const char *TAG = "PagePrinter";
  6. //int pageFont = DEFAULT_FONT;
  7. int pageFont = DEJAVU18_FONT;
  8. PagePrinter::PagePrinter()
  9. {}
  10. void PagePrinter::print(Page* page)
  11. {
  12. if (page->text == NULL) {
  13. ESP_LOGE(TAG, "Page text is NULL");
  14. return;
  15. }
  16. if (page->len == 0) {
  17. return;
  18. }
  19. EPD_setFont(pageFont, NULL);
  20. text_wrap = 1;
  21. EPD_print(page->text, 0, 0);
  22. //EPD_UpdateScreen();
  23. }