forked from Bananymous/banan-os
Kernel: prefs font does not allocate extra buffer
This commit is contained in:
parent
22e45278a2
commit
faf1b661bb
|
@ -11,19 +11,17 @@
|
||||||
|
|
||||||
#define PSF2_HAS_UNICODE_TABLE 0x00000001
|
#define PSF2_HAS_UNICODE_TABLE 0x00000001
|
||||||
|
|
||||||
extern char _binary_font_prefs_psf_start;
|
extern uint8_t _binary_font_prefs_psf_start[];
|
||||||
extern char _binary_font_prefs_psf_end;
|
extern uint8_t _binary_font_prefs_psf_end[];
|
||||||
|
|
||||||
namespace Kernel
|
namespace Kernel
|
||||||
{
|
{
|
||||||
|
|
||||||
BAN::ErrorOr<Font> Font::prefs()
|
BAN::ErrorOr<Font> Font::prefs()
|
||||||
{
|
{
|
||||||
size_t font_data_size = &_binary_font_prefs_psf_end - &_binary_font_prefs_psf_start;
|
size_t font_data_size = _binary_font_prefs_psf_end - _binary_font_prefs_psf_start;
|
||||||
BAN::Vector<uint8_t> font_data;
|
BAN::Span<uint8_t> font_data(_binary_font_prefs_psf_start, font_data_size);
|
||||||
TRY(font_data.resize(font_data_size));
|
return parse_psf1(font_data);
|
||||||
memcpy(font_data.data(), &_binary_font_prefs_psf_start, font_data_size);
|
|
||||||
return parse_psf1(font_data.span());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BAN::ErrorOr<Font> Font::load(BAN::StringView path)
|
BAN::ErrorOr<Font> Font::load(BAN::StringView path)
|
||||||
|
|
Loading…
Reference in New Issue