![]() |
Max OS 0.3
|
A class that can be used to draw text. More...
#include <font.h>
Public Member Functions | |
| Font (const uint8_t *font_data) | |
| Construct a new Font object. | |
| 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 void | draw_text (int32_t x, int32_t y, common::Colour foreground_colour, common::Colour background_colour, common::GraphicsContext *context, string text, common::Rectangle< int32_t > limit_area) |
| write the entire text to the screen | |
| virtual size_t | get_text_height (string) |
| Get the height of the text. | |
| virtual size_t | get_text_width (string) |
| Get the width of the text. | |
Public Attributes | |
| bool | is_bold { false } |
| Should the font be drawn in bold. | |
| bool | is_italic { false } |
| Should the font be drawn in italic. | |
| bool | is_underlined { false } |
| Should the font be drawn with an underline. | |
| bool | is_strikethrough { false } |
| Should the font be drawn with a strikethrough. | |
Protected Attributes | |
| bool | m_is_8_by_8 = { true } |
| Is the font 8 pixels by 8 pixels per character. | |
| uint8_t | m_font8x8 [2048] = { 0 } |
| The 8x8 font data. | |
Construct a new Font object.
| font_data | The 8x8 font data to use |
Definition at line 22 of file font.cpp.
References m_font8x8.
|
virtual |
write the entire text to the screen
| x | The x coordinate of the text |
| y | The y coordinate of the text |
| foreground_colour | The letter colour |
| background_colour | The background colour |
| context | The graphics context to draw the text on |
| text | The text to draw |
Definition at line 41 of file font.cpp.
References draw_text(), get_text_height(), and get_text_width().
Referenced by MaxOS::gui::widgets::Button::draw(), MaxOS::gui::widgets::InputBox::draw(), MaxOS::gui::widgets::Text::draw(), draw_text(), and MaxOS::drivers::console::VESABootConsole::put_character().
|
virtual |
write the entire text to the screen
| x | The x coordinate of the text |
| y | The y coordinate of the text |
| foreground_colour | The letter colour |
| background_colour | The background colour |
| context | The graphics context to draw the text on |
| text | The text to draw |
| limit_area | The area of the text to draw |
Definition at line 70 of file font.cpp.
References get_text_height(), get_text_width(), MaxOS::common::Rectangle< Type >::height, is_strikethrough, is_underlined, MaxOS::common::Rectangle< Type >::left, m_font8x8, MaxOS::common::Rectangle< Type >::top, and MaxOS::common::Rectangle< Type >::width.
Get the height of the text.
| text | The text to get the height of |
Definition at line 140 of file font.cpp.
Referenced by draw_text(), and draw_text().
Get the width of the text.
| text | The text to get the width of |
Definition at line 152 of file font.cpp.
Referenced by draw_text(), and draw_text().
| bool MaxOS::gui::Font::is_bold { false } |
| bool MaxOS::gui::Font::is_italic { false } |
| bool MaxOS::gui::Font::is_strikethrough { false } |
Should the font be drawn with a strikethrough.
Definition at line 40 of file font.h.
Referenced by draw_text().
| bool MaxOS::gui::Font::is_underlined { false } |
Should the font be drawn with an underline.
Definition at line 39 of file font.h.
Referenced by draw_text().
|
protected |
The 8x8 font data.
Definition at line 30 of file font.h.
Referenced by draw_text(), and Font().
|
protected |