Powerline Fonts in ChromeOS

2,634 views
Skip to first unread message

armand...@gmail.com

unread,
Aug 24, 2015, 3:33:11 AM8/24/15
to chromium-hterm
Hello,

I have successfully installed powerline fonts from: https://github.com/powerline/fonts.  When I try to apply one of the fonts with the command:

mosh_client_.io.terminal_.prefs_.set('font-family', 'Monofur for Powerline');

As you can see in the screenshot I have attached the cursor input gets pushed over a few tabs when I use a powerline font.  Resetting the font makes this problem go away. 

Any help is greatly appreciated.

Armando
Screenshot 2015-08-24 at 12.29.49 AM.png

Aravind Krishnan

unread,
Aug 24, 2015, 10:11:02 AM8/24/15
to armand...@gmail.com, chromium-hterm
Hi,

I believe it might be an artifact of the font. Of all the powerline fonts available in https://github.com/powerline/fonts,
the following have worked for me. 

term_.prefs_.set('font-family', 'Ubuntu Mono derivative Powerline');
term_.prefs_.set('font-family', 'monofur for Powerline');
term_.prefs_.set('font-family', 'Source Code Pro for Powerline');
term_.prefs_.set('font-family', 'DejaVu Sans Mono for Powerline');
term_.prefs_.set('font-family', 'Anonymous Pro for Powerline');

The only other font option I set is:
term_.prefs_.set('font-smoothing','subpixel-antialiased');

The long whitespace may also be because of your BASH prompt command, or your PS1 variable.

Try setting it to something simple like PS1="[\u@\h:\w ] $ " in your bashrc file. If that works, and you then want a powerline bash, try something like https://github.com/milkbikis/powerline-shell.

Regards,
Aravind

--
You received this message because you are subscribed to the Google Groups "chromium-hterm" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-hterm/3f1da4f2-31af-4db0-bd00-045e4217dfa5%40chromium.org.

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-hter...@chromium.org.

Robert Ginda

unread,
Aug 24, 2015, 12:50:30 PM8/24/15
to armand...@gmail.com, chromium-hterm
hterm depends on monospace fonts.  Proportional fonts will cause positioning issues.

Two things are funny about your screenshot.  First, the tilde character looks to be about twice as wide as any other character, indicating that it's a proportional font.  Second, it doesn't look anything like the screenshots I found of "Monofur for powerline".  I suspect you don't actually have it installed properly.  What you're seeing is probably just a default font chosen by Chrome.


Rob.

--

armand...@gmail.com

unread,
Aug 25, 2015, 12:41:24 AM8/25/15
to chromium-hterm, armand...@gmail.com
I have installed the fonts from https://github.com/powerline/fonts to ~/fonts using the install script.  Specifying different fonts such as Sauce Code Pro does change the font however this extra space still exists regardless of which font I choose.  Does anyone have any advice for installing fonts under chromeos?  I too thought that it may be an issue with my prompt I am using zsh not bash.  This oh my zsh theme seems to work ok if I use a mosh client under ubuntu with a powerline font loaded in urxvt or another terminal.  
Screenshot 2015-08-24 at 9.32.26 PM.png

wbe...@google.com

unread,
Sep 28, 2015, 9:38:55 AM9/28/15
to chromium-hterm, armand...@gmail.com
I wonder what you mean and how you did "successfully installed powerline fonts [in ChromeOS]". I think the only way (without installing another OS or doing some horrible hack) is to use Google Fonts, which would be a really neat solution.

wbe...@google.com

unread,
Sep 28, 2015, 10:22:24 AM9/28/15
to chromium-hterm, armand...@gmail.com, wbe...@google.com
I'll refer here pointer to methods that should work:

wbe...@google.com

unread,
Sep 28, 2015, 10:36:59 AM9/28/15
to chromium-hterm, armand...@gmail.com
Now it gets interesting, as with some work may be only in "Secure Shell", to support font-face, it should actually work without hack (meaning it could even be in the configuration UI). Only need to allow have at be beginning of the CSS:


