mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
2ead999f2b
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.
23 lines
580 B
C++
23 lines
580 B
C++
/*
|
|
* Copyright (c) 2023, Tim Ledbetter <timledbetter@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibGfx/Font/WOFF/Loader.h>
|
|
#include <LibTest/TestCase.h>
|
|
|
|
#define TEST_INPUT(x) ("test-inputs/" x)
|
|
|
|
TEST_CASE(malformed_woff)
|
|
{
|
|
Array test_inputs = {
|
|
TEST_INPUT("woff/invalid_sfnt_size.woff"sv)
|
|
};
|
|
|
|
for (auto test_input : test_inputs) {
|
|
auto file = MUST(Core::MappedFile::map(test_input));
|
|
auto font_or_error = WOFF::try_load_from_externally_owned_memory(file->bytes());
|
|
EXPECT(font_or_error.is_error());
|
|
}
|
|
}
|