ryanoasis / nerd-fonts

Iconic font aggregator, collection, & patcher. 3,600+ icons, 50+ patched fonts: Hack, Source Code Pro, more. Glyph collections: Font Awesome, Material Design Icons, Octicons, & more
https://NerdFonts.com
Other
54.73k stars 3.65k forks source link

Font rendering issue urxvt #150

Closed BigfootN closed 7 years ago

BigfootN commented 7 years ago

Hello,

I am having problems when using one of your font in urxvt. It sometimes leaves pixels behind. Here is an example: capture d ecran de 2017-04-06 15-55-38

You can see on the left that there are some kind of pixels. I tried with gnome-terminal and no problem.

Here is my Xresoures:

!------------------
!  URxvt Settings
!------------------

! scrollbar
URxvt*scrollBar: false
URxvt*internalBorder: 20

! disable ctrl-shift
URxvt*iso14755_52: false
URxvt*iso14755: false

URxvt*letterSpace: -1
!----------------
!  Xft Settings
!----------------

Xft*dpi: 82
Xft*antialias:  true
Xft*hinting:    true
Xft*rgba:       rgb
Xft*autohint:   false
Xft*hintstyle:  hintfull
Xft*lcdfilter:  lcddefault

!----------------
!  Font Setting
!----------------

URxvt.font: xft:FuraCode Nerd Font:style=Regular:size=11
URxvt.boldFont: xft:FuraCode Nerd Font:style=Regular:size=11

!----------
!  Colors
!----------

URxvt.background: #262626
URxvt.foreground: #ffffff

! Black + DarkGrey
*color0:  #282828
*color8:  #928374
! DarkRed + Red
*color1:  #cc241d
*color9:  #fb4934
! DarkGreen + Green
*color2:  #98971a
*color10: #b8bb26
! DarkYellow + Yellow
*color3:  #d79921
*color11: #fabd2f
! DarkBlue + Blue
*color4:  #458588
*color12: #83a598
! DarkMagenta + Magenta
*color5:  #b16286
*color13: #d3869b
! DarkCyan + Cyan
*color6:  #689d6a
*color14: #8ec07c
! LightGrey + White
*color7:  #a89984
*color15: #ebdbb2

URxvt.color24:  #076678
URxvt.color66:  #427b58
URxvt.color88:  #9d0006
URxvt.color96:  #8f3f71
URxvt.color100: #79740e
URxvt.color108: #8ec07c
URxvt.color109: #83a598
URxvt.color130: #af3a03
URxvt.color136: #b57614
URxvt.color142: #b8bb26
URxvt.color167: #fb4934
URxvt.color175: #d3869b
URxvt.color208: #fe8019
URxvt.color214: #fabd2f
URxvt.color223: #ebdbb2
URxvt.color228: #f2e5bc
URxvt.color229: #fbf1c7
URxvt.color230: #f9f5d7
URxvt.color234: #1d2021
URxvt.color235: #282828
URxvt.color236: #32302f
URxvt.color237: #3c3836
URxvt.color239: #504945
URxvt.color241: #665c54
URxvt.color243: #7c6f64
URxvt.color244: #928374
URxvt.color245: #928374
URxvt.color246: #a89984
URxvt.color248: #bdae93
URxvt.color250: #d5c4a1

I am under archlinux and I installed the fonts from the AUR (nerd-fonts-complete).

Thank you very much in advance

Jeansen commented 7 years ago

Do you use any other fonts? Eg, vim dev icons? Maybe post your .vimrc, too. So far I could not reproduce your problem, though I am on vim and not neovim.

BigfootN commented 7 years ago

Thank you for your answer.

Here is my vimrc:

"
"   /$$    /$$ /$$                      /$$$$$$                       /$$$$$$  /$$
"  | $$   | $$|__/                     /$$__  $$                     /$$__  $$|__/
"  | $$   | $$ /$$ /$$$$$$/$$$$       | $$  \__/  /$$$$$$  /$$$$$$$ | $$  \__/ /$$  /$$$$$$
"  |  $$ / $$/| $$| $$_  $$_  $$      | $$       /$$__  $$| $$__  $$| $$$$    | $$ /$$__  $$
"   \  $$ $$/ | $$| $$ \ $$ \ $$      | $$      | $$  \ $$| $$  \ $$| $$_/    | $$| $$  \ $$
"    \  $$$/  | $$| $$ | $$ | $$      | $$    $$| $$  | $$| $$  | $$| $$      | $$| $$  | $$
"     \  $/   | $$| $$ | $$ | $$      |  $$$$$$/|  $$$$$$/| $$  | $$| $$      | $$|  $$$$$$$
"      \_/    |__/|__/ |__/ |__/       \______/  \______/ |__/  |__/|__/      |__/ \____  $$
"                                                                                  /$$  \ $$
"                                                                                 |  $$$$$$/
"                                                                                  \______/

