Closed Pomax closed 4 years ago
Note that perhaps it's time to start ignoring Recursive, because OpenSans gives this now:
>node test\gsub\test.elaborate.js
font supports 'f': true (glyphid: 73)
font supports 'i': true (glyphid: 76)
[latn:dflt:lnum] add 10 to [899-908]
[latn:dflt:onum] add 10 to [19-28]
[latn:dflt:onum] add 10 to [19-19,21-28,898-898]
[latn:dflt:pnum] add 1 to [20]
[latn:dflt:liga] has ligature sequence: {73,73,79} -> 606 (= 'f' + 'f' + 'l' -> 'ffl')
[latn:dflt:liga] has ligature sequence: {73,73,76} -> 605 (= 'f' + 'f' + 'i' -> 'ffi')
[latn:dflt:liga] has ligature sequence: {73,73} -> 909 (= 'f' + 'f' -> 'ff')
[latn:dflt:liga] has ligature sequence: {73,79} -> 565 (= 'f' + 'l' -> 'fl')
[latn:dflt:liga] has ligature sequence: {73,76} -> 564 (= 'f' + 'i' -> 'fi')
[latn:dflt:salt] add 5 to [74-74,223-223,225-225,227-227,229-229]
[latn:dflt:salt] add 20 to [918-937]
[latn:dflt:ss01] add 5 to [74-74,223-223,225-225,227-227,229-229]
[latn:dflt:ss01] add 20 to [918-937]
[latn:dflt:ss02] add 5 to [74-74,223-223,225-225,227-227,229-229]
[latn:dflt:ss03] add 20 to [918-937]
[latn:dflt:tnum] add 10 to [899-908]
[latn:dflt:tnum] add 1 to [898]
[latn:MOL :lnum] add 10 to [899-908]
[latn:MOL :locl] add 4 to [292-293,329-330]
[latn:MOL :onum] add 10 to [19-28]
[latn:MOL :onum] add 10 to [19-19,21-28,898-898]
[latn:MOL :pnum] add 1 to [20]
[latn:MOL :liga] has ligature sequence: {73,73,79} -> 606 (= 'f' + 'f' + 'l' -> 'ffl')
[latn:MOL :liga] has ligature sequence: {73,73,76} -> 605 (= 'f' + 'f' + 'i' -> 'ffi')
[latn:MOL :liga] has ligature sequence: {73,73} -> 909 (= 'f' + 'f' -> 'ff')
[latn:MOL :liga] has ligature sequence: {73,79} -> 565 (= 'f' + 'l' -> 'fl')
[latn:MOL :liga] has ligature sequence: {73,76} -> 564 (= 'f' + 'i' -> 'fi')
[latn:MOL :salt] add 5 to [74-74,223-223,225-225,227-227,229-229]
[latn:MOL :salt] add 20 to [918-937]
[latn:MOL :ss01] add 5 to [74-74,223-223,225-225,227-227,229-229]
[latn:MOL :ss01] add 20 to [918-937]
[latn:MOL :ss02] add 5 to [74-74,223-223,225-225,227-227,229-229]
[latn:MOL :ss03] add 20 to [918-937]
[latn:MOL :tnum] add 10 to [899-908]
[latn:MOL :tnum] add 1 to [898]
[latn:ROM :lnum] add 10 to [899-908]
[latn:ROM :locl] add 4 to [292-293,329-330]
[latn:ROM :onum] add 10 to [19-28]
[latn:ROM :onum] add 10 to [19-19,21-28,898-898]
[latn:ROM :pnum] add 1 to [20]
[latn:ROM :liga] has ligature sequence: {73,73,79} -> 606 (= 'f' + 'f' + 'l' -> 'ffl')
[latn:ROM :liga] has ligature sequence: {73,73,76} -> 605 (= 'f' + 'f' + 'i' -> 'ffi')
[latn:ROM :liga] has ligature sequence: {73,73} -> 909 (= 'f' + 'f' -> 'ff')
[latn:ROM :liga] has ligature sequence: {73,79} -> 565 (= 'f' + 'l' -> 'fl')
[latn:ROM :liga] has ligature sequence: {73,76} -> 564 (= 'f' + 'i' -> 'fi')
[latn:ROM :salt] add 5 to [74-74,223-223,225-225,227-227,229-229]
[latn:ROM :salt] add 20 to [918-937]
[latn:ROM :ss01] add 5 to [74-74,223-223,225-225,227-227,229-229]
[latn:ROM :ss01] add 20 to [918-937]
[latn:ROM :ss02] add 5 to [74-74,223-223,225-225,227-227,229-229]
[latn:ROM :ss03] add 20 to [918-937]
[latn:ROM :tnum] add 10 to [899-908]
[latn:ROM :tnum] add 1 to [898]
These last few commits seem to nail it, for lookup types 1 and 4! Thanks for the hard work, @Pomax. Some local testing shows results making sense!
The reason why Recursive seems to be off, is that it doesn't contain ligatures for regular characters, only for regular characters plus replaced glyphs (for example f,f,i.italic
). For current Wakamai Fondue, it would suffice to not count this as a ligature as it reports only on character level.
That said, I would love to think of a way to show this without using the glyphs concept. It looks like the ffi
ligature is only used when the CRSV
axis is fully on (1
). In that mode, the f
remains the same glyph, but the i
changes shape. So indeed to this ligature to kick in, the sequence is f,f,i.italic
. How do you explain that? "The follow ligatures are only shown when CRSV
is activated"? (Or for that matter, ss04
or any other feature that changes a character's default glyph to an alternative one)
@arrowtype Any thoughts on this?
You'd need to actually run through full GSUB in reverse but yeah as information that sounds about right "ligature: ffi notes: CRSV=1" maybe?
Sorry, the Recursive ligatures are maybe a bit of a tricky edge case.
The ligatures are activate in two conditions:
slnt < -14
CRSV > 0.9
Basically, these are ligatures that happen in Italic but not Roman styles.
Thanks for confirming, @arrowtype!
This is turning into quite a bit of work, the GSUB tables are fairly ludicrous =P
consider this a work in progress, but even with something like ArrowType's "Recursive" we already see that
ffi
lligatures are far more of a challenge than expected. For instance, let's admire this outputNote those ligatures showing
??
... that's because there's seemingly nothing to look up. These are ligatures composed of normal lettersf
(glyphid 300) but definitely-not-the-normal lettersi
(id=312) andl
(id=330), instead they use glyph 946 ("i.italic") and glyph 964 ("l.italic"), and I'm pretty sure the substitution from plain to italic is somewhere in those lookuptype1 rules, but that's a lot of reverse lookup...Note that this PR is substantial, and yet still only covers part of the work.