Fix incorrect mapping in cmap during ttf parse with format=6 #3050
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.
A bug with the ttf parser was erroneously creating a bad cmap when format=6.
To be 100% honest, all this font stuff is a little outside my sphere of knowledge but I ran into this issue while extracting fonts from a PDF.
In my case I was seeing a final font with B->B, C->F, F->F (the pattern was the same across a number of fonts). After the fix I correctly get B->B, F->F.
The bug itself is a simple iteration typo.
Important
Mark with [x] to select. Leave as [ ] to unselect.
Motivation and Context
Closes #1
(where 1 would be the issue number) to your commit message.Types of changes
What types of changes does your code introduce? Check all the boxes that apply:
Description
Final checklist
Go over all the following points and check all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help! Various areas of the codebase have been worked on by different people in recent years, so if you are unfamiliar with the general area you're working in, please feel free to chat with people who have experience in that area. See the list here.
Your pull request will be tested via Travis CI to automatically indicate that your changes do not prevent compilation. FontForge is a big program, so Travis can easily take over 20 minutes to confirm your changes are buildable. Please be patient. More details about using Travis can be found here.
If it reports back that there are problems, you can log into the Travis system and check the log report for your pull request to see what the problem was. If no error is shown, just re-run the Travis test for your pull-request (that failed) to see a fresh report since the last report may be for someone else that did a later pull request, or for mainline code. If you add new code to fix your issue/problem, then take note that you need to check the next pull request in the Travis system. Travis issue numbers are different from GitHub issue numbers.