mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
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:
committed by
Tim Flynn
parent
67fe8d66b2
commit
c88e76add7
@@ -52,7 +52,7 @@ void FontDatabase::load_all_fonts_from_uri(StringView uri)
|
|||||||
root->for_each_descendant_file([this](Core::Resource const& resource) -> IterationDecision {
|
root->for_each_descendant_file([this](Core::Resource const& resource) -> IterationDecision {
|
||||||
auto uri = resource.uri();
|
auto uri = resource.uri();
|
||||||
auto path = LexicalPath(uri.bytes_as_string_view());
|
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
|
// FIXME: What about .otf
|
||||||
if (auto font_or_error = Typeface::try_load_from_resource(resource); !font_or_error.is_error()) {
|
if (auto font_or_error = Typeface::try_load_from_resource(resource); !font_or_error.is_error()) {
|
||||||
auto font = font_or_error.release_value();
|
auto font = font_or_error.release_value();
|
||||||
|
|||||||
Reference in New Issue
Block a user