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

[RESOLVED] sections overlap with fontconfig or patched fonts #877

Closed
oglops opened this issue May 20, 2014 · 15 comments
Closed

[RESOLVED] sections overlap with fontconfig or patched fonts #877

oglops opened this issue May 20, 2014 · 15 comments

Comments

@oglops
Copy link

oglops commented May 20, 2014

what could be the reason for this ? how can i change it ?

tried both patched fonts or the recommended fontconfig method, both the same look

check

@pcxmac
Copy link

pcxmac commented May 20, 2014

do you have 256 colors (tput colors)? There are plenty of compatible fonts, I use Inconsolata. I have yielded the best results using the rxvt-unicode terminal emulator as it offers, imo, better precision so far as configuring the environment. What works in one terminal emulator won't work in another terminal emulator, might be worth inspecting a larger variety of terminal emulators. Also another catch might be your terminal definition, see what echo $TERM says vs the terminal emulator you are using.

@oglops
Copy link
Author

oglops commented Jun 3, 2014

> tput colors
8

my ~/.tmux.conf

unbind-key C-b
set -g prefix C-a
set-window-option -g mode-keys vi
set-option -g default-terminal "screen-256color"
source '/home/user/Envs/myEnv27/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf'
> rpm -qa | grep rxvt
rxvt-unicode-9.16-1.el6.x86_64

do i need to install the 256 color version of rxvt ?

> sudo yum search rxvt
Loaded plugins: fastestmirror, priorities, refresh-packagekit, security
Loading mirror speeds from cached hostfile
2329 packages excluded due to repository priority protections
==================================================== N/S Matched: rxvt =====================================================
rxvt-unicode.x86_64 : Unicode version of rxvt
rxvt-devel.x86_64 : Header files, libraries and development documentation for rxvt
rxvt-unicode-256color.x86_64 : 256 color version of rxvt-unicode
rxvt-unicode-256color-ml.x86_64 : 256 color multi-language version of rxvt-unicode
rxvt-unicode-ml.x86_64 : Multi-language version of rxvt-unicode
mrxvt.x86_64 : Lightweight multi-tabbed X terminal
rxvt.x86_64 : ouR XVT, a VT102 emulator for the X window system

  Name and summary matches only, use "search all" for everything.

currently it looks like this , after starting tmux with tmux -2

Imgur

as you can see in the screenshot, the arrows are working finally ( i didn't change anything compared to my first post, only added -2 to the command line when i launch tmux) , but there are still some clippings between the sections . what am i missing ?

i'm using patched Inconsolata font downloaded from the official github link.

@oglops
Copy link
Author

oglops commented Jun 3, 2014

i tried to modify the config json file , but it seems it's because the empty space is not transparent.

Imgur

i tried to add more spaces to the "right" dividers, but it only ends up more space between the sections, the "space" still sits on top of adjacent section.

Imgur

@ZyX-I
Copy link
Contributor

ZyX-I commented Jun 3, 2014

Such problems usually arise from certain characters not being present in your font. If this is the case renderer may choose to take characters from different font and characters from different font have different width. Fixing this situation nicely is a responsibility of a font renderer, but I never saw one that just resizes offending character, you usually instead get such artifacts.

Powerline only adds characters to private use area, but uses various icons present in unicode but not in some particular fonts.

@oglops
Copy link
Author

oglops commented Jun 4, 2014

but i'm already using the patched fonts, ( previously also tried the fontconfig method )

@ZyX-I
Copy link
Contributor

ZyX-I commented Jun 4, 2014

@oglops As I said patcher only adds glyphs to _private use area*. It is not adding *all_ glyphs we use.

@oglops
Copy link
Author

oglops commented Jun 4, 2014

@ZyX-I sorry don't understand what you mean by "It is not adding all glyphs we use", i get my fonts from https://github.com/Lokaltog/powerline-fonts, so you mean they are not always working because "they don't contain all glyphs we use" ?

@ZyX-I
Copy link
Contributor

ZyX-I commented Jun 4, 2014

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On June 4, 2014 10:31:29 AM GMT+03:00, oglops notifications@github.com wrote:

sorry don't understand what you mean by "It is not adding all glyphs we
use", i get my fonts from
https://github.com/Lokaltog/powerline-fonts,
so you mean they are not always working because "they don't contain all
glyphs we use" ?


Reply to this email directly or view it on GitHub:
#877 (comment)

Yes.
-----BEGIN PGP SIGNATURE-----
Version: APG v1.1.1

iQJNBAEBCgA3BQJTjr6MMBwfMDI7PjIgHTg6PjswOSAQOzU6QTA9NEA+MjhHIDxr
cC1wYXZAeWFuZGV4LnJ1PgAKCRBu+P2/AXZZIhIEEACMoHggi7vQe3o8FxGC2zVt
5cezrI52MwRlNrj3uFC8oSJjXRdhRxuVBCQDljAgfqzR2B6VngEnpiCjzn7MitTE
2vyce0nSelYWb3uevjRnX5fNVUHAcuFjaDQsfhTlgi//N1bsFVIZ42JSjcCzIBpe
LXe9jr4oFnFL09QyaLsik2M3Nu6vu/CnrvMgdn6ufvYRHOJLGD2M8hKeV+IPZ3C+
sUzm9c5+QXO6L0waveOpiYbQJ3/mBsa/+A9Ff95FZp4JRhBNXeuIa6YULlZ5An2E
2saTvE9hGh80gbXElNKSHqG0hvk2KTphAczR9cLD+uCx4tNlGoYyYLfbxJ+EUSps
7ArL/y4X5C8ykSLeboK3xbretfigMuI6OHfnmPhNMf70lud/lqPA4SZ7aXUGwPeT
srw8Fcu1hwl+pf/O0C/YbQczwWbX5VPHoC/rIKjGVoVPeqNAW1hl0ZQk4klg4M32
gnf6J3Z5wT0ScAXKhhM4BXdH35jeozqDQhsYy5mJnFOCvvzYfqFALZVvrjO6LOZz
jo22JKydlr8wN6sDgQzPXiUL9h7SL8kbzH45TWlAD9RZ4KWYkgVSiRDnl6J2WZjb
BWF0o57OUXvQ2DC76XACClK6SLgrAmjh2NVaKfu4a+hNQGfioRdonIhfBLc82KOH
g59I42pE+NWBhZEFXL8nng==
=4LpM
-----END PGP SIGNATURE-----

@oglops
Copy link
Author

oglops commented Jun 4, 2014

@ZyX-I i got it "working" by using this workaround :
adding a white space to the string the date and uptime function returns. in this file
.../powerline/segments/common.py


def date(pl, format='%Y-%m-%d', istime=False):
    '''Return the current date.

    :param str format:
        strftime-style date format string
    :param bool istime:
        If true then segment uses ``time`` highlight group.

    Divider highlight group used: ``time:divider``.

    Highlight groups used: ``time`` or ``date``.
    '''
    return [{
        'contents': datetime.now().strftime(format)+' ',
        'highlight_group': (['time'] if istime else []) + ['date'],
        'divider_highlight_group': 'time:divider' if istime else None,
    }]

and

...
    return ''.join(time_formatted).strip()+' '

now it's showing "properly" if i choose to ignore the "gap" between "sections" (because of the ' ' i added)
Imgur

@ZyX-I
Copy link
Contributor

ZyX-I commented Jun 4, 2014

You do not need to patch powerline to add spaces in various places: configuration provides lots of variants including before/after segment strings and specifying space in format string for segments that accept formats.

@oglops
Copy link
Author

oglops commented Jun 6, 2014

ehh.. where ? i tried common configurations --> dividers (by adding more spaces ) but it doesn't work( although the gap is indeed wider, but they still overlap each other).

@ZyX-I
Copy link
Contributor

ZyX-I commented Jun 6, 2014

@oglops In theme (themes/tmux/default.json/{segment_data,segments/{right,left}}). For date you can use args/format (check out how it is used in time segment), for all segments you should specify before/after keys in theme.

@ZyX-I
Copy link
Contributor

ZyX-I commented Jun 6, 2014

Using config.json/common/dividers/{left,right}/{hard,soft} will affect all spaces, my variant is more specific.

@oglops
Copy link
Author

oglops commented Jun 6, 2014

@ZyX-I just tried adding spaces to config.json/common/dividers/{left,right}/{hard,soft} doesn't work, but adding before / after to themes/tmux/default.json/{segment_data,segments/{right,left}} works. ( i copied configuratino to ~/.config as suggested in the doc )

thanks very much !

@oglops oglops changed the title sections overlap with fontconfig or patched fonts [RESOLVED] sections overlap with fontconfig or patched fonts Jun 6, 2014
@oglops oglops closed this as completed Jun 6, 2014
@oglops oglops reopened this Jun 6, 2014
@ZyX-I
Copy link
Contributor

ZyX-I commented Jun 6, 2014

Why reopening?

@oglops oglops closed this as completed Jun 8, 2014
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

3 participants