mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-29 06:06:40 +00:00
Check fontpath
This commit is contained in:
parent
2694231544
commit
ade134fdfd
@ -87,9 +87,9 @@ static uint8_t * charBitmap_p;
|
|||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
static void printBuffer(uint8_t * charBitmap_p, uint8_t w, uint8_t h);
|
|
||||||
static void colorsAdd(uint8_t * charBitmap_p, uint8_t color1, uint16_t pos);
|
static void colorsAdd(uint8_t * charBitmap_p, uint8_t color1, uint16_t pos);
|
||||||
static uint16_t unicode2codepoint(uint32_t unicode, uint8_t codepage);
|
// static uint16_t unicode2codepoint(uint32_t unicode, uint8_t codepage);
|
||||||
|
// static void printBuffer(uint8_t * charBitmap_p, uint8_t w, uint8_t h);
|
||||||
|
|
||||||
int lv_zifont_init(void)
|
int lv_zifont_init(void)
|
||||||
{
|
{
|
||||||
@ -99,6 +99,8 @@ int lv_zifont_init(void)
|
|||||||
|
|
||||||
static inline bool openFont(File & file, const char * filename)
|
static inline bool openFont(File & file, const char * filename)
|
||||||
{
|
{
|
||||||
|
if(*filename != '/') return false;
|
||||||
|
|
||||||
file = SPIFFS.open(filename, "r");
|
file = SPIFFS.open(filename, "r");
|
||||||
if(!file) {
|
if(!file) {
|
||||||
// Log.error(F("FONT: %sOpening font: %s"), filename);
|
// Log.error(F("FONT: %sOpening font: %s"), filename);
|
||||||
@ -354,7 +356,7 @@ const uint8_t * IRAM_ATTR lv_font_get_bitmap_fmt_zifont(const lv_font_t * font,
|
|||||||
|
|
||||||
// while((fileindex < charInfo->length) && len > 0) { //} && !feof(file)) {
|
// while((fileindex < charInfo->length) && len > 0) { //} && !feof(file)) {
|
||||||
while(arrindex < size && len > 0) { // read untill the bitmap is full, no need for datalength
|
while(arrindex < size && len > 0) { // read untill the bitmap is full, no need for datalength
|
||||||
if(sizeof(data) < charInfo->length - fileindex) {
|
if((int32_t)sizeof(data) < charInfo->length - fileindex) {
|
||||||
len = file.readBytes(data, sizeof(data));
|
len = file.readBytes(data, sizeof(data));
|
||||||
} else {
|
} else {
|
||||||
len = file.readBytes(data, charInfo->length - fileindex);
|
len = file.readBytes(data, charInfo->length - fileindex);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user