ladybird/Widgets/Font.h

33 lines
742 B
C
Raw Normal View History

2018-10-12 00:45:57 +03:00
#pragma once
2019-01-10 07:41:49 +03:00
#include "CharacterBitmap.h"
2018-10-12 00:45:57 +03:00
#include <AK/Retainable.h>
#include <AK/RetainPtr.h>
2018-10-12 00:45:57 +03:00
#include <AK/Types.h>
class Font : public Retainable<Font> {
public:
static Font& defaultFont();
~Font();
2019-01-10 07:41:49 +03:00
const CharacterBitmap* glyphBitmap(byte) const;
2018-10-12 00:45:57 +03:00
2018-10-12 00:54:34 +03:00
byte glyphWidth() const { return m_glyphWidth; }
byte glyphHeight() const { return m_glyphHeight; }
2018-10-12 00:45:57 +03:00
static void initialize();
2018-10-12 00:45:57 +03:00
private:
2018-10-12 00:54:34 +03:00
Font(const char* const* glyphs, byte glyphWidth, byte glyphHeight, byte firstGlyph, byte lastGlyph);
2018-10-12 00:45:57 +03:00
const char* const* m_glyphs { nullptr };
2019-01-10 07:41:49 +03:00
mutable RetainPtr<CharacterBitmap> m_bitmaps[256];
2018-10-12 00:45:57 +03:00
2018-10-12 00:54:34 +03:00
byte m_glyphWidth { 0 };
byte m_glyphHeight { 0 };
2018-10-12 00:45:57 +03:00
byte m_firstGlyph { 0 };
byte m_lastGlyph { 0 };
};