mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibGfx+LibWeb: Replace remaining OpenType implementation with Skia
This change should move us forward toward emoji support, as we are no longer limited by our own OpenType implementation, which was failing to parse the TrueType Collection format used to store emoji fonts (at least on macOS).
This commit is contained in:
parent
99f64139d0
commit
a9d5a99568
Notes:
github-actions[bot]
2024-09-05 17:22:50 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: a9d5a99568
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1278
Reviewed-by: https://github.com/trflynn89
40 changed files with 309 additions and 3201 deletions
|
@ -19,7 +19,6 @@
|
|||
#include <LibGfx/Font/Font.h>
|
||||
#include <LibGfx/Font/FontDatabase.h>
|
||||
#include <LibGfx/Font/FontStyleMapping.h>
|
||||
#include <LibGfx/Font/OpenType/Typeface.h>
|
||||
#include <LibGfx/Font/ScaledFont.h>
|
||||
#include <LibGfx/Font/Typeface.h>
|
||||
#include <LibGfx/Font/WOFF/Loader.h>
|
||||
|
@ -172,7 +171,7 @@ ErrorOr<NonnullRefPtr<Gfx::Typeface>> FontLoader::try_load_font()
|
|||
}
|
||||
if (mime_type.has_value()) {
|
||||
if (mime_type->essence() == "font/ttf"sv || mime_type->essence() == "application/x-font-ttf"sv) {
|
||||
if (auto result = OpenType::Typeface::try_load_from_externally_owned_memory(resource()->encoded_data()); !result.is_error()) {
|
||||
if (auto result = Gfx::Typeface::try_load_from_externally_owned_memory(resource()->encoded_data()); !result.is_error()) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -188,7 +187,7 @@ ErrorOr<NonnullRefPtr<Gfx::Typeface>> FontLoader::try_load_font()
|
|||
}
|
||||
}
|
||||
|
||||
auto ttf = OpenType::Typeface::try_load_from_externally_owned_memory(resource()->encoded_data());
|
||||
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