Lorp / samsa

Variable font inspector
https://lorp.github.io/samsa/
Apache License 2.0
243 stars 23 forks source link

Does not report font axes after subsetting variable font #89

Closed strarsis closed 10 months ago

strarsis commented 10 months ago

Variable fonts that were subsetted using pyftsubset are reported by sama as not having font axes. Other tools like this report font axes for the subsetted font file.

Lorp commented 10 months ago

I have not seen this issue. If you provide an example font, I’ll look into this.

strarsis commented 10 months ago

Steps to reproduce:

  1. Get a variable font, in this example Open Sans from Google Fonts (Download family; extract downloaded ZIP file Open_Sans.zip).

  2. Subset the variable font file: 2.a. Using glyphhanger: glyphhanger --formats=woff2 --LATIN --subset=./OpenSans-VariableFont_wdth,wght.ttf 2.b. Alternatively using pyftsubset (used by glyphhanger) (LATIN subset being used with that unicode range): pyftsubset OpenSans-VariableFont_wdth,wght.ttf --flavor=woff2 --output-file="OpenSans-VariableFont_wdth,wght-subset.woff2" --unicodes="U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD"

  3. Upload (as drag and drop) the original, full font file OpenSans-VariableFont_wdth,wght.ttf into Samsa tool. Note that font axes are available.

  4. Upload (as drag and drop) the subsetted font file OpenSans-VariableFont_wdth,wght-subset.woff2 into Samsa tool. Note that font axes are not available: This font does not contain variation axes.

Lorp commented 10 months ago

Samsa does not handle WOFF2 fonts. Please try again without the --flavor=woff2 option, and use .ttf as suffix.

strarsis commented 10 months ago

@Lorp: Well, this explains it. IMHO the tool should show a warning/error that WOFF2 font is unsupported, hence the reported information being incorrect. As this is a nice/useful tool, it would be great when WOFF2 is added to it.

Lorp commented 10 months ago

Thanks. Regarding handy warnings, there’s already issue #81. And indeed, allowing WOFF2 is on my list too. I’ll get to both of these when I upgrade the entire GUI app to Samsa Core v2.