1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 09:34:57 +09:00

LibGfx: Rename WOFF[2]::try_load_from_externally_owned_memory()

Typeface::try_load_from_externally_owned_memory() relies on that
external owner keeping the memory around. However, neither WOFF nor
WOFF2 do so - they both create separate ByteBuffers to hold the TTF
data. So, rename them to make it clearer that they don't have any
requirements on the byte owner.
This commit is contained in:
Sam Atkins 2025-05-02 17:46:51 +01:00
parent 23009779e1
commit 6b762331df
Notes: github-actions[bot] 2025-05-03 11:03:42 +00:00
10 changed files with 14 additions and 14 deletions

View file

@ -23,7 +23,7 @@ struct Global {
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::try_load_from_externally_owned_memory(file->bytes()));
auto font = TRY_OR_FAIL(WOFF2::try_load_from_bytes(file->bytes()));
EXPECT_EQ(font->family(), "Test"_string);
EXPECT_EQ(font->glyph_count(), 4u);
}
@ -37,7 +37,7 @@ TEST_CASE(malformed_woff2)
for (auto test_input : test_inputs) {
auto file = MUST(Core::MappedFile::map(test_input));
auto font_or_error = WOFF2::try_load_from_externally_owned_memory(file->bytes());
auto font_or_error = WOFF2::try_load_from_bytes(file->bytes());
EXPECT(font_or_error.is_error());
}
}