Skip to content

implement CFF2 parsing #580

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

Merged
merged 1 commit into from
Mar 4, 2023
Merged

Conversation

Connum
Copy link
Contributor

@Connum Connum commented Mar 2, 2023

Description

fix #249

  • add parsers that can be shared by other variable font related tables
  • add operators for CFF2 table parsing
  • parse glyph data in its default form, ignoring variations
  • add some preparations for later variable font support

This PR does not handle font variation itself - it allows to load the data including glyph outlines and all other data from the CFF2 table. The glyphs will have their default form without any variations, so advanceWith will com from the glyph outline. But together with #576 it is an important step on the way to adding support for modern variable fonts.

Motivation and Context

CFF2 offers even better compression and is oprimized for variable fonts. Many variable fonts use CFF2 and couldn't be loaded before.

How Has This Been Tested?

Added tests for the different parsers as well as parsing of the exampler CFF2 table from the Microsoft specs.

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 requested review from yne and ILOVEPIE and removed request for yne March 2, 2023 19:18
@Connum Connum added this to the Release 2.0.0 milestone Mar 2, 2023
@Connum Connum added Spec Related to the implementation of the Opentype specification enhancement labels Mar 2, 2023
@yne yne force-pushed the feature/parse-cff2 branch from d850276 to 97e67bb Compare March 3, 2023 22:58
Copy link
Contributor

@ILOVEPIE ILOVEPIE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@Connum Connum merged commit ca3b438 into opentypejs:master Mar 4, 2023
@Connum Connum deleted the feature/parse-cff2 branch March 4, 2023 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Spec Related to the implementation of the Opentype specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support CFF2
3 participants