googlefonts / googlefonts/fontmake
Feature table lookup duplication
- Dominant language
- Python
- Stars
- 888
- Forks
- 97
- Avg merge
- 4d 52m
- Merged PRs (30d)
- 1
Description
It appears that for features to be used for languages other than the script default, the lookups for the default are added to those of the language. In the cases I looked at, it had no effect because duplicated lookups are applied once. But I am not sure if that will always be the case. To illustrate with the most simple case, taken from Noto Serif Devanagari:
```
feature blwf {
script deva ;
language dflt;
lookup belowBase_forms {
sub ra-deva halant-deva by rakar-deva;
} belowBase_forms;
language MAR ;
lookup belowBase_forms ;
language NEP ;
lookup belowBase_forms ;
language SAN ;
lookup belowBase_forms ;
script dev2 ;
language dflt ;
lookup belowBase_forms_dev2 {
sub halant-deva ra-deva by rakar-deva;
} belowBase_forms_dev2;
language MAR ;
lookup belowBase_forms_dev2 ;
language NEP ;
lookup belowBase_forms_dev2 ;
language SAN ;
lookup belowBase_forms_dev2 ;
} blwf ;
```
The expectation is that are two features with 1 lookup. One assigned in the script table to the 4 entries of _deva_, the other to the entries for _dev2_.
But decompiled in FontDame format I see:
```
2 blwf 773, 773
3 blwf 772, 772
4 blwf 773
5 blwf 772
```
Features 4 and 5 are used by the default, features 2 and 3 for the language specific entries.
I this example the designer could have left out the language specific entries. But in cases where there are genuine differences, I see something like this:
For the default of script _dev2_ feature _pres_:
` 27 pres 45, 47, 48, 101, 114, 246, 500`
For the Sanskrit there is one additional lookup and the feature becomes:
`25 pres 45, 47, 48, 101, 114, 246, 500, 45, 207, 47, 48, 101, 114, 246, 500`
But if I were to to decide that the Sanskrit does not need lookup 47 then I get it anyway:
`25 pres 45, 47, 48, 101, 114, 246, 500, 45, 207, 48, 101, 114, 246, 500`
And that is not right.
Contributor guide
Assessment
This issue has not been assessed yet.