Issue #59: Fix character font encoding - do not use (1, 0) Mac Roman table if (3, 1) unicode table is present (according to spec)

This commit is contained in:
Jakub Melka 2023-07-05 15:38:31 +02:00
parent 198b8a54db
commit ae3c43f066

View File

@ -1412,6 +1412,12 @@ PDFFontPointer PDFFont::createFont(const PDFObject& object, const PDFDocument* d
} }
} }
} }
else if (!FT_Select_Charmap(face, FT_ENCODING_UNICODE))
{
// if we have unicode mapping (3, 1), then we want to skip
// Mac Roman Encoding, according to PDF Specification 2.0.
// We will load encoding using unicode character map below.
}
else if (!FT_Select_Charmap(face, FT_ENCODING_APPLE_ROMAN)) else if (!FT_Select_Charmap(face, FT_ENCODING_APPLE_ROMAN))
{ {
// We have (1, 0) Mac Roman Encoding, which is slightly different, than Mac Roman Encoding defined // We have (1, 0) Mac Roman Encoding, which is slightly different, than Mac Roman Encoding defined