-
Notifications
You must be signed in to change notification settings - Fork 487
Create a dflt LangSys in a ScriptRecord when adding variations later #3838
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
Conversation
A no-lookup langsys is overriding the dflt langsys, so it changes font behavior if you drop it. |
And for dropping dflt, yes, indeed, you need to either never drop it, or only drop it if it has no data whatsoever, including variations. |
The problem here is that we want a latn dflt to attach some feature variation (Designspace rules) in a later step, but it is completely empty and therefore dropped when building the table with just the provided feature file. I assume there was no problem if the feature variations were written into the feature file. |
You can create it on demand. Isn't that complicated at all. |
But my point stands that only empty dflt can be dropped, not any other empty langsys. |
Right, so the fix would be to change fonttools/Lib/fontTools/varLib/featureVars.py Line 394 in e89d7db
|
I think so. |
6ed71a3
to
40bee3c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
pls fix the lint as well thanks
@madig Have you tested if this issue also happens with fontc as well? |
I have not, can do soon. By the way, Harry and me were reading https://learn.microsoft.com/en-us/typography/opentype/spec/chapter2#scriptlist-table and wondered if a lazily-created "latn dflt" LangSys for feature variations should carry all features of "DFLT dflt"? Our reading of the spec says "no". |
I don't think so either |
Absolutely not. When the shaper chooses |
40bee3c
to
a235494
Compare
[skip ci]
fontc (as of f187844659adae9f56003fb33ff4df93cd406190) seems to do the right thing, as in, I see a "latn dflt" entry for the rclt variation. |
We found this one during the development of a font. The GSUB table builder seems to discard defined language systems when they have no lookups. This is a problem when we add feature variations in a later step, like we do when we compile a Designspace with rules.
When like in the test code no lookup is defined for
latn
anddflt
, just for theCAT
language, the GSUB table won't have adflt
LangSysRecord thatfonttools/Lib/fontTools/varLib/featureVars.py
Line 394 in e89d7db
TODO: