1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:57:45 +00:00

Make a SharedGraphics directory for classes shared between Kernel and LibGUI.

This commit is contained in:
Andreas Kling 2019-01-19 23:22:46 +01:00
parent b75ee4aacb
commit 7e5b81fe48
31 changed files with 49 additions and 41 deletions

32
SharedGraphics/Font.h Normal file
View file

@ -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 };
};