LibGfx: Load fonts with .ttc extension in FontDatabase

That's required for emoji support on macOS where "Apple Color Emoji"
font has TrueType Collection format.
This commit is contained in:
Aliaksandr Kalenik 2024-09-05 22:34:35 +02:00 committed by Tim Flynn
parent 67fe8d66b2
commit c88e76add7
Notes: github-actions[bot] 2024-09-06 12:31:45 +00:00

View file

@ -52,7 +52,7 @@ void FontDatabase::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)) {
if (path.has_extension(".ttf"sv) || path.has_extension(".ttc"sv)) {
// FIXME: What about .otf
if (auto font_or_error = Typeface::try_load_from_resource(resource); !font_or_error.is_error()) {
auto font = font_or_error.release_value();