Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When moving half way in the ligature, the cursor should be half way in the char

See 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.


Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

kilimancommented, Feb 20, 2018

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 + 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.

So basically 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.

kilimancommented, Mar 1, 2018

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 🏁

Read more comments on GitHub >

github_iconTop Results From Across the Web

Show underlying characters for ligatures - Visual Studio Feedback
However, when moving the cursor through the area where a ligature has been rendered, ... characters instead of putting the cursor halfway through...
Read more >
Cursor starts half way down - Microsoft Community
In Word 2013, when I open a new document the cursor starts half way down the page. The top and bottom margins are...
Read more >
cursor - CSS: Cascading Style Sheets - MDN Web Docs
The cursor CSS property sets the mouse cursor, if any, to show when the mouse pointer is over an element.
Read more >
FontForge Master Class Part 3 - Kerning, Lookups & Ligatures
In the third part of this series, we will learn how to use pair positioning (kerning) and how to use lookups in Font...
Read more >
How to Fix Mouse Cursor in Dual Monitor Setup [Tutorial]
How to Fix Mouse Cursor in Dual Monitor Setup [Tutorial]If you're using two or more monitors, there are a few things you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found