" ************* plugins *************

call plug#begin('~/.vim/plugged')

" -- syntax theme
Plug 'chriskempson/base16-vim'
Plug 'morhetz/gruvbox'

" -- dev icons
Plug 'ryanoasis/vim-devicons'

" -- vim airline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'

" -- improve syntax color
Plug 'sheerun/vim-polyglot'

" -- snippets
Plug 'sirver/ultisnips'
Plug 'honza/vim-snippets'

" -- start page
Plug 'mhinz/vim-startify'

" -- code check
Plug 'scrooloose/syntastic'

" -- format
Plug 'Chiel92/vim-autoformat'

" -- code completion
Plug 'Valloric/YouCompleteMe'
Plug 'artur-shaik/vim-javacomplete2'
Plug 'airblade/vim-rooter'
Plug 'tomlion/vim-solidity'

" -- complete brackets, parentheses, ...
Plug 'jiangmiao/auto-pairs'

" -- nerdtree
Plug 'scrooloose/nerdtree'
Plug 'jistr/vim-nerdtree-tabs'

call plug#end()

" ************* editor configuration *************

filetype plugin on
filetype indent on
syntax on
set tabstop=4
set shiftwidth=4
set smarttab
set splitright
set nohlsearch
set autoread
set t_Co=16
set scrolloff=8

" ************* eye-candy configuration *************

" show line numbers
set nu
highlight LineNr ctermfg=26
highlight LineNr ctermbg=25

" colorscheme
set background=dark
colorscheme gruvbox
let g:gruvbox_contrast_dark="hard"

"if filereadable(expand("~/.vimrc_background"))
"  let base16colorspace=256
"  source ~/.vimrc_background
"endif

"colorscheme base16-default-dark

" ************* Keymaps *************

let mapleader = ","

nnoremap <leader>f :NERDTreeFocus<CR>
nnoremap <leader>t :tabnew<CR>
nnoremap <leader>p :tabprevious<CR>
nnoremap <leader>n :tabnext<CR>

" ************* JavaComplete configuration *************

autocmd FileType java setlocal omnifunc=javacomplete#Complete

" ************* Autoformat configuration *************

autocmd FileType vim,tex,xml let b:autoformat_autoindent=0

let blacklist = ['xml', 'conf']
autocmd BufWritePre * if index(blacklist, &ft) < 0 | :Autoformat

" c, c++
let g:formatdef_my_custom_clang = '"clang-format"'
let g:formatters_c = ['my_custom_clang']
let g:formatters_cpp = ['my_custom_clang']

" ************* Airline configuration *************

let g:airline_powerline_fonts = 1
let g:airline_theme = 'base16'

" symbols
if !exists('g:airline_symbols')
    let g:airline_symbols = {}
endif

" extensions
let g:airline_extensions = ['tabline']
let g:airline#extensions#default#section_truncate_width = {}
let g:airline#extensions#syntastic#enabled = 1
let g:airline#extensions#tabline#enabled = 1

" left sections
let g:airline_section_a = airline#section#create(['mode'])
let g:airline_section_b = airline#section#create(['%t'])
let g:airline_section_c = airline#section#create([])

" center
let g:airline_section_getter = ''

" right sections
let g:airline_section_x = ''
let g:airline_section_y = airline#section#create(['filetype'])
let g:airline_section_z = airline#section#create(['%3.3l'])
let g:airline_section_error = airline#section#create(['syntastic'])
let g:airline_section_warning = airline#section#create([''])

" tabline seperations
let g:airline#extensions#tabline#left_sep = 'î‚°'
let g:airline#extensions#tabline#left_alt_sep = 'î‚°'
let g:airline#extensions#tabline#right_sep = ''
let g:airline#extensions#tabline#right_alt_sep = ''

" tabline options
let g:airline#extensions#tabline#show_close_button = 0
let g:airline#extensions#tabline#buffer_nr_show = 0
let g:airline#extensions#tabline#show_buffers = 0
let g:airline#extensions#tabline#show_splits = 0
let g:airline#extensions#tabline#show_tab_type = 0
let g:airline#extensions#tabline#show_tab_nr = 0

" ************* YouCompleteMe configuration *************

let g:ycm_add_preview_to_completeopt = 1
let g:ycm_show_diagnostics_ui = 0
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_confirm_extra_conf = 0

" ************* Startify configuration *************

let g:startify_custom_header = [
            \"   _   _                   _            ",
            \"  | \\ | |                 (_)           ",
            \"  |  \\| | ___  _____   ___ _ __ ___   ",
            \"  | . ` |/ _ \\/ _ \\ \\ / / | '_ ` _ \\ ",
            \"  | |\\  |  __/ (_) \\ V /| | | | | | | ",
            \"  \\_| \\_/\\___|\\___/ \\_/ |_|_| |_| |_| ",
            \]

let g:startify_list_order = [
            \ ['  ---------  FICHIERS  ---------'],
            \ 'files',
            \ ['  ---------  SESSIONS  ---------'],
            \ 'sessions',
            \ ['  ---------  PROJETS  ---------'],
            \ 'bookmarks',
            \ ]

let g:startify_enable_special = 0
let g:startify_files_number = 5

" projets
let g:startify_bookmarks = [
            \ '~/Documents/Prog/mdata/'
            \ ]

" ************* Syntastic configuration *************

" basic settings
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

" disabled checkers
let g:syntastic_enable_latex_checker = 0
let g:syntastic_enable_tex_checker = 0
let g:syntastic_tex_checkers = []
let g:syntastic_enable_xml_checker = 0

" checker ---- C
let g:syntastic_c_checkers = ["clang_tidy"]

" checker ---- C++
let g:syntastic_cpp_checkers = ["clang_check"]

" ************* NERDTree configuration *************

autocmd VimEnter *
                \   if !argc()
                \ |   Startify
                \ |   execute 'NERDTreeTabsOpen'
                \ |   wincmd w
\ | endif

let g:nerdtree_tabs_open_on_console_startup = 1
let g:nerdtree_tabs_synchronize_view = 0

As you can see, I am also using vim dev icons.

I also tried with a normal font (not patched) and no problem.

Thank you again for all your answer and help

Jeansen commented 7 years ago

Hm..yes. My bad - still used xterm. It seems to be a font thing. URxvt*font: xft:DejaVu Sans Mono for Powerline:size=11 works for me. Your font does not show me the file symbols, just empty boxes.

Jeansen commented 7 years ago

Btw: Vim dev icons plugin should be the last plugin loaded :)

BigfootN commented 7 years ago

Thank you for your answer, so I loaded the vim vim dev icons in last and it seems to work for now. I'm closing the issue. If I have any more problems related to this issue I'll reopen it.

Thank you again very much.

BigfootN commented 7 years ago

Hello again, I'm really sorry, but I'm still having problems. I took another shot:

capture d ecran de 2017-04-07 18-13-37 As you can see on the left, there are still those little vertical dots.

Thank you again

Jeansen commented 7 years ago

No need to be sorry. Have you tried another font like the one I suggested?

Jeansen commented 7 years ago

Also I would suggest to try vim 8 and post your results here.

BigfootN commented 7 years ago

Thank you for your help again.

So I took a shot with vim 8 and the dejavu font:

capture d ecran de 2017-04-08 18-41-48

It's quite different because the vertical dots now seem to stand near the arrows.

Thank you very much again for all your help

ryanoasis commented 7 years ago

@BigfootN Thanks for your screenshots. Honestly I am not sure what's going on there. I can try to take a look in some time but not sure when that'll be.

Jeansen commented 7 years ago

Hm...interesting. FuraCode Nerd Font works in xterm, but not in rxvt - I do not see any symbols. In Xterm I have with any font I tried to problem that NERDTree cuts symbols in half. I actually went away from NERDTree, because it is so damn heavy ....

Could you try this out? https://github.com/powerline/fonts And then put URxvt*font: xft:DejaVu Sans Mono for Powerline:size=11 in your .Xresources file.

This works totally fine for me in rxvt. Even to cut symbols are not present.

BigfootN commented 7 years ago

Sorry for the late response. So I tried your font and disabled the vim-devicons plugin. Unfortunately, I still have problems :

capture d ecran de 2017-04-09 18-45-30

As you can see on the left there are still vertical bars. Thank you again for all your patience and help :) and sorry for the late response :(

ryanoasis commented 7 years ago

@BigfootN Sure no problem. which font is being used currently?

BigfootN commented 7 years ago

Thank you for your quick response. I'm using the exact same font as @Jeansen suggested me: URxvt*font: xft:DejaVu Sans Mono for Powerline:size=11.

Jeansen commented 7 years ago

I am happy I could be of some help :)

ryanoasis commented 7 years ago

Thanks all. :smile: So is this resolved?

BigfootN commented 7 years ago

Sorry for the late response.

Unfortunately, no, it doesn't seem so :(

Thank you all for your amazing help and patience :)

ryanoasis commented 7 years ago

@BigfootN Sure no problem. Wish I could do more.

Am I to understand this may be more of an issue related to urxvt ? It is not related specifically to the Nerd Font version of the font?

We can leave this issue open for now...

Jeansen commented 7 years ago

It might be with urxvt. BigfootN, whicht distro are you using?

gunman808 commented 7 years ago

As I look at your .Xresource config, I can see this line

URxvt*letterSpace: -1

...which is usefull for a narrow fontspace, but maybe it doesn't fit with every font or some icons. Do you have this problem also, when you comment this line out?

agriffis commented 7 years ago

urxvt historically has had problems with scalable fonts. I complained about it in 2008: http://lists.schmorp.de/pipermail/rxvt-unicode/2008q3/000659.html

The images aren't available at those links any more, but I still have them so I'll paste them here:

rxvt-monospace-9.png rxvt-monospace-9

xterm-monospace-9.png xterm-monospace-9

At the time, the maintainer argued that urvxt was doing it right, even though everybody could see the behavior is different from the other terminal emulators. So urxvt added the letterSpace resource for users to tune individually. However as you can see, that can cause other problems.

IMHO there is no way to solve this in Nerd Fonts, rather there are three options:

  1. stop using the custom letterSpace resource, OR
  2. switch to a terminal that doesn't suffer bugs rendering scalable fonts, OR
  3. try to ignore urxvt's occasional little presents on your screen ;-)
Jeansen commented 7 years ago

maybe it is also worth a try installing rxvt-unicode-256color since this compilation includes some tweaks for termcap/terminfo?

BigfootN commented 7 years ago

Sorry for the late response, I really was busy these last few days. So first of all I would like to thank you all for all your help and patience. I think I got it figured out. So I tried to disable the letterSpace and it seems to come from there. Once disabled, there doesn't seem to be any glitches anymore. So I think I now know where it comes from.

Thank you again for all your precious help.

ryanoasis commented 7 years ago

@BigfootN Sure no problem. Glad you were able to figure things out :smile:

Feel free to add any helpful info, examples, or links to: https://github.com/ryanoasis/nerd-fonts/wiki/Terminal-Emulators

Can we close this issue?

BigfootN commented 7 years ago

Tank you very much again for all your help and patience :)

mftrhu commented 7 years ago

Necroing this issue as I think I found a more comprehensive "fix" for it. I have been using urxvt together with Hack/DejaVu, and had to use letterSpace=-1 to make it render properly (it'd be too wide for my tastes otherwise) - but apparently some fonts don't work well with the size property, and "glitch" leaving pixels behind as shown in the OP.

This can be fixed by avoiding size and using pixelsize instead (even if the two are not equivalent and some tweaking might be required, my size=10 is now pixelsize=12) - see this reddit comment.

ryanoasis commented 6 years ago

@mftrhu No worries, especially since you added useful information others may find helpful! Appreciate that :smile:


Additionally I have tried to add at least some basic info that might make it easier to find help on these kind of things:

Jeansen commented 6 years ago

Maybe this one helps: https://github.com/powerline/fonts/issues/176#issuecomment-399626283

At least for me it worked, when I switched from DejaVu Sans Mono to Inconsolata. With DejaVu Sans Mono I had not problems. Only thing was that I set letterSpace=-1.

So to sum things up, here is what I had before:

URxvt*font:                           xft:DejaVuSansMonoForPowerline Nerd Font:size=14
URxvt*letterSpace:                    -1

And now it is only:

URxvt*font: xft:Inconsolata Nerd Font Mono:size=15, xft:DejaVu Sans:size=12
github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference.