mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-16 06:22:17 +00:00
LibGfx/WOFF2: Align all reconstructed glyf entries to 4 bytes
It wasn't enough to do it only for simple glyphs, we need to do it for composite glyphs as well. Fixes an issue where some glyph data was misaligned in the output and thus ended up rendered incorrectly or not at all.
This commit is contained in:
parent
149ab91040
commit
2971ae59d8
Notes:
sideshowbarker
2024-07-17 09:37:30 +09:00
Author: https://github.com/awesomekling
Commit: 2971ae59d8
Pull-request: https://github.com/SerenityOS/serenity/pull/20594
1 changed files with 5 additions and 5 deletions
|
@ -818,13 +818,13 @@ static ErrorOr<GlyfAndLocaTableBuffers> create_glyf_and_loca_tables_from_transfo
|
|||
TRY(append_i16(point.y));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: Make sure each glyph starts on a 4-byte boundary.
|
||||
// I haven't found the spec text for this, but it matches other implementations.
|
||||
while (reconstructed_glyf_table.size() % 4 != 0) {
|
||||
TRY(reconstructed_glyf_table.try_append(0));
|
||||
}
|
||||
}
|
||||
|
||||
TRY(loca_indexes.try_append(starting_glyf_table_size));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue