Kernel: prefs font does not allocate extra buffer

This commit is contained in:
Bananymous 2023-03-20 14:59:30 +02:00
parent 22e45278a2
commit faf1b661bb
1 changed files with 5 additions and 7 deletions

View File

@ -11,19 +11,17 @@
#define PSF2_HAS_UNICODE_TABLE 0x00000001
extern char _binary_font_prefs_psf_start;
extern char _binary_font_prefs_psf_end;
extern uint8_t _binary_font_prefs_psf_start[];
extern uint8_t _binary_font_prefs_psf_end[];
namespace Kernel
{
BAN::ErrorOr<Font> Font::prefs()
{
size_t font_data_size = &_binary_font_prefs_psf_end - &_binary_font_prefs_psf_start;
BAN::Vector<uint8_t> font_data;
TRY(font_data.resize(font_data_size));
memcpy(font_data.data(), &_binary_font_prefs_psf_start, font_data_size);
return parse_psf1(font_data.span());
size_t font_data_size = _binary_font_prefs_psf_end - _binary_font_prefs_psf_start;
BAN::Span<uint8_t> font_data(_binary_font_prefs_psf_start, font_data_size);
return parse_psf1(font_data);
}
BAN::ErrorOr<Font> Font::load(BAN::StringView path)