summaryrefslogtreecommitdiff
path: root/include/object
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-11-29 22:44:30 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-11-29 22:44:30 +0100
commitd4369b7abee295c95179028fd966272530055b03 (patch)
treec4d20ab8a7295539d6436b5b58e638e841588cf0 /include/object
parente54cf737b446355b5863a7f31fe4d5d89d037ea4 (diff)
fix terminus16; add framebuffer support for multi-byte font heights
Diffstat (limited to 'include/object')
-rw-r--r--include/object/framebuffer.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/object/framebuffer.h b/include/object/framebuffer.h
index c2edf22..119980a 100644
--- a/include/object/framebuffer.h
+++ b/include/object/framebuffer.h
@@ -9,12 +9,13 @@ class Framebuffer : public OutputStream
Framebuffer(Framebuffer& copy);
const glyph_t *font;
unsigned int fontX, fontY;
+ unsigned char fontSize;
unsigned char scale;
public:
unsigned char *data;
- Framebuffer(unsigned char *data) : font(0), fontX(0), fontY(0), scale(1), data(data) {}
+ Framebuffer(unsigned char *data) : font(0), fontX(0), fontY(0), fontSize(1), scale(1), data(data) {}
constexpr static unsigned int const width = CONFIG_framebuffer_width;
constexpr static unsigned int const height = CONFIG_framebuffer_height;
@@ -24,7 +25,7 @@ class Framebuffer : public OutputStream
void fillBox(unsigned int x, unsigned int y, unsigned int w, unsigned int h);
void drawAt(unsigned int x, unsigned int y, unsigned int w, unsigned int h, unsigned char *image);
void drawBattery(unsigned int x, unsigned int y, unsigned char percent, bool charging = false);
- void setFont(const glyph_t *font) { this->font = font; }
+ void setFont(const glyph_t *font, unsigned char fontSize = 1) { this->font = font; this->fontSize = fontSize; }
void setPos(unsigned int newX, unsigned int newY) { fontX = newX; fontY = newY; }
virtual void put(char c) override;
};