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: https://github.com/SerenityOS/serenity/commit/2971ae59d8 Pull-request: https://github.com/SerenityOS/serenity/pull/20594
1 changed files with 5 additions and 5 deletions
|
@ -818,12 +818,12 @@ 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));
|
||||
}
|
||||
// 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
Reference in a new issue