diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-01-19 23:22:46 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-01-19 23:22:46 +0100 |
commit | 7e5b81fe4807f89868af61ab27b53f003d607167 (patch) | |
tree | 219fa209115c2708d56be06205aff43b01279cf3 /SharedGraphics/Font.h | |
parent | b75ee4aacbf41539d73f494da5aba468310b71b9 (diff) | |
download | serenity-7e5b81fe4807f89868af61ab27b53f003d607167.zip |
Make a SharedGraphics directory for classes shared between Kernel and LibGUI.
Diffstat (limited to 'SharedGraphics/Font.h')
-rw-r--r-- | SharedGraphics/Font.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/SharedGraphics/Font.h b/SharedGraphics/Font.h new file mode 100644 index 0000000000..c420b8eef9 --- /dev/null +++ b/SharedGraphics/Font.h @@ -0,0 +1,32 @@ +#pragma once + +#include "CharacterBitmap.h" +#include <AK/Retainable.h> +#include <AK/RetainPtr.h> +#include <AK/Types.h> + +class Font : public Retainable<Font> { +public: + static Font& default_font(); + + ~Font(); + + const CharacterBitmap* glyph_bitmap(byte) const; + + byte glyph_width() const { return m_glyph_width; } + byte glyph_height() const { return m_glyph_height; } + + static void initialize(); + +private: + Font(const char* const* glyphs, byte glyph_width, byte glyph_height, byte firstGlyph, byte lastGlyph); + + const char* const* m_glyphs { nullptr }; + mutable RetainPtr<CharacterBitmap> m_bitmaps[256]; + + byte m_glyph_width { 0 }; + byte m_glyph_height { 0 }; + + byte m_first_glyph { 0 }; + byte m_last_glyph { 0 }; +}; |