Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fonts with programming ligatures show weird behavior #514

Closed
MCorzo opened this issue May 7, 2019 · 14 comments
Closed

Fonts with programming ligatures show weird behavior #514

MCorzo opened this issue May 7, 2019 · 14 comments
Labels
Area-Fonts Related to the font Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Resolution-By-Design It's supposed to be this way. Sometimes for compatibility reasons.

Comments

@MCorzo
Copy link

MCorzo commented May 7, 2019

When fonts with programming ligatures is used, a weird behavior is show if write some characters at first, for example with FiraCode.

image

image

@zadjii-msft
Copy link
Member

I mean, isn't that how ligatures normally work? They can't really tell the difference between system32>=some_cmd and if (system32>=foo)

@puco
Copy link

puco commented May 7, 2019

Well, but maybe there should be some stop-character (by default?) that prevents a ligature in this case

@zadjii-msft
Copy link
Member

@puco Is there such a character?

If there is, then you could definitely add it to your prompt, with PROMPT $p$g<whatever the char is>.

However, that doesn't really seem like it's a solution that'll work for all cases

@zadjii-msft zadjii-msft added Issue-Question For questions or discussion Area-Fonts Related to the font Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues labels May 7, 2019
@RichiCoder1
Copy link

RichiCoder1 commented May 7, 2019

I think you can use: https://en.wikipedia.org/wiki/Zero-width_non-joiner
According to the wiki, the intent is literally to stop ligatures from joining.

@vapier
Copy link

vapier commented May 7, 2019

fonts are free to define any arbitrary ligatures they want, so if you were to try to use a ZWNJ character to defeat the ligatures, then you'd have to insert them between every single character. which would probably then break logic related to graphemes when formed by multiple characters (e.g. separate jamo in korean hangul which should be presented as a single glyph).

in css, there is a font-variant-ligatures: none that you can use to disable ligature usage during font rendering. i'd assume that whatever font rendering engine used by the terminal would have a similar knob that could be turned ...

@RichiCoder1
Copy link

To be clear, I was suggesting zwnj for the end of prompt by default. It would absolutely be a bad idea to use to remove ligatures everywhere.

@zadjii-msft
Copy link
Member

i'd assume that whatever font rendering engine used by the terminal would have a similar knob that could be turned ...

I believe this is something we could work with. I believe @miniksa already has a list of renderer knobs he's thinking about exposing as settings

@Tyriar
Copy link
Member

Tyriar commented May 8, 2019

This looks as designed to me, trying to do some trickery with ZWJ that only works in Windows Terminal sounds like the wrong direction. If you use ligatures and hit this often you should probably just change your prompt.

@DHowett-MSFT
Copy link
Contributor

DHowett-MSFT commented May 8, 2019 via email

@zadjii-msft
Copy link
Member

@DHowett-MSFT that's not a terrible idea, but I'm not sure how we could render that without sticking a fake ZWNJ in the buffer, or rendering that ZWNJ via conpty. It's certainly something that could be investigated, but I don't have high hopes it would work easily

@miniksa
Copy link
Member

miniksa commented May 13, 2019

OK. This weird behavior, as is, is by design. I've created two follow-on issues to dig into the different proposals here as they're separate concerns. I'll close this one as is so other complaints can be duped here.

@Luuk34
Copy link

Luuk34 commented Apr 27, 2020

'Resolutin-By-Design'..... LOL, Design must be .... 👎

@zadjii-msft
Copy link
Member

@Luuk34 This is literally the design of how ligatured fonts work. If you don't like ligatured fonts, then you're free to

but comments like "Design must be .... 👎" aren't really constructive here.

@NicTanghe
Copy link

NicTanghe commented Jun 21, 2020

:edit seeing #757 seems like the disliked comment was actually taken to heart and people are now trying to fix it.

How is it not constructive when someone gives you the most valuable information.
It pops up in a lot of different places.
From the second any other party has any responsibility Microsoft's approach has classically been its fully up to them to resolve any issues especially if it's regarding customizing aesthetics>

All that is being asked is an exception in code that states.

IF 
$path + >+ = 
Don`t
Use the code to render ligatures on  + > = 

And of course a toggle switch because people who know what they are doing don't want permanent decisions made for them.

Please don't view negative feedback as unconstructive.|

He is probably not talking about the design of the ligature fonts but about the design of how cmder handles them !

I haven't seen this functionality in any other terminal emulator in windows or Linux. But the goal should always be better than the competition by as large a margin as possible.

And ofc if your code is so bloated by company standard practices adding anything like this adds huge amount of unnecessary bloat.

Don't get me wrong much love to y'all and thx for making this emulator its now my main one.
**to bad i couldn`t figure out how to hide all the ui tho :(

@microsoft microsoft locked as resolved and limited conversation to collaborators Jun 21, 2020
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Jun 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area-Fonts Related to the font Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Resolution-By-Design It's supposed to be this way. Sometimes for compatibility reasons.
Projects
None yet
Development

No branches or pull requests

10 participants