Znuff / consolas-powerline

An updated Consolas for Powerline font. This works with the new vim-airline, too.
143 stars 19 forks source link

Ligatures #1

Closed kolmogorov42 closed 6 months ago

kolmogorov42 commented 6 years ago

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.

philipbelesky commented 6 years ago

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

kolmogorov42 commented 6 years ago

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

Znuff commented 6 years ago

You can do that, yes.

kolmogorov42 commented 6 years ago

It works!

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

philipbelesky commented 6 years ago

@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 6 years ago

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

cmeeren commented 6 years ago

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.

Leninsky commented 6 years ago

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

PhilipHassialis commented 6 years ago

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

alexfoxgill commented 6 years ago

i used docker-ligaturizer to produce these ligaturized versions of Consolas

Enteleform commented 5 years ago

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

alexfoxgill commented 5 years ago

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

timbarrass commented 5 years ago

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

yyynnn commented 5 years ago

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

These are badly aliased in win10 vscode

mkanet commented 5 years ago

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

ofolis commented 4 years ago

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.

mkanet commented 4 years ago

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?

ofolis commented 4 years ago

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.

kolmogorov42 commented 4 years ago

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

ofolis commented 4 years ago

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 ?

kolmogorov42 commented 4 years ago

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

ofolis commented 4 years ago

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 commented 4 years ago

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

kolmogorov42 commented 4 years ago

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

akhilesh-balaji commented 3 years ago

@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 commented 6 months ago

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