diff --git a/libraries/ZWidget/src/core/canvas.cpp b/libraries/ZWidget/src/core/canvas.cpp index 243c829300..de42a225f7 100644 --- a/libraries/ZWidget/src/core/canvas.cpp +++ b/libraries/ZWidget/src/core/canvas.cpp @@ -46,9 +46,9 @@ public: class CanvasFont { public: - CanvasFont(const std::string& fontname, double height) : fontname(fontname), height(height) + CanvasFont(const std::string& fontname, double height, std::vector& _data) : fontname(fontname), height(height) { - ttf = std::make_unique(LoadWidgetFontData(fontname)); + ttf = std::make_unique(_data); textmetrics = ttf->GetTextMetrics(height); } @@ -310,7 +310,7 @@ public: return nullptr; } - SFT_LMetrics& GetTextMetrics() + TrueTypeTextMetrics& GetTextMetrics() { return fonts[0].font->textmetrics; } @@ -398,7 +398,7 @@ BitmapCanvas::BitmapCanvas(DisplayWindow* window) : window(window) uiscale = window->GetDpiScale(); uint32_t white = 0xffffffff; whiteTexture = createTexture(1, 1, &white); - font = std::make_unique("NotoSans", 16.0 * uiscale); + font = std::make_unique("NotoSans", 15.0 * uiscale); } BitmapCanvas::~BitmapCanvas()