1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:57:45 +00:00

LibPDF: Implement reading of CFF String Index

Only really useful for reading SIDs in the Top DICT (copyright
text etc), which we currently don't do.

I haven't seen a difference from looking things up in the string
table. The only real effect from the commit that I need is that
it pulls a local resolve() labmda into a real function
resolve_sid(), which I want to call in a future commit.

But it makes things more spec-compliant, and if we ever want to
read SIDs in metadata in the future, now we can.
This commit is contained in:
Nico Weber 2023-10-12 10:53:01 -04:00 committed by Andreas Kling
parent 9e3ee0e2b5
commit aba787a441
2 changed files with 32 additions and 14 deletions

View file

@ -85,9 +85,12 @@ public:
template<typename OperatorT>
static PDFErrorOr<OperatorT> parse_dict_operator(u8, Reader&);
static PDFErrorOr<Vector<StringView>> parse_strings(Reader&);
static PDFErrorOr<Vector<CFF::Glyph>> parse_charstrings(Reader&&, Vector<ByteBuffer> const& subroutines);
static PDFErrorOr<Vector<DeprecatedFlyString>> parse_charset(Reader&&, size_t);
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&&);
};