Znuff/consolas-powerline

Ligatures

kolmogorov42 opened this issue ยท 26 comments

First of all, thank you for the brilliant work on the extra glyphs. I'm running zsh inside a Cmder terminal in Windows, and I'm able to use all the Powerline symbols where I couldn't before, both for zsh themes and in vim, etc.

As I'm a die-hard Consolas user, I was wondering if there was any chance you might add FiraCode-style ligatures to the font. I have tried using FiraCode, but I don't think it looks quite as nice as Consolas. I don't know much about fonts, so I have no idea how hard it would be. Just a suggestion I'm sure a lot of other developers would second.

Would a PR that uses Ligaturizer for this purpose be accepted? Otherwise I'd be happy to setup a fork.

I didn't know about that! Seems promising, I'll give it a try.

Znuff commented

You can do that, yes.

It works!

Next step would be designing a set of ligatures specifically for Consolas, but this is a matter for font designers.

@Znuff sorry, when you mean 'you can do that' were you referring to me and that a PR with ligatures would be accepted? Or just to @kolmogorov42 that ligatures can be added in this fashion?

Znuff commented

There's 2 things:

  1. Ligatures are.... weird on a monospaced font. Consolas is a monospaced font. It already handles Emojis very weirdly (as in, they break completely the monospaced layout)

  2. I will probably TRY to integrate them myself once ai Update to Windows Spring update (1803), because there's a new version of Consolas (7.00).

Ligatures in a monospaced font (at least ligatures meant for programming) shouldn't break the monospaced layout. A ligature consisting of 2 or 3 characters should use the same space as 2 or 3 single characters, respectively. See e.g. FiraCode.

I would absolutely love ligatures in Consolas. It's a highly up-voted request in Visual Studio, yet there has been no response from Microsoft. I can promise you many people would flock to this if you add ligatures.

+1 to Ligatures in Consolas.
Consolas is my favourite font.

+1 for ligatures please if you can spare the time.

@alexfoxgill
The link you posted is no longer valid. Can you please repost the files via some non-expiring file host?

@Enteleform try https://drive.google.com/open?id=1WQkcYmw7mD_Bg5EBPEZGgJaFz5i7FMeU

Blatant typography newb here so am sorry but: @alexfoxgill I just tried your first in VisualStudio and Word and didn't meet with much luck (VS just drops back to Courier as below: I'll dig, that's as much about me as the font I imagine :))

image

EDIT: forgive me: restarting Visual Studio got it up and running (just in case anyone else trots by here with the exact same problem ...)

Definitely another vote for a ligaturized Consolas ...

I just tried the one from the link below. Looks pretty good to me. I don't see any aliasing
Consolas Ligaturized
Screenshot

I came across this thread a few weeks ago, but didn't like that the Fira Code glyphs didn't match Consolas. I decided to make my own custom glyphs and a tool to patch Consolas (since you can't distribute it).

https://github.com/ofolis/consolig

Feel free to incorporate any of those glyphs here if you'd like.

Thank you for your contribution @ofolis, will check it out. Just out of curiosity, have you tried the below font set?
https://github.com/somq/consolas-ligaturized

How would you say it compares to your version?

Yep, tried that one out too @mkanet . The difference is that the one you linked uses glyphs from Fira Code. So, while ligature glyphs show up, the line heights, stroke weights, etc. are all based on Fira Code and don't precisely match Consolas.

I went ahead and took the Consolas glyphs and built new ligature glyphs from scratch that are based on Consolas. They should fit in better when they are surrounded by other glyphs from Consolas.

@ofolis, that's all I ever wanted. I ran your script, but alas, the end result seems a little blurry to me (even with regular, non-ligature characters). Compare the following:

Regular Consolas:
image

Ligaturized Consolas:
image

Consolig:
image

Notice how everything is blurrier in Consolig, even alphabetical characters. Of course, the effect is more prominent in special characters like the equal and hash signs.

Any thoughts?

Hmm, interesting. The smoking gun for me is that it seems to be an issue for the original glyphs too -- I think a setting is off on the generated font.

If the geometry isn't lined up with the pixels, it will artifact like that. What font size are you using @kolmogorov42 ?

It's 14, the editor I'm using is Visual Studio Code on Windows 10.

I think I've found the issue @kolmogorov42 . Give me a few to see if I'm on the right track, but I'll have something up in a few hours most likely.

@kolmogorov42 I found a bunch of properties that were wrong/hadn't been set. I got all those matching Consolas now, so give it another try and let me know (my screen resolution makes it difficult to test the font at the DPI that has issues).

If there still is a problem, feel free to open an issue in my repo, I feel bad adding more comments here when it's off-topic. ๐Ÿ‘

It works! I'll save further comments for your repo.

@Znuff Will Consolas Powerline ever have these ligatures? I love Consolas too, and I'm using Cascadia Code for my terminal. It looks really bad when dealing with code.

@Znuff Will Consolas Powerline ever have these ligatures? I love Consolas too, and I'm using Cascadia Code for my terminal. It looks really bad when dealing with code.

I can safely say that no, it will not have it.

This version is just for my own usage (and whoever finds it useful). I don't use Consolas for coding, so to me ligatures are not useful, quite the opposite.

I'd suggest continuing the discussion in ofolis/consolig.

Besides, it's fairly trivial to add NF to Consolas and then add the ligatures yourself.