1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:37:34 +00:00

LibGfx+Utilities: Add helpers to load vector fonts from Core::Resources

This commit is contained in:
Andrew Kaster 2023-10-18 14:12:42 -06:00 committed by Andrew Kaster
parent 286dc6df7f
commit 86ce502ae2
8 changed files with 19 additions and 21 deletions

View file

@ -168,7 +168,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_option(no_color, "Disable syntax highlighting", "no-color", 'n');
args_parser.parse(arguments);
auto font = TRY(OpenType::Font::try_load_from_file(font_path));
auto resource = TRY(Core::Resource::load_from_filesystem(font_path));
auto font = TRY(OpenType::Font::try_load_from_resource(resource));
if (dump_font_program)
print_disassembly("Font program"sv, font->font_program(), !no_color);