1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 19:17:44 +00:00

LibPDF: Implement CFF supplemental encoding

The main encoding data maps glyph ID ("GID") to its codepoint.
If a glyph has several codepoints, then a secondary table mapping
codepoint to string ID ("SID") of the glyph's name is present.

(A separate table associates each glyph with its name already.)

I haven't seen this used in the wild, but the structure of the
supplemental data is also going to be needed for built-in encodings.
This commit is contained in:
Nico Weber 2023-10-16 16:21:08 -04:00 committed by Andreas Kling
parent 37daeae6fd
commit 1cfe639b6c
2 changed files with 20 additions and 7 deletions

View file

@ -98,7 +98,7 @@ public:
static DeprecatedFlyString resolve_sid(SID, Vector<StringView> const&);
static PDFErrorOr<Vector<DeprecatedFlyString>> parse_charset(Reader&&, size_t, Vector<StringView> const&);
static PDFErrorOr<Vector<u8>> parse_encoding(Reader&&);
static PDFErrorOr<Vector<u8>> parse_encoding(Reader&&, HashMap<Card8, SID>& supplemental);
};
}