Giter Club home page Giter Club logo

Comments (54)

Lokaltog avatar Lokaltog commented on July 22, 2024 3

I was also very attached to urxvt (and later Gnome Terminal), but ZyX-I convinced me to try out Konsole and I'm really happy with that. Just configure away the menu line and tabs and all that stuff and fix the colors, and you have basically the exact same thing. And in addition:

  • True color support
  • Possibility to change all Terminal properties with an escape sequence (e.g. switch cursor properties in insert mode)
  • Much better fontconfig support and very nice antialiasing
  • Very good performance

from powerline.

ZyX-I avatar ZyX-I commented on July 22, 2024 1

Feedback:

Konsole, terminus, 11pt: Weird @

Konsole, terminus, 14pt: Invalid symbols: z`

Konsole, Ubuntu Mono: Not centered

Konsole, Droid Sans Mono: Fine Fine (but not Droid Sans Mono Dotted/Slashed)

Konsole, Liberation Mono: Fine Fine

Konsole, Bitstream Vera Sans Mono: Fine Fine (with bigger font not so fine, but font is not so fine as well).

Konsole, Lucida terminal: same as Terminus.

Konsole, Inconsolata: Fine Fine

Konsole, DejaVu Sans Mono: Fine Fine

Konsole, Monospace, 13pt: Fine Fine

Konsole, Monospace, >13pt: >=1px gap between one or another border >=1px gap between one or another border.


Xterm launched with xterm -fa DroidSansMono: No symbols


Rxvt-unicode launched with urxvt -fn "-bitstream-bitstream vera sans mono-medium-r-*-*-17-*-*-*-m-*-iso10646-1" -fb "-bitstream-bitstream vera sans mono-bold-r-*-*-17-*-*-*-m-*-iso10646-1": No symbols


Konsole, Terminus, 11pt with additions to 10-powerline-symbols.conf: Not centered. Additions:

<alias>
    <family>Terminus</family>
    <prefer><family>PowerlineSymbols</family></prefer>
</alias>

Anonymous skipped (no stable version).

Consolas, source code pro, menlo, pragmato*, monaco, envy code r skipped (not present in repository).

from powerline.

kwbr avatar kwbr commented on July 22, 2024

Does not work in Debian (unstable) distribution. I see only artifacts. I use gnome-terminal by default but also tried xfce4-terminal and various fonts.
screenshot

Seems Arch Linux is more advanced in it's font system. What is it?

from powerline.

amadeus avatar amadeus commented on July 22, 2024

I couldn't get this to work on Mac OSX.

I did the following:

  1. Removed all powerline enabled fonts. Replaced with stock versions
  2. Installed this custom symbols font.
  3. Used an App called Cocktail to clear the font cache.
  4. Restarted and launched MacVim.

All this resulted in the same results as @kwbr

Cheers

from powerline.

rizzatti avatar rizzatti commented on July 22, 2024

Couldn't make OS X fallback to grabbing the symbols from that font either.

from powerline.

imaginationac avatar imaginationac commented on July 22, 2024

Just tried this on Linux Mint Debian, did not work.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

Crap, that's unfortunate. Thanks a lot for trying it though. Do you all get the exact same result as kwbr? Because in his case it appears that he already has another font on his system that occupies the same code points as Powerline, and for some reason fontconfig chooses to use that other font as a fallback instead of PowerlineSymbols. I've done some research and I think this may allow Linux users to define the order of fallback fonts, it would be great if you could try this.

Add the following to either ~/.config/fontconfig/fonts.conf or ~/.fonts.conf depending on your fontconfig version:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>
    <!-- ... -->

    <alias>
        <family>monospace</family>
        <prefer>
            <family>PowerlineSymbols</family>
            <family>YOUR MONOSPACE FONT HERE</family>
        </prefer>
    </alias>

    <!-- ... -->
</fontconfig>

Then set the font in your terminal emulator or gvim to "monospace". You may have to close all instances of terminals/gvim or even restart X for the changes to take effect.

The point here is that fontconfig has a feature that automatically chooses a fallback font for missing glyphs in the current font (I don't have many fonts on my system and none of my fonts use any code points in the PUA which may be the reason this works for me). If it's possible to define PowerlineSymbols as the default fallback font any applications will automatically select the special glyphs for any font that doesn't already have them. This workaround will set PowerlineSymbols as the default/top priority monospace font, with your monospace font of choice as the fallback font.

Unfortunately it appears that OS X doesn't support this feature for glyphs in the PUA, but if anyone is up for the task and wants to investigate this issue on OS X it would be greatly appreciated.

from powerline.

amadeus avatar amadeus commented on July 22, 2024

This is what my powerline looks like without a special font on OSX, 1.8.2
powerline-error

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

@amadeus What happens if you select the PowerlineSymbols font as the font in your terminal/gvim?

from powerline.

amadeus avatar amadeus commented on July 22, 2024

It looks like it applies Lucida Grande (the default Mac OSX font)
Screen Shot 2013-01-17 at 11 21 05 PM

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

Whey, it looks like a step in the right direction at least! Is there somewhere in OS X you can select the default system-wide monospace font?

from powerline.

amadeus avatar amadeus commented on July 22, 2024

Not that i am able to find, unfortunately.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

I've tried googling around as well, and it doesn't seem to be a built-in way of customizing the font in OS X. Found this, but it seems like more of a hassle to install that and changing your settings than just installing a patched font in OS X.

Edit: We could say that the trick works for anyone who enjoys the default monospace font in OS X though. :P

from powerline.

kwbr avatar kwbr commented on July 22, 2024

Modifiying the fonts.conf (in my case ~/.fonts.conf) as described works!

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

Excellent! Does it look nice as well, or does it have big gaps, weird offsets, etc. on your setup?

from powerline.

kwbr avatar kwbr commented on July 22, 2024

Looks good.

But now every Monospace font is the same as the Terminal's font. This may be a problem for some users if they want to use different fonts for Browsers and Terminals.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

That's true, but it's still possible to customize the monospace font to another one in browsers. It's a tradeoff, but I have the impression that most users use the same monospace font system-wide.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

It may be possible to workaround the issue, I'm investigating if there's some fontconfig magic that allows us to add the symbol font as a prioritized system font without overriding the default monospace font.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

@kwbr Can you try this: Remove the other fontconfig stuff you used, and copy this file into ~/.fonts.conf.d/, and see if you still get the correct glyphs.

from powerline.

kwbr avatar kwbr commented on July 22, 2024

@Lokaltog Works as expected. Perfect! As I use PragmataPro the file suites my needs.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

@kwbr Awesome. The glyphs are made for Pragmata Pro by the author of the same font so they work very well with that font ;) Thanks for the help!

I'll leave this issue open in case someone experiences some other problems with this method.

from powerline.

 avatar commented on July 22, 2024

I'm running into the same issue @kwbr was earlier. I'm on debian testing, but haven't come up with a solution yet. I have tried placing 10-powerline-symbols.conf in both ~/.config/fontconfig/conf.d/ and ~/.fonts.conf.d/ as well as restarting xorg.

2013-01-19-000932_834x17_scrot

from powerline.

ZyX-I avatar ZyX-I commented on July 22, 2024

Summary: terminus, Ubuntu Mono are not working well. Bitstream Vera Sans Mono, Monospace work fine for relatively small sizes. Nothing works in xterm/rxvt-unicode.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

@gregf Which terminal emulator are you using? And have you set the required UTF-8 environment variables as specified in the docs?

@ZyX-I Nice! What do you think, should we add terminus to the fontconfig file even if it looks bad? Edit: rxvt-unicode doesn't work at all unless it's compiled with --enable-unicode3, and I think you can manually specify the fallback font by having two xorg font names separated by a comma.

from powerline.

 avatar commented on July 22, 2024

@Lokaltog Using rxvt-unicode with unicode3 enabled. My locale is set to en_US.UTF-8, and both my vimrc and tmux.conf have utf-8 enabled. I also tested in xterm with multiple fonts same problem.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

Hmm, which font are you using then? It may not be present in the fontconfig file.

from powerline.

 avatar commented on July 22, 2024

@Lokaltog Inconsolata normally, but I tried other fonts specifically listed in the fontconfig you provided.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

That's too bad. I'll look into how you can specify fallback fonts for urxvt (I'm not even sure if it uses fontconfig since it reads its settings from Xresources or the command line).

from powerline.

 avatar commented on July 22, 2024

Curious as to what terminal you are using? I wasn't able to get it working in xterm either, but it could very well work in the same way as urxvt for all I know.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

I'm using the Xfce Terminal app. I just remembered that the other terminals I've tried had terrible antialiasing because they didn't read any of my fontconfig files, so if you set the font in Xresources you probably have to put the fallback font there too. Can you try to add something like this to your Xresources/Xdefaults:

URxvt.font: xft:PowerlineSymbols:pixelsize=11,xft:Inconsolata

from powerline.

ZyX-I avatar ZyX-I commented on July 22, 2024

What do you think, should we add terminus to the fontconfig file even if it looks bad?

I guess we need to add another font. Note: it does not only look bad, it moves baseline of the normal symbols, thus p’s and other symbols extending below baseline are getting truncated. Without this issue fixed Terminus font should not be present in fontconfig at all, same for Ubuntu Mono.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

Not sure if it's even possible to resolve the issue, there's really not much we can do with the symbol font without screwing up every other font. I'll remove Ubuntu Mono from the fontconfig file until a fix is discovered.

from powerline.

 avatar commented on July 22, 2024

Adding URxvt.font: xft:PowerlineSymbols:pixelsize=11,xft:Inconsolata to my config gives me the the following error.

urxvt: unable to calculate font width for 'PowerlineSymbols:pixelsize=11:minspace=True', ignoring.
urxvt: unable to load base fontset, please specify a valid one using -fn, aborting

So, I tried reversing the order of the fonts, and initially there was no error. When I fire up vim or tmux I then see this printed to console.

urxvt: unable to calculate font width for 'PowerlineSymbols:slant=0:weight=100:pixelsize=11:minspace=True', ignoring.

from powerline.

ZyX-I avatar ZyX-I commented on July 22, 2024

Not sure if it's even possible to resolve the issue, there's really not much we can do with the symbol font without screwing up every other font. I'll remove Ubuntu Mono from the fontconfig file until a fix is discovered.

I did not suggest adding a fix to existing font: I believe it is not possible without breaking something. I suggested to add another font (maybe more then one) and update fontconfig so that Ubuntu Mono and Terminus will use this new font.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

That's an excellent idea, let's do that!

from powerline.

 avatar commented on July 22, 2024

@Lokaltog well for the mean time I have switched to xfce4-terminal, which is a lot nicer than I had expected. Works just fine there. Thanks for the help.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

@gregf I personally would recommend you to stick with it, unless you find one that's much better for you. I've tried all the most common terminal emulators after I ditched urxvt and I think the Xfce terminal is the best I've tried. It listens to fontconfig so the font rendering is nice, it doesn't screw up the private use area, the only downside is that urxvt appears to have better performance and customizability but I don't think it's worth it if you're going to use Powerline. I'm glad that the issue got resolved for you.

from powerline.

ZyX-I avatar ZyX-I commented on July 22, 2024

@Lokaltog And what’s with Konsole? It does not screw up the private use area and listens to fontconfig as well, but also supports 24-bit color: the only one from the list (except for tilda, guake, lilyterm, lxterminal, mt (though don’t think it will be different from sakura), sjterm, termit, termite which were not tested). Yakuake is known to also work well, but I consider it not being a separate thing from konsole.

All terminal emulators from that list are said to use vte library (and tilda also pulls this as a dependency, though not said to use vte in arch wiki), so they are all not expected to work with 24-bit as some other vte-based do not.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

@ZyX-I Depends on whether you're using mainly Qt or GTK based apps, I guess. I don't have KDE or any other Qt based apps on my system, so installing Konsole pulls a hefty 200MB of dependencies along with it. I should have added that I haven't tried the other Qt apps for the same reason, but for GTK users the Xfce terminal works great. Edit: And it sucks if it won't support 24-bit colors in the foreseeable future, because that looks like an awesome feature.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

Closing this as it seems to work fine for the users who are able to use this method, and instructions have been added to the docs.

from powerline.

ZyX-I avatar ZyX-I commented on July 22, 2024

@Lokaltog I use mainly Qt or Qt/KDE apps, but if gtk apps were the first ones that worked fine for achieving specific task they are installed and kept; and I actually have a number of them. I see no reason to be afraid of having both toolkits, you just prevent yourself from using better applications if you forbid any of the toolkits.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

@ZyX-I Allright, I'll try Konsole today and see how it works. ;)

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

@ZyX-I So Konsole quickly became my default terminal emulator, and I absolutely love the possibility of changing properties like the cursor shape via escape codes!

from powerline.

skinner33 avatar skinner33 commented on July 22, 2024

I think i 'know' why the patched fonts don't work with urxvt.

Apparently urxvt supports some kind of combining of characters to form new characters (manual, --enable-combining).
Therefore urxvt uses the private use area, which is also used by the new symbols in powerline (in vim-powerline they were in a lower area), and always assumes that symbols in this area are home-made and don't use the font.

So, what to do?

I took a look at the source (well, i did that before to be accurate :P) and found that urxvt uses 3 different ranges, depending on the compiler flags:

With perl supoort enabled it is 0xe000 - 0xf8ff (57344 - 63743) which leads to the known faulty behavior.
When perl is not enabled the lower bound starts at 0xd800 (55296).

I have no idea why the bound depends on the perl support, although it doesn't matter.

So the good news: if you don't care about memory usage there is another bound:

With unicode3 enabled (--enable-unicode3), the lower bound is 0x40000000.

According to the manual, this will increase the memory used for one screencell (e.g. a character in the scrollbackbuffer) by 2 byte to 8 bytes, but the fonts work

tl;dr:
if urxvt is compiled right (--enable-unicode3), it will work with the powerline fonts.

from powerline.

 avatar commented on July 22, 2024

@skinner33 I have urxvt compiled with unicode3 and it never worked for me.

rxvt-unicode (urxvt) v9.15 - released: 2012-01-21
options: perl,xft,styles,combining,blink,iso14755,unicode3,encodings=eu+vn+jp+jp-ext+kr+zh+zh-ext,fade,transparent,tint,pixbuf,XIM,frills,selectionscrolling,wheel,slipwheel,smart-resize,cursorBlink,pointerBlank,scrollbars=plain+rxvt+NeXT+xterm

from powerline.

skinner33 avatar skinner33 commented on July 22, 2024

argh just saw that the unicode3 was already mentioned above ...

@gregf
i have the following urxvt

rxvt-unicode (urxvt) v9.16 - released: 2012-11-06
options: perl,xft,styles,combining,blink,iso14755,unicode3,encodings=eu+vn+jp+jp-ext+kr+zh+zh-xt,fade,transparent,tint,pixbuf,XIM,frills,selectionscrolling,wheel,slipwheel,smart-resize,cursorBlink,pointerBlank,scrollbars=plain+rxvt+NeXT+xterm

Furthermore i have some patches applied, essentially its this package with unicode3.

Also are you sure you have the right font configured? try ctrl + shift + 52, then while still holding ctrl + shift, in the 4th line the font used should be given.

from powerline.

 avatar commented on July 22, 2024

@skinner33 It appears our options are the same. I was a version behind you, and missing the font-width.patch. So I removed urxvt from my system, and compiled it by hand using the patches, and same options from the PKGBUILD you provided. Sadly, it still doesn't work on my end.

I am Currently using Inconsolata.

URxvt*font:     xft:inconsolata

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

@gregf I think you have to use a patched font with urxvt (I haven't been able to make the fallback font method to work), have you tried using Inconsolata from the powerline-fonts repo?

from powerline.

 avatar commented on July 22, 2024

@Lokaltog I switched to xfce4-terminal after your recommendation. I was just speaking with @skinner33, as he posted above he had it working without the patched font.

from powerline.

skinner33 avatar skinner33 commented on July 22, 2024

@gregf i newer said that i didn't had a patched font, in fact i'm using a patched Inconsolata.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

@gregf Ah, I see.

Anyways, regarding the urxvt support: the official recommendation is to switch to another terminal emulator unless you have a very good reason to keep using urxvt. It works in several strange, non-standard ways (the defective unicode support and lack of fontconfig support are two good examples) and I personally haven't missed any urxvt-specific fuctionality after switching to another terminal emulator. If a patched font works then all is good, but if you don't require any specific urxvt features and don't want to compile your own unicode3 variant you might as well switch to something else.

from powerline.

 avatar commented on July 22, 2024

@skinner33 I'm sorry, I miss understood your original post!

from powerline.

ZyX-I avatar ZyX-I commented on July 22, 2024

I was false about Terminus: it displays fine, except for branch symbol. And except for the case when you try to force konsole to display terminus with unsupported size. I.e. without branch segment it displays as following:

1 px shift

. Has 1 pixel shift

1 px shift: zoomed

, but it is hard to notice without zooming. Fontforge shows that arrow symbol extends 5 points (?) beyond branch symbol. Altering branch symbol so that its vertical dimensions match those of hard arrow did not fix the issue: (old new, “z” fragment is the same for both)

Old branch, new branch, shifted z

Altering it so that horizontal dimensions also are not greater then wide arrow ones did not fix the issue as well. I have no other ideas.

from powerline.

kierun avatar kierun commented on July 22, 2024

Which terminal would you recommend to replace urxvt?

I cannot get the terminus font to work for it and while I am attached to urxvt, I can be convinced to use something else.

from powerline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.