You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add font fallback + Support for font IDs containing hyphens (#614)
* Add font choice fallback + fonts w/ hyphen
If a text stream is "decoded" and contains UTF-8 control characters, it probably wasn't decoded using the proper font code page. Add a loop that cycles through all the available fonts to see if there's a better decode choice. Resolves Issue 586.
As well, add the ability to parse font IDs containing dashes (-). Resolves Issue 145
* Update PDFObjectTest.php
Simplify these tests in case future edits change spacing rules.
* Refactor duplicate code into a function
* Use single quoted regexp
Let PCRE handle the conversion rather than PHP. Hopefully fixes PHPStan complaints about null byte.
* Add @param for $command and ?Page
* Proper indentation.
* fixing coding style issues in PDFObject.php
ref: https://cs.symfony.com/doc/rules/function_notation/nullable_type_declaration_for_default_null_value.html
* reverted coding style adaptions
* Remove test case PDF
Remove the Font ID with hyphen test case PDF as we could not contact the submitter to get permission to use it.
Change the unit test to directly test if a Font ID with a hyphen is correctly parsed.
* Add one extra test for font-fallback
Add one more test for font-fallback. This addition also resolves#495.
Catches situations where a null byte \x00 may not be found by preg_match in a unicode context.
Null bytes in the text string usually means that a CIDMap encoded string has been passed through as UTF-8 bytes without being translated by any matching CIDMap pairs.
---------
Co-authored-by: Konrad Abicht <[email protected]>
0 commit comments