mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 18:58:56 +00:00
LibWeb: Do not try to load a font if format detection has failed
Skia is more permissive when it comes to font loading, compared to our
own OpenType implementation, which it has superseded, parsing an invalid
TTF does not result in an error but rather produces a font that is
incorrectly displayed. This change updates the FontLoader to address
this behavior and to stop attempting to parse a font as a last resort
when format detection has failed.
Fixes regression on x.com when text is not displayed introduced in
a9d5a99568
This commit is contained in:
parent
6c608bac65
commit
2aa07e0e65
Notes:
github-actions[bot]
2024-09-10 05:41:14 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 2aa07e0e65
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1350
1 changed files with 0 additions and 3 deletions
|
@ -190,9 +190,6 @@ ErrorOr<NonnullRefPtr<Gfx::Typeface>> FontLoader::try_load_font()
|
|||
}
|
||||
}
|
||||
|
||||
auto ttf = Gfx::Typeface::try_load_from_externally_owned_memory(resource()->encoded_data());
|
||||
if (!ttf.is_error())
|
||||
return ttf.release_value();
|
||||
return Error::from_string_literal("Automatic format detection failed");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue