When moving half way in the ligature, the cursor should be half way in the charSee original GitHub issue
This is how it is in Fira and sounds more logical than having the cursor in a blank space.
Try for instance to navigate through
>= in Fira and with Operator-Mono-Lig.
- Created 6 years ago
- Comments:12 (8 by maintainers)
Top GitHub Comments
I’ve been reading up on how contextual substitutions work in OpenType as well as how it’s used in Fira Code. I think I understand it much better now. I’m working on an experimental font with a few ligatures for testing.
Here’s an animation of how the spacing works.
Here’s how the glyph is created.
Notice the negative LSB (Left Side Bearing). The way Fira Code works is that instead of substituting
equal into a single double-wide glyph
equal_equal.liga like I currently do, it actually uses 2 glyphs, one name
LIG which is simply a single width glyph with no visual representation, plus the
equal_equal.liga with negative LSB.
LIG advances one character width, then the ligature moves back to the left with the negative LSB. The editor and terminal think there are two characters and the caret is displayed properly.
Pretty clever, but makes it a little trickier to design the glyphs because you have to calculate the proper LSB. The actual contextual substitution lookups are really nasty and will have to programmatically generated. I’m working on that now.
I have a working version of the font in VS Code that supports both caret positioning and chained ligatures (#37).
Here’s an example:
Now to redo all the ligatures 😣 … I can see the finish line 🏁