Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cmap table selection (fix #649) #650

Merged
merged 1 commit into from
Nov 30, 2023
Merged

Conversation

Connum
Copy link
Contributor

@Connum Connum commented Nov 26, 2023

Description

I introduced a bug with my PR #338, this is the fix for it. We always want to take the first CMAP table that we support, but keep on looking for an optional format 14 table that will be applied separately (this is the only exception, all other CMAP tables are exclusive). But I forgot to check if we already found a CMAP table when setting the offset for the supported table format, so it kept overriding the selected table until it found a format 14 table, thus always using the last instead of the first supported table.

Motivation and Context

fix #649, this bug broke the unicode test suite tests CFF-1 and CFF-2, and probably other fonts as well.

How Has This Been Tested?

loaded the FDArray test fonts and checked if the chars that broke in the test suite are displayed as expected

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I did npm run test and all tests passed green (including code styling checks).
  • I have added tests to cover my changes.
  • My change requires a change to the documentation.
  • I have updated the README accordingly.
  • I have read the CONTRIBUTING document.

@Connum Connum added the bug label Nov 26, 2023
@Connum Connum requested review from ILOVEPIE and yne November 26, 2023 15:09
@Connum Connum added this to the Release 2.0.0 milestone Nov 26, 2023
@Connum Connum merged commit fb886bb into opentypejs:master Nov 30, 2023
1 check passed
@Connum Connum deleted the fix/649 branch November 30, 2023 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression: CFF-1 and CFF-2 tests in Unicode test suite passed at some point
2 participants