Then just update font-family via existing configuration setting: term_.prefs_.set('font-family', '"SourceCodePro", "DejaVu Sans Mono", "Everson Mono", FreeMono, "Menlo", "Terminal", monospace');


On Monday, August 24, 2015 at 9:33:11 AM UTC+2, armand...@gmail.com wrote:

Robert Ginda

unread,
Sep 28, 2015, 12:22:14 PM9/28/15
to wbe...@google.com, chromium-hterm, Armando Cerna
Secure Shell already lets you include a custom css file.  See https://groups.google.com/a/chromium.org/forum/#!msg/chromium-hterm/dFVAhCvaI4Q/G675nendpFAJ.  For Powerline, you'll have to host a css file on the web somewhere.  Github pages are free and will work fine.


Rob.

--
You received this message because you are subscribed to the Google Groups "chromium-hterm" group.

wbe...@google.com

unread,
Sep 30, 2015, 8:47:46 AM9/30/15
to chromium-hterm, armand...@gmail.com
Tried but didn't work unknown reasons. May be https? I short I copied the content of the sample user-css to a Gist but it doesn't work:


Any idea why? Response seems to be the same.


On Monday, August 24, 2015 at 9:33:11 AM UTC+2, armand...@gmail.com wrote:

wbe...@google.com

unread,
Sep 30, 2015, 9:00:32 AM9/30/15
to chromium-hterm, armand...@gmail.com
Tried with http://dpaste.com/2PWRK4R.txt (so no https) and seems still not working. So far I only got the sample URL (in my previous post) to work. Nothing else.

I wonder why not let users type directly CSS inside that text field, but Gist and similar are also decent solutions if they work.


On Monday, August 24, 2015 at 9:33:11 AM UTC+2, armand...@gmail.com wrote:

wbe...@google.com

unread,
Sep 30, 2015, 11:15:01 AM9/30/15
to chromium-hterm, armand...@gmail.com, wbe...@google.com
Work in progress, currently the Codepen isn't working even though I use woff2 and so on. You can bring your ideas to fix it:

wbe...@google.com

unread,
Oct 1, 2015, 6:17:06 AM10/1/15
to chromium-hterm, armand...@gmail.com, wbe...@google.com
Youhou! Got a working solution without hack: https://github.com/wernight/powerline-web-fonts

Currently only added support for Source Code Pro for Powerline, but any other powerline font would work.

It's however strange that https:// is not supported.

ashr...@gmail.com

unread,
Oct 27, 2015, 9:31:03 PM10/27/15
to chromium-hterm, armand...@gmail.com, wbe...@google.com
Nice!  Your powerline-web-fotnts solution worked for me and I have powerline on my Chromebook for the first time ever.  This has inspired me to try the same with localhost for those times when the wi-fi is out of range.

wbe...@google.com

unread,
Oct 28, 2015, 4:35:28 AM10/28/15
to chromium-hterm, armand...@gmail.com, wbe...@google.com, ashr...@gmail.com
Thanks, but why would you need SSH when you don't have WiFi?

ashr...@gmail.com

unread,
Oct 28, 2015, 9:03:08 AM10/28/15
to chromium-hterm, armand...@gmail.com, wbe...@google.com, ashr...@gmail.com
Who said anything about SSH?  I use crouton for local Ubuntu development, and hterm to access the shell.  :)

Werner Beroux

unread,
Oct 28, 2015, 9:54:18 AM10/28/15
to ashr...@gmail.com, chromium-hterm, armand...@gmail.com
In that case yes you can have it run locally without issue. I guess you could even have the font actually installed if you do that.

Feel free to send a PR on my GitHub with for example steps in the README to have it work locally for people who enabled Developer mode and/or Crouton.
Reply all
Reply to author
Forward
0 new messages