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:
Aliaksandr Kalenik 2024-07-22 14:03:58 +03:00 committed by Andreas Kling
commit 2ead999f2b
Notes: github-actions[bot] 2024-07-22 13:05:57 +00:00
19 changed files with 154 additions and 150 deletions

View file

@ -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;