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 for variable font format tables #233

Closed
BaGsn opened this issue Oct 9, 2016 · 10 comments
Closed

Support for variable font format tables #233

BaGsn opened this issue Oct 9, 2016 · 10 comments

Comments

@BaGsn
Copy link

BaGsn commented Oct 9, 2016

Have you planned to upgrade the library to support new opentype variation tables?

@Jolg42
Copy link
Member

Jolg42 commented Oct 9, 2016

Hi @BaGsn

So having support for OpenType 1.8 with font variations would be great, right now there is nobody working on it but it looks like some people are interested by this feature.

So as OpenType.js is an open-source project you can directly contribute to it or sponsor a contributor that can do it for you 😉

@devongovett
Copy link

fontkit supports variation fonts (the truetype version so far, not CFF2). Currently just reading is supported, not writing. Code is here.

@Jolg42
Copy link
Member

Jolg42 commented Oct 10, 2016

@devongovett Nice!
But I missed something... The new OpenType 1.8 is the CFF2 version? What is the TrueType version? If you have a link to a spec/doc to help me understand the difference here it would be perfect! :)

@moyogo
Copy link
Contributor

moyogo commented Oct 10, 2016

@Jolg42 the TrueType glyf table didn’t really change in OpenType 1.8 (the only minor changes is some clarification of 3 flags).

@Jolg42
Copy link
Member

Jolg42 commented Oct 10, 2016

Ok 👍

@brawer
Copy link
Collaborator

brawer commented Oct 10, 2016

The next step in OpenType.js would likely be to implement the gvar table. For testing, try parsing TestGVAROne, TestGVARTwo, and TestGVARThree from Unicode’s text rendering test suite. Maybe you’ll also find the ‘gvar’ codec in fonttools and its tests useful when implementing this.

@fdb
Copy link
Contributor

fdb commented Oct 10, 2016

I'm very interested on working on this in the coming weeks, as I will be doing a workshop around variable fonts in Vilnius in December.

@brawer thanks for the pointers to the test suite -- will look into that.
@devongovett thanks for a link to the code!

@brawer
Copy link
Collaborator

brawer commented Oct 10, 2016

@fdb, very cool and good luck! The OpenType 1.8 spec has a Font Variations Overview which I’d recommend reading as an intro.

@tshinnic
Copy link
Contributor

tshinnic commented May 6, 2017

In addition to Adobe's minimal offering of examples for Font Variations,

I just now found the efforts of Type Network Inc. with two fonts

The first Adobe font has CFF2 versus the second having glyf/gvar, but both are missing the STATand MVAR tables. (see current-limitations)

The TypeNetwork files do have tables such as STAT and presumably are more or less self-consistent, though since the tools aren't all ready yet they've had to take workarounds to generate the font files.

Here's the ttx -l listing of Decovar-VF.ttf

Listing table info for "Decovar-VF.ttf":
    tag     checksum   length   offset
    ----  ----------  -------  -------
    DSIG  0x5557558B       40   264340
    GDEF  0x0610006F     1512    50496
    GPOS  0xAFFBBECD       90    52008
    HVAR  0xB472ED23     2121    52100
    OS/2  0x6D8E8668       96      408
  * STAT  0xB2921842      138    54224
    cmap  0x20C65265      494      976
    fvar  0xD0B4C150     1404    54364
    glyf  0x380D9A98    45772     1712
    gvar  0x476B8119   208570    55768
    head  0x113F253D       54      284
    hhea  0x0F6809E1       36      340
    hmtx  0x888D371E      472      504
    loca  0xB9108E50      238     1472
    maxp  0x02B70790       32      376
    name  0x42270885     2064    47484
    post  0x0533BC8C      947    49548

I started looking harder for things like STAT when I found that even fonttools had had to hardcode a sample table in binary just to have something to test against!

Oooo, at least one of the unicode-org/text-rendering-tests test fonts, Selawik-variable.ttf, has STATand avar and cvar and more! Other files too!

HVAR  AdobeVFPrototype-Subset.otf   Selawik-variable.ttf    
      TestHVAROne.otf               TestHVARTwo.ttf         TestGVARFour.ttf
STAT  Selawik-variable.ttf          TestGVAREight.ttf            
avar  Selawik-variable.ttf          TestAVAR.ttf                 
cvar  Selawik-variable.ttf          
fvar  AdobeVFPrototype-Subset.otf   Selawik-variable.ttf    Zycon.ttf               
      TestAVAR.ttf                  TestGVAROne.ttf         TestGVARTwo.ttf
      TestGVARThree.ttf             TestGVARFour.ttf        TestGVAREight.ttf
      TestGVARNine.ttf              TestHVAROne.otf         TestHVARTwo.ttf              
gvar  Selawik-variable.ttf          Zycon.ttf               TestAVAR.ttf            
      TestGVAROne.ttf               TestGVARTwo.ttf         TestGVARThree.ttf
      TestGVARFour.ttf              TestGVAREight.ttf       TestGVARNine.ttf        
      TestHVARTwo.ttf

Gee, a couple months more and maybe the OSes will support these...

@Connum
Copy link
Contributor

Connum commented Apr 20, 2024

Reading and rendering of the missing variation tables has been implemented via #699, writing will follow via #701. Closing.

@Connum Connum closed this as completed Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants