9#ifndef MAXOS_COMMON_FONT_H
10#define MAXOS_COMMON_FONT_H
34 explicit Font(
const uint8_t* font_data);
Stores the red, green, blue and alpha values of a colour. Can be parsed from a hex string,...
Draws pixels to the screen, and handles drawing lines, rectangles and circles.
Stores the left, top, width and height of a rectangle.
A class that can be used to draw text.
bool is_underlined
Should the font be drawn with an underline.
bool is_strikethrough
Should the font be drawn with a strikethrough.
uint8_t m_font8x8[2048]
The 8x8 font data.
virtual size_t get_text_width(string)
Get the width of the text.
bool m_is_8_by_8
Is the font 8 pixels by 8 pixels per character.
virtual void draw_text(int32_t x, int32_t y, common::Colour foreground_colour, common::Colour background_colour, common::GraphicsContext *context, string text)
write the entire text to the screen
virtual size_t get_text_height(string)
Get the height of the text.
bool is_italic
Should the font be drawn in italic.
bool is_bold
Should the font be drawn in bold.
constexpr uint8_t FONT_HEIGHT
How many pixels tall the font is.
constexpr uint8_t FONT_WIDTH
How many pixels wide the font is.
constexpr uint8_t FONT_PADDING
How many vertical pixels to add to the top and bottom of the font to prevent squishing.
Defines a GraphicsContext class for drawing pixels, lines, rectangles and circles to the screen.
Defines a Rectangle class for storing rectangle dimensions and performing rectangle operations.
Defines a String class for dynamically sized strings with various operations.