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

Change font in 0.5.0? #65

Closed
max-sixty opened this issue Feb 11, 2018 · 15 comments
Closed

Change font in 0.5.0? #65

max-sixty opened this issue Feb 11, 2018 · 15 comments

Comments

@max-sixty
Copy link

I previously had this in my stylesheet:

terminal-view {
  .xterm {
    font-family: 'M+ 1m for Powerline';
    font-size: 11pt;
  }
}

...with the newer canvas in 0.5.0, this doesn't seem to work.

Is there a way of setting the font?

@jsmecham
Copy link
Owner

jsmecham commented Feb 12, 2018

Unfortunately (or fortunately, depending on how you look at it), Xterm 3 renders the terminal as a <canvas> and so styling with CSS is no longer possible.

I'm trying to avoid adding too many options to this package, especially before we reach a solid base 1.0 release, but let me think on this a little bit. We already use a stylesheet to read in theme colors (a bit of a hack) to pass into the Xterm instance. It's possible we could do the same for fonts. Not going to make any promises as I'm trying to keep things as lean as possible and work "most of the time for most of the users" out of the box. One of the longer term goals is for this library to be able to be extended by other packages to add features and options to do more advanced things (i.e. a terminal-tab-advanced with more configuration, etc on top of terminal-tab isn't out of the question).

@max-sixty
Copy link
Author

OK, that makes sense, and thank you for the response. I'll try and find a way of using a different theme (one not requiring a Powerline font) for within-Atom - let me know if you already have a solution for this. At the moment it doesn't look great!
image

What is the default font?

@bennypowers
Copy link

bennypowers commented Feb 12, 2018

canvas element for rendering text 🤢 but oh well: whatever upstream wants, upstream gets.

Those interested in contributing, please see xtermjs/xterm.js#1237 and xtermjs/xterm.js#958

@w8jcik
Copy link

w8jcik commented Feb 16, 2018

If you run some make command inside a terminal it throws a lot of stuff into it. Rendering of such output was adding noticeable overhead to the compilation time for my project. With canvas it is way faster, comparable to native terminal. I wouldn't complain about the decision of upstream.

@calebmeyer
Copy link

calebmeyer commented Feb 26, 2018

Is this already fixed? I'm running 0.5.3 and my styles are getting applied:
In styles.less:

// terminal styles
terminal-view {
  .xterm {
    font-family: 'Source Code Pro', Consolas, monospace;
  }
}

xterm
terminal

I'm on windows, if that matters.

@max-sixty
Copy link
Author

max-sixty commented Feb 27, 2018

Unfortunately that doesn't work for me.

I'm on Mac

While I see the same propagation in Developer Tools, it's not reflect on the canvas

@jsmecham
Copy link
Owner

jsmecham commented Feb 27, 2018

I don't believe the style rule would be having any effect. Are you using that font as your editor font, as well? If so, that's probably what is setting it.

I should have a release out today or tomorrow that contains the custom font setting, which would allow you to specify this in the settings for the package.

@calebmeyer
Copy link

Yes, I am also using it as my editor font.

@max-sixty
Copy link
Author

@calebmeyer how do you set your editor font? I have a font set it ITerm2, but that doesn't flow through to xterm

@calebmeyer
Copy link

calebmeyer commented Feb 27, 2018

As mentioned, I'm on windows (iTerm2 is one of the things I miss most from my mac days). All my settings are located here: https://gist.github.com/calebmeyer/57593e1d220fef2910e3d881852a04b3

The one you're probably looking for is this one though.

@max-sixty
Copy link
Author

Ah sorry, I mistook editor for terminal (?!).

I have Editor font set too, but it's not cascading down into xterm

But sounds like help is coming in the form of @jsmecham

@max-sixty
Copy link
Author

I installed from master and it's working beautifully!

@jsmecham
Copy link
Owner

jsmecham commented Feb 28, 2018

Closed by 656fd18 and released in 0.5.4.

@max-sixty
Copy link
Author

Well done @jsmecham - pace on this project is awesome. I hope this becomes the standard Terminal in Atom

@bennypowers
Copy link

Stupendous! Great work
screen shot 2018-03-01 at 6 50 49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants