consolas-powerline icon indicating copy to clipboard operation
consolas-powerline copied to clipboard

Ligatures

Open kolmogorov42 opened this issue 7 years ago • 25 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.

kolmogorov42 avatar Jan 07 '18 18:01 kolmogorov42

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

philipbelesky avatar May 08 '18 01:05 philipbelesky

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

kolmogorov42 avatar May 08 '18 07:05 kolmogorov42

You can do that, yes.

Znuff avatar May 08 '18 13:05 Znuff

It works!

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

kolmogorov42 avatar May 08 '18 14:05 kolmogorov42

@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?

philipbelesky avatar May 08 '18 23:05 philipbelesky

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

Znuff avatar May 10 '18 03:05 Znuff

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.

cmeeren avatar May 10 '18 07:05 cmeeren

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

Leninsky avatar May 26 '18 16:05 Leninsky

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

PhilipHassialis avatar Jul 03 '18 13:07 PhilipHassialis

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

Enteleform avatar Dec 15 '18 19:12 Enteleform

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

alexfoxgill avatar Dec 17 '18 13:12 alexfoxgill

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

timbarrass avatar Dec 21 '18 10:12 timbarrass

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

These are badly aliased in win10 vscode

yyynnn avatar Apr 17 '19 14:04 yyynnn

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

mkanet avatar Aug 06 '19 03:08 mkanet

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.

ofolis avatar Dec 07 '19 22:12 ofolis

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?

mkanet avatar Dec 07 '19 23:12 mkanet

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 avatar Dec 07 '19 23:12 ofolis

@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?

kolmogorov42 avatar Dec 08 '19 00:12 kolmogorov42

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 ?

ofolis avatar Dec 08 '19 01:12 ofolis

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

kolmogorov42 avatar Dec 08 '19 01:12 kolmogorov42

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.

ofolis avatar Dec 08 '19 01:12 ofolis

@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. 👍

ofolis avatar Dec 08 '19 06:12 ofolis

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

kolmogorov42 avatar Dec 08 '19 11:12 kolmogorov42

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

akhilesh-balaji avatar Nov 03 '20 09:11 akhilesh-balaji

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

Znuff avatar Mar 07 '24 03:03 Znuff