Fixed issues introduced with Apache FOP: #352
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When updating to the latest OpenPDF version we observed that adopting Apache FOP led to some unexpected changes of behavior. I've tried to restore previous behavior with the code changes of this pull request, or at least to mitigate the effects. This pull requests addresses the following two issues:
With Apache FOP, if a glyph was not found in a font, there would be inserted the character '#'. This is different to previous behavior where nothing was changed, and it is especially annoying when one has got a string containing '\n' or similar characters. Therefore, I've restored the previous behavior.
Apache FOP supports ligatures. Because ligatures are not used in the same way in every language, Apache FOP asks for the language before substituting anything. The current default of OpenPDF is the language "dflt", which just means: Use ligatures wherever possible. I've not restored the previous default in this case (because using ligatures is fine), but made the language configurable per document, as some kind of work-around. I know that more would desireable here (e.g. specifying the language of each phrase), but I can't spend more time to this point at the moment (especially because I'm currently investigating more cases of changed behavior).
I hope you are ok with these changes.