mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibGfx+LibWeb: Remove typeface classes for WOFF fonts
This change removes wrappers inherited from Gfx::Typeface for WOFF and WOFF2 fonts. The only purpose they served is owning of ttf ByteBuffer produced by decoding a WOFF/WOFF2 font. Now new FontData class is responsible for holding ByteBuffer when a font is constructed from non-externally owned memory.
This commit is contained in:
parent
2497f43989
commit
2ead999f2b
Notes:
github-actions[bot]
2024-07-22 13:05:57 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 2ead999f2b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/762
19 changed files with 154 additions and 150 deletions
|
@ -7,8 +7,8 @@
|
|||
#include <LibCore/Promise.h>
|
||||
#include <LibGfx/Font/OpenType/Typeface.h>
|
||||
#include <LibGfx/Font/Typeface.h>
|
||||
#include <LibGfx/Font/WOFF/Typeface.h>
|
||||
#include <LibGfx/Font/WOFF2/Typeface.h>
|
||||
#include <LibGfx/Font/WOFF/Loader.h>
|
||||
#include <LibGfx/Font/WOFF2/Loader.h>
|
||||
#include <LibJS/Heap/Heap.h>
|
||||
#include <LibJS/Runtime/ArrayBuffer.h>
|
||||
#include <LibJS/Runtime/Realm.h>
|
||||
|
@ -40,12 +40,12 @@ static NonnullRefPtr<Core::Promise<NonnullRefPtr<Gfx::Typeface>>> load_vector_fo
|
|||
promise->resolve(ttf.release_value());
|
||||
return;
|
||||
}
|
||||
auto woff = WOFF::Typeface::try_load_from_externally_owned_memory(data);
|
||||
auto woff = WOFF::try_load_from_externally_owned_memory(data);
|
||||
if (!woff.is_error()) {
|
||||
promise->resolve(woff.release_value());
|
||||
return;
|
||||
}
|
||||
auto woff2 = WOFF2::Typeface::try_load_from_externally_owned_memory(data);
|
||||
auto woff2 = WOFF2::try_load_from_externally_owned_memory(data);
|
||||
if (!woff2.is_error()) {
|
||||
promise->resolve(woff2.release_value());
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue