normalize strings based on the char map in the current font (if present) #1
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.
This is mostly copied from the "text" example of the "pdf" crate, based on work by @s3bk
https://github.com/pdf-rs/pdf/blob/master/examples/text/src/main.rs
The FontInfo struct is created there as a way to cache the character maps retrieved from the Font resources. Unfortunately it's not part of the main codebase of the lib, it's just in the examples, so I can't import it and had to copy it as well. It looks like the handling of character maps is not mature enough yet (based on the comment in line 24), but for my use-case it was working fine, so I wanted to integrate it with the nicely typed Operations from this crate.
I think the parsing of the Fonts is not really in the scope of this crate, but it would be really useful to use them if present.