2020-02-02 15:08:37 +00:00
|
|
|
#include "core/display.h"
|
2020-02-02 21:13:42 +00:00
|
|
|
#include "epaper/EPD.h"
|
2020-01-31 19:54:19 +00:00
|
|
|
#include "PagePrinter.h"
|
|
|
|
|
|
|
|
#include "esp_log.h"
|
|
|
|
static const char *TAG = "PagePrinter";
|
|
|
|
|
2020-02-01 00:04:11 +00:00
|
|
|
//int pageFont = DEFAULT_FONT;
|
|
|
|
int pageFont = DEJAVU18_FONT;
|
2020-01-31 19:54:19 +00:00
|
|
|
|
|
|
|
PagePrinter::PagePrinter()
|
|
|
|
{}
|
|
|
|
|
|
|
|
void PagePrinter::print(Page* page)
|
|
|
|
{
|
|
|
|
if (page->text == NULL) {
|
|
|
|
ESP_LOGE(TAG, "Page text is NULL");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (page->len == 0) {
|
|
|
|
return;
|
|
|
|
}
|
2020-02-01 00:04:11 +00:00
|
|
|
EPD_setFont(pageFont, NULL);
|
2020-01-31 19:54:19 +00:00
|
|
|
text_wrap = 1;
|
|
|
|
EPD_print(page->text, 0, 0);
|
2020-01-31 21:17:46 +00:00
|
|
|
//EPD_UpdateScreen();
|
2020-01-31 19:54:19 +00:00
|
|
|
|
|
|
|
}
|