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
Subsetter drops nameIDs that make font unusable on OS X #1170
Comments
@o-t-w are you trying to subset a variable font? I don't think that's supported yet. |
Yep, I’m trying to subset the variable version of source sans. Source Sans is gigantic without subsetting, wiping out the benefits of using a variable font :( |
Using the complete Source Sans variable fonts is still a smaller payload than using all of the individual fonts, so it's not a complete wipe out 😁 The only workaround you have right now is to build the variable font(s) from source, subsetting the master OTFs before they get merged as a variable font. It's not that difficult; I've done it with other projects. It seems that you're already familiar with pyftsubset, so all you have to do is to add a command like this to buildVFs.sh, # subset Roman master OTFs
masters=`find Roman/Masters/master_* -type f | egrep -i '\.otf$' | sed 's:^\./::'` # sed removes the trailing './'
for otf in $masters
do
echo 'Subsetting' $otf
pyftsubset $otf --unicodes=20,21,24,26,2c-2e,30-3b,3f,41-5a,61-7a,a3,2019,20ac --notdef-outline --name-IDs='*' --layout-features+=case,dnom,lnum,numr,onum,ordn,pnum,sinf,subs,sups,tnum,zero --layout-features-=locl --drop-tables-=BASE --no-subset-tables+=BASE
mv $(echo $otf | sed 's/.otf/.subset.otf/') $otf
done This chunk should be placed after buildMasterOTFs and before buildCFF2VF. |
Thanks for the info Miguel! I will try that. As a front-end developer rather than a typographer, I am curious what those tables are and do. How hazardous is it to use a font with a busted sfnt and name table? |
Are there plans to support variable fonts? |
Subsetting Var TTF shouldn't be too hard I reckon. What else is there to do besides subsetting the |
gvar is trivial. In fact, it's already implemented. What's not implemented right now is GDEF VarStore I think, which should be easy to get going without pruning it of unused entries. |
Actually, I take that back. I just tested and subsetting variable fonts works. The VarStore in GDEF is not trimmed so it's large, but otherwise it works:
Your error seems to be something else. Can you elaborate? |
It might be that we drop psname during subsetting by default? Though I thought we fixed that. |
I ran the command |
Right. But what if you do with a non-variable version of the font? Does that work? At any rate, this seems to be a bug, NOT a missing feature. It's expected to work. |
It is complaining about |
I tried running some non-variable fonts throught pyftsubset and I'm getting the same error. |
|
Right. As I said, I think it's the postscriptname. Try with |
Excuse my ignorance - I wish i knew more about font files. Could you explain why |
|
Maybe @anthrotype can test that on a Mac. |
@behdad I've just tested. Font Book stops complaining if the font contains nameIDs 3, 4 and 6, in addition to what gets added by default (1, 2, and IDs referenced by STAT table). Here's the full command that makes a subset of Source Sans Variable valid according to Font Book: The original font is at https://github.com/adobe-fonts/source-sans-pro/releases/tag/variable-fonts |
@behdad Sorry to comment on a closed issue, am I correct to understand the only thing missing from a fully functional Edit: it looks like VarStore is nicely cleaned up when using |
I'm sure VarStore is NOT cleaned up. So, yes, that's left. I think that's the only thing. Wait. Checking the code, we don't subset HVAR/VVAR either. That's trivial to add. Yes, open an issue for finishing subsetting of varfonts and I'll try to do it. |
Thanks. Fixed. Added 0 as well. |
I’ve done some more testing on MacOS 10.13.3.
Just mentioning for later reference. |
thanks sascha. shall we keep this open then? |
actually no, we are now keeping all nameIDs from 0 to 6 by default, so that should cover all the ones you mentioned. I don't think we need to do anything else on our side. |
I am trying to add a font to Font Book (the Mac application).
It is displaying errors. When I install the font before subsetting, there are no errors.
The font in question is the variable version of Source Sans Pro
The text was updated successfully, but these errors were encountered: