-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: Add ligatures support #126
Conversation
I'm not sure we should change this. I don't think most people would want the terminal to use the same font as the editor and if they do they can already change it. I think monospace is a good default. |
@UziTech No it is the other way around. That is why in Atom we import the variables in Less and we use Not doing this is also a bug. Monospace does not support ligatures and Pipelines which results in a very bad default configuration. See the missing fonts. |
I agree theres an issue with font ligature support, the problem you forgot is that Cascadia font types arent available as a default/preinstalled font on most OS's. Until fonts with ligatures support are shipped in Windows/macOS/Linux this will always be an issue, I dont think its the x-terminal responsibility to ship these fonts, but the OS's responsibility. To go along with the PR we would need to ship and install cascadia font types to suit most users setups not just one. Also I disagree that we should enforce ANY font by default, it should always be inherited or with monospace fallback, then if a user want ligatures, then its up to user. |
318d650
to
b9e4daf
Compare
If you like we can do that! The installation is very easy.
Yes, that is why I made this pull request. You should not hardcode This code actually means inheritance from what the default Atom setting: atom.config.get('editor.fontFamily').split(',')[0] |
We shouldnt hardcode cascadia either
I clearly said that this isnt an option IMO
@UziTech thoughts? |
We did not. That one was just a test for running the spec. 😄 |
You're now using Menlo in tests which is also not a common available font by default in all 3 supported OS's either. Defining monospace will use the first monospaced font available in OS so if you have Menlo it will use that and so on and so on.. Im not sure it matters in tests but best to leave as it was. |
Menlo is used by default in Atom. The tests were failing that is why I changed it to I will revert it but the tests will fail. |
Before the PR tests worked or not?
Depends on OS, Menlo was a macOS font IIRC |
That was because you were hardcoding |
Again the default font chosen depends on OS, Windows will not ship Menlo at all, youseem to be designing the PR assuming fonts exist when they dont. FYI the correct is to define monospace isnt an actual font its a catch all for the monospace font familly Also related https://github.com/atom/atom/search?q=--editor-font-family&unscoped_q=--editor-font-family from atom/atom#16731 |
I did not assume Menlo comes by default 😄 There is some miscommunication here. This PR is about: "Do not override a font in a package when Atom already chooses a font". This font may be whatever the user chooses, or whatever Atom decides. I just set
|
Won't |
I fixed this in c6110e4. Now it uses the whole font family. |
It might be better to add a "Use Atom Font Family Setting" checkbox setting which is off by default since I still believe that most people don't want the same font in the editor as in the terminal. |
I added the configuration.
No, it is the other way around. No Atom plugins ever change the fonts in their plugin. Everyone assumes that the font settings they have set in the settings are used everywhere unless they explicitly request it. Not doing this makes the Atom ecosystem complex and hard to use for the users. They should go through each plugin and change the fonts. |
Should we just always have ligatures enabled, since it won't do anything unless the font supports ligatures, and add a note to webgl about ligatures not working if webgl is enabled? |
Isn't it better to conditionally disable ligatures the actual checkbox and functionality whenever webgl is enabled. Seems more intuitive |
How do we disable the check box in the settings view? |
I feel like it would be most intuitive if the user sets the font to one that supports ligatures they just work without needing to also enable the addon. |
I didn't follow the discussion much. But I don't have any issue with ligatures that come with a font. |
@aminya ligatures work for you in x-terminal without enabling the addon? What font are you using and what version of Atom? |
Cascadia Code: https://github.com/microsoft/cascadia-code#installation |
It was the version of electron I was looking for. Cascadia Code doesn't show ligatures in x-terminal for me unless ligatures addon is enabled and the webgl addon is disabled. I tried using atom v1.51.0 and v1.52.0-beta0. |
Oh. Yeah. You are right. It only works inside the git status showers oh-my-posh, not in the text itself. |
The we would need to ship the necessary fonts in such a case. Cascadia Code and Fira Code would be ideal as they are maintained and make semi-regular releases. Both Atom and x-terminal are set t use Cascadia Code on my end however I dont have any powerline prompts as I think Windows + git bash requires a modded git bash https://github.com/sschleemilch/gitbash-powerline but thats outdated and Ive never tried it. Ide prefer to use the default git bash |
I want to include a better font as the default font in atom-community build. I like juliamono among all. It is a mono like font (unlike Cascadia which is aligned a little strange). It has a huge number of ligatures. |
We wouldn't need to ship anything. If the ligatures addon is not enabled then no fonts use ligatures (even ones like Therefore I think we should always enable the ligatures addon and add a note to the webgl setting that ligatures might not work when webgl is enabled. If a user wants ligatures in x-terminal all they would have to do is set the font to a font that supports ligatures. If the user does not want ligatures they would set the font to on that does not support ligatures. No need for a checkbox to enable or disable them. |
I disagree, as per my previous comments. We shouldnt let something break in these condiitions, and according to you thats what we are going to do, adding more words is not a user friendly substitution. |
What is breaking? |
According to you
Emphasys on the bolded part, also might is not a definitive, it eiter works or doesnt, and since webgl hasnt had support for ligatures (according to your earlier post) then it wont work and thus breaks. We shouldnt allow this. |
How can we prevent this? How can we disable a checkbox in the settings view? Answer: we can't. Therefore all we can do is inform people that if they use a font that supports ligatures and enable webgl then ligatures won't work. Either way having a checkbox to enable/disable ligatures is not useful. Since the ligatures addon is essentially a no-op when webgl is enabled, it doesn't help to have a checkbox to enable/disable it. |
As I've said before the ligatures addon does not break the webgl addon so there is no point in disabling it ever. The webgl addon does break the ligatures addon so we should (and do) have a way for the user to enable/disable it if they want, or don't care about, ligatures. |
I used might because it most likely will work in the future, so if we forget to remove that note when it does start working then it might work. |
lol, seriously, the webgl does break the ligatures addon. Im pretty sure we already talked about this.
I know that it doesnt work now in present, which is what matters |
I didn't say webgl doesn't break the ligature addon. I said the ligature addon doesn't break the webgl addon. There is a difference. If you read the whole thing I agree that the webgl addon breaks the ligature addon which is why we need a checkbox for the webgl addon not the ligatures addon. |
Let me try to say this as explicitly as I can: If the user enables the webgl addon then x-terminal works the same whether the ligatures addon is enabled or disabled. Therefore there is no point in disabling the ligatures addon when the webgl addon is enabled. |
So now, ligatures addon is permanently enabled and if a user enables webgl the ligatures support will no longer work. is this correct? |
Yes. There is currently no way to support ligatures with the webgl addon enabled. Ligatures being always enabled doesn't hurt anything. Essentially if a user has webgl enabled then everything will work the same as it currently does without this PR. If the user does not have webgl enabled then ligatures will work provided they have the font setting set to a font that supports ligatures. |
Furthermore once webgl does support ligatures then they will work with webgl enabled without us needing to change any code. (Other than updating the webgl addon) |
I'm going to merge this so we can get ligature support in x-terminal. If we want to add a checkbox for the addon we can do it in another PR. |
🎉 This PR is included in version 10.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This inherits the font setting from the editor.
Now the terminal is the same as my editor: