-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathFastFont.h
More file actions
22 lines (19 loc) · 701 Bytes
/
FastFont.h
File metadata and controls
22 lines (19 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once
#include "displayapp/LittleVgl.h"
#include <memory>
namespace Pinetime {
namespace Components {
namespace FastFont {
// Since the font pointer is actually a u8 array containing all loaded font data
// we need to use the deleter for the true datatype rather than the single struct
struct CastingDeleter {
void operator()(lv_font_t* fontData) const {
auto* fontDataReal = reinterpret_cast<uint8_t*>(fontData);
std::default_delete<uint8_t[]> {}(fontDataReal);
}
};
using Font = std::unique_ptr<lv_font_t, CastingDeleter>;
Font LoadFont(Pinetime::Controllers::FS& filesystem, const char* fontPath);
}
}
}