mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:17:35 +00:00
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
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)
|
PDFErrorOr<Vector<u8>> CFF::parse_encoding(Reader&& reader)
|
||||||
{
|
{
|
||||||
Vector<u8> encoding_codes;
|
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) {
|
if (format == 0) {
|
||||||
auto n_codes = TRY(reader.try_read<Card8>());
|
auto n_codes = TRY(reader.try_read<Card8>());
|
||||||
for (u8 i = 0; i < n_codes; i++) {
|
for (u8 i = 0; i < n_codes; i++) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue