-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Request for feedback: Patched fonts may be unnecessary for many users #60
Comments
I couldn't get this to work on Mac OSX. I did the following:
All this resulted in the same results as @kwbr Cheers |
Couldn't make OS X fallback to grabbing the symbols from that font either. |
Just tried this on Linux Mint Debian, did not work. |
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 <?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. |
@amadeus What happens if you select the PowerlineSymbols font as the font in your terminal/gvim? |
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? |
Not that i am able to find, unfortunately. |
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 |
Modifiying the fonts.conf (in my case ~/.fonts.conf) as described works! |
Excellent! Does it look nice as well, or does it have big gaps, weird offsets, etc. on your setup? |
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. |
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. |
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. |
@Lokaltog Works as expected. Perfect! As I use PragmataPro the file suites my needs. |
@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. |
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 |
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. |
@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 |
@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. |
Hmm, which font are you using then? It may not be present in the fontconfig file. |
@Lokaltog Inconsolata normally, but I tried other fonts specifically listed in the fontconfig you provided. |
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). |
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. |
Adding
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.
|
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. |
That's an excellent idea, let's do that! |
@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. |
@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. |
@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. |
@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. |
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. |
@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. |
@ZyX-I Allright, I'll try Konsole today and see how it works. ;) |
@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! |
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). 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. 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: |
@skinner33 I have urxvt compiled with unicode3 and it never worked for me.
|
argh just saw that the unicode3 was already mentioned above ... @gregf 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. |
@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.
|
@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? |
@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. |
@gregf i newer said that i didn't had a patched font, in fact i'm using a patched Inconsolata. |
@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. |
@skinner33 I'm sorry, I miss understood your original post! |
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: . Has 1 pixel shift , 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) 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. |
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. |
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:
|
After moving the glyphs to the private use area I've done some testing and on my system and it appears that I don't actually have to have a patched font for the custom glyphs to work anymore. The glyphs look nice in all the coding fonts I've tried.
I've added a font file with only the patched symbols in it in 2cfd01e (located in
powerline/fontpatcher/PowerlineSymbols.otf
), and I'd like users on different systems to try this and see which systems this workaround works on.EDIT: Please try these instructions instead!
Steps to reproduce (for Linux users, but probably quite similar for OSX users):
PowerlineSymbols.otf
to~/.fonts
.fc-cache -vf ~/.fonts
My system is running Arch Linux and vim in the Xfce Terminal. Let me know which systems and fonts you're using, and feel free to provide screenshots of how it looks.
Thanks!
The text was updated successfully, but these errors were encountered: