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

Support font files.

This only works with the userspace build of SharedGraphics so far.
It's also very slow at loading fonts, but that's easy to fix.

Let's put fonts in /res/fonts/.
This commit is contained in:
Andreas Kling 2019-02-02 23:13:12 +01:00
parent 655753c557
commit 7f91aec25c
7 changed files with 170 additions and 10 deletions

View file

@ -16,6 +16,11 @@ public:
m_buffer[m_offset++] = value & 0xffu;
}
void operator<<(char value)
{
m_buffer[m_offset++] = (byte)value;
}
void operator<<(word value)
{
m_buffer[m_offset++] = value & 0xffu;
@ -43,9 +48,20 @@ public:
m_buffer[m_offset++] = value[i];
}
void operator<<(const ByteBuffer& value)
{
for (size_t i = 0; i < value.size(); ++i)
m_buffer[m_offset++] = value[i];
}
bool at_end() const
{
return m_offset == m_buffer.size();
}
void fill_to_end(byte ch)
{
while (m_offset < m_buffer.size())
while (!at_end())
m_buffer[m_offset++] = ch;
}