LibPDF: Detect CFF encodings with supplements
These are not yet actually parsed, but detecting them means we at least don't fail to understand the *actual* format value, which was causing some CFF fonts to fail to load.
This commit is contained in:
parent
9bca62c5fa
commit
4a20751ff6
Notes:
sideshowbarker
2024-07-17 03:03:15 +09:00
Author: https://github.com/rtobar Commit: https://github.com/SerenityOS/serenity/commit/4a20751ff6 Pull-request: https://github.com/SerenityOS/serenity/pull/17683
1 changed files with 3 additions and 1 deletions
|
@ -412,7 +412,9 @@ PDFErrorOr<Vector<CFF::Glyph>> CFF::parse_charstrings(Reader&& reader, Vector<By
|
|||
PDFErrorOr<Vector<u8>> CFF::parse_encoding(Reader&& reader)
|
||||
{
|
||||
Vector<u8> encoding_codes;
|
||||
auto format = TRY(reader.try_read<Card8>());
|
||||
auto format_raw = TRY(reader.try_read<Card8>());
|
||||
// TODO: support encoding supplements when highest bit is set
|
||||
auto format = format_raw & 0x7f;
|
||||
if (format == 0) {
|
||||
auto n_codes = TRY(reader.try_read<Card8>());
|
||||
for (u8 i = 0; i < n_codes; i++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue