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

Support CFF2 #249

Closed
brawer opened this issue Jan 9, 2017 · 7 comments · Fixed by #580
Closed

Support CFF2 #249

brawer opened this issue Jan 9, 2017 · 7 comments · Fixed by #580

Comments

@brawer
Copy link
Collaborator

brawer commented Jan 9, 2017

Specification: https://www.microsoft.com/typography/otspec/cff2.htm

Tests: https://raw.githack.com/unicode-org/text-rendering-tests/master/reports/FreeStack.html#CFF2-1

Test font: https://github.com/adobe-fonts/adobe-variable-font-prototype/releases/tag/1.001

@fdb
Copy link
Contributor

fdb commented Jan 9, 2017

Yes, it would be awesome if we could support this!
Thanks for posting the test font.

@tshinnic
Copy link
Contributor

Unfortunately that test font also has lots of new 'prototype' stuff for font variations. It would be wonderful to find a 'plain' sample file or three of fonts with CFF2 tables. (sigh)

BTW: is anyone playing with this yet, in terms of code here? I might be interested if not...

@tshinnic
Copy link
Contributor

tshinnic commented May 1, 2017

BTW: also note the 'subset' font created for the text-rendering-tests at AdobeVFPrototype-Subset.otf Much smaller with only 3 glyphs defined. (7K vs 227K)

Yuck. These fonts (from Adobe and subset) have embedded everything to do with font variations, including the new 'blend' charstring operator which has a variable number of operands, depending on the number of variation 'regions' as defined in other sfnt tables (gdef, fvar, other ?var tables). Thus these two fonts require implementation of at least some of the variation-related tables and some of their data structures just to start on the CFF2 table itself. When you ask for 'CFF2' support you're kinda asking for the whole wad of "font variations" features. I'll start at it if no one says they're in-progress ...

But still asking - anyone know of any other fonts that have only the new CFF2 table without the helium inflated rubberized var tables?

@brawer
Copy link
Collaborator Author

brawer commented May 1, 2017

I’m not aware of any non-variable CFF2 fonts; variations are are core part of the CFF2 format. (By the way, OpenType.js already supports the fvar table, but you’ll probably need to implement HVAR for CFF2 advance widths). Good luck!

@devongovett
Copy link

Just implemented CFF2 in fontkit. The format is not actually all that different from CFF1. Just a couple new operators, and a few things removed and moved to other existing tables (e.g. no more glyph names). The variation stuff is really the meat of it. If you're curious, here's the code: foliojs/fontkit#88

@Pomax
Copy link
Contributor

Pomax commented Jan 22, 2019

Bumping this issue becuase it's been 2 years since it got filed, and CFF2 is only getting more support, not less =)

Also note that CFF2 makes a whole heap of sense for non-fvar fonts, because it's even more compact than CFF, finally leaving all the metadata up to the opentype tables and only concerning itself with the glyphs themselves, similar to the glyf table, except with cubic curves and subroutines.

@Connum
Copy link
Contributor

Connum commented Feb 26, 2023

Started working on CFF2 support: https://github.com/opentypejs/opentype.js/tree/WIP/cff2

@Connum Connum mentioned this issue Mar 2, 2023
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants