From 76ee903d84d5b477016fb6ed6bdee1a21e237903 Mon Sep 17 00:00:00 2001 From: Vojtech Bocek Date: Sun, 7 Sep 2014 15:01:56 +0200 Subject: Add support for TrueType fonts * Keeps original font system in place * Uses the same API as original font system: - You can render only one line at a time - You can only use one font and color for one gr_text* call * Caches all rendered text, with a string cache limited to 400 entries, then it trucates to 250, which results in memory usage hovering around 5-10MB Change-Id: I36107b9dcd8d57bae4486fce8b8f64e49ef3d906 Signed-off-by: Vojtech Bocek --- gui/resources.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gui/resources.hpp') diff --git a/gui/resources.hpp b/gui/resources.hpp index 874836e52..3cb528176 100644 --- a/gui/resources.hpp +++ b/gui/resources.hpp @@ -38,6 +38,14 @@ typedef enum { class FontResource : public Resource { public: + enum Type + { + TYPE_TWRP, +#ifndef TW_DISABLE_TTF + TYPE_TTF, +#endif + }; + FontResource(xml_node<>* node, ZipArchive* pZip); virtual ~FontResource(); @@ -46,6 +54,7 @@ public: protected: void* mFont; + Type m_type; }; class ImageResource : public Resource -- cgit v1.2.3