LibGfx: Enable otf fonts

This commit is contained in:
blukai 2025-05-21 02:27:08 +02:00 committed by Andrew Kaster
commit 6e00a38099
Notes: github-actions[bot] 2025-05-26 18:15:45 +00:00

View file

@ -31,8 +31,7 @@ void PathFontProvider::load_all_fonts_from_uri(StringView uri)
root->for_each_descendant_file([this](Core::Resource const& resource) -> IterationDecision {
auto uri = resource.uri();
auto path = LexicalPath(uri.bytes_as_string_view());
if (path.has_extension(".ttf"sv) || path.has_extension(".ttc"sv)) {
// FIXME: What about .otf
if (path.has_extension(".ttf"sv) || path.has_extension(".ttc"sv) || path.has_extension(".otf"sv)) {
if (auto font_or_error = Typeface::try_load_from_resource(resource); !font_or_error.is_error()) {
auto font = font_or_error.release_value();
auto& family = m_typeface_by_family.ensure(font->family(), [] {