mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09: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
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibGfx/Font/WOFF2/Typeface.h>
|
||||
#include <LibGfx/Font/WOFF2/Loader.h>
|
||||
#include <LibTest/TestCase.h>
|
||||
|
||||
#define TEST_INPUT(x) ("test-inputs/" x)
|
||||
|
@ -12,7 +12,7 @@
|
|||
TEST_CASE(tolerate_incorrect_sfnt_size)
|
||||
{
|
||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("woff2/incorrect_sfnt_size.woff2"sv)));
|
||||
auto font = TRY_OR_FAIL(WOFF2::Typeface::try_load_from_externally_owned_memory(file->bytes()));
|
||||
auto font = TRY_OR_FAIL(WOFF2::try_load_from_externally_owned_memory(file->bytes()));
|
||||
EXPECT_EQ(font->family(), "Test"_string);
|
||||
EXPECT_EQ(font->glyph_count(), 4u);
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ TEST_CASE(malformed_woff2)
|
|||
|
||||
for (auto test_input : test_inputs) {
|
||||
auto file = MUST(Core::MappedFile::map(test_input));
|
||||
auto font_or_error = WOFF2::Typeface::try_load_from_externally_owned_memory(file->bytes());
|
||||
auto font_or_error = WOFF2::try_load_from_externally_owned_memory(file->bytes());
|
||||
EXPECT(font_or_error.is_error());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue