mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:17:35 +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
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));
|
TRY(append_i16(point.y));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// NOTE: Make sure each glyph starts on a 4-byte boundary.
|
// 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.
|
// I haven't found the spec text for this, but it matches other implementations.
|
||||||
while (reconstructed_glyf_table.size() % 4 != 0) {
|
while (reconstructed_glyf_table.size() % 4 != 0) {
|
||||||
TRY(reconstructed_glyf_table.try_append(0));
|
TRY(reconstructed_glyf_table.try_append(0));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TRY(loca_indexes.try_append(starting_glyf_table_size));
|
TRY(loca_indexes.try_append(starting_glyf_table_size));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue