Closed msuess closed 10 months ago
Have you looked into Fira Code's guide to Emacs? Commit Mono's ligatures are structered the same way as Fira Code, so they should work in the same way. Tell me if they don't.
They don't. I don't see any ligatures, but arrows are working.
Smart kerning is pretty subtle, so it can be hard to tell if it is on. Can send me a screenshot of this text: "Commit Mono => -> <= ... "
I think unfortunately the current "state of the art" when it comes to enabling ligatures in Emacs is the ligature.el
package. But unfortunately, that a) doesn't allow you to enable stylistic sets and b) requires you to manually list out each ligature you want enabled.
I'm not sure how easy this would be, but if possible, if we could get a listing of all character runs that have ligatures associated, that would make it easiest for us Emacs users to enjoy the smart kerning feature here. But I totally understand if that's too much work / not possible.
Thanks in advance :) beautiful font!
I really have no idea how Emacs works, but you can see the Smart Kerning feature code here.
Yep, I ran across that code while looking through this as well. Unfortunately, there (to my knowledge) is not a straightforward way to enable entire stylistic sets in Emacs.
So ideally we'd need a full, static listing of ligatures (i.e. we'd need a list of character sets to apply ligation to, for example from the website: 'moi', 'typ', etc.). I have no idea what that code ends up generating internally in the font, but if there is a way to pull all of the character sets from that stylistic set, we could use that I think.
That said, I have no idea where to even start with something like that, so no worries if that's not something you want to deal with!
To my ears it sounds as though it is not possible. This is because the Smart Kerning feature uses contextual substitution and what you're talking about is simple change all 'G' for another 'G' for example. Correct me if I'm wrong.
I wouldn't say the logic is "substitute every G for another G", but rather "when you see the string of characters '=>', render it using the glyph that looks like '⇒'".
So in essence, there's a lookup table that maps from sets of characters to glyphs, which unfortunately as of now Emacs requires the user to manually construct.
Now, from my read of the code you linked it appears to be some sort of dynamic set of rules that could possibly be compiled into such a table, but again I have no clue of how these things work in a font so it's possible that such a table does not exist internally.
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_fonts/OpenType_fonts_guide#discovering_availability_of_features_in_fonts lists some resources for mucking about with fonts and discovering features. I'll have a go with tossing the files in there to see if I get anything close to what I'm looking for out
But even if what I'm looking for isn't reasonably possible, I appreciate you taking the time to discuss! This may end up driving me to take a look at how Emacs is using harfbuzz internally to see if I can convince it to work with stylistic sets instead of the manual madness we currently have to deal with.
Interested to see what you find out. Good luck.
Not sure where to go with this issue. Can I close it?
It's probably worth clarifying that this issues is only for GUI emacs. I use wezterm+emacs (terminal emacs), so wezterm does all of the smart kerning very nicely and emacs doesn't have to do anything.
I believe this is not an issue I can solve, since it probably isn't related to the font. Reopen if you think I should do something about it!
I got smart kerning to work with Emacs as described here.
Amazing work!
First of all: thank you for creating this awesome font! 🙏
I have downloaded the font with "Smart Kerning" enabled, however it doesn't seem to do anything in Emacs. How is this implemented? Are there any special ligatures that need to be enabled for this to work?