#pragma once #include #include #include namespace Kernel { class Font { public: static BAN::ErrorOr load(BAN::StringView); static BAN::ErrorOr prefs(); uint32_t width() const { return m_width; } uint32_t height() const { return m_height; } uint32_t pitch() const { return m_pitch; } bool has_glyph(uint32_t) const; const uint8_t* glyph(uint32_t) const; private: static BAN::ErrorOr parse_psf1(BAN::Span); static BAN::ErrorOr parse_psf2(BAN::Span); private: BAN::HashMap m_glyph_offsets; BAN::Vector m_glyph_data; uint32_t m_width = 0; uint32_t m_height = 0; uint32_t m_pitch = 0; }; }