urxvt 在 Arch Linux 新安装上不显示字形

urxvt 在 Arch Linux 新安装上不显示字形

我新安装的 Arch 未在 urxvt 中显示任何图形/图标。

! ******************
! urxvt config
! ******************

URxvt*imLocale: en_US.UTF-8

URxvt*termName: rxvt
URxvt*depth: 24
URxvt*geometry: 90x30
URxvt*transparent: false
URxvt*fading: 0
URxvt*loginShell: true
! scrollback buffer lines - 65535 is max on most machines (64 is default)
URxvt*saveLines: 65535
URxvt*internalBorder: 3
URxvt*lineSpace: 0

! Fonts
URxvt*font: xft:Source Code Pro for Powerline:size=12
URxvt.letterSpace: 0
Xft.antialias: true
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight

! Scrollbar
URxvt*scrollBar: false

! Disable Perl extension
! If you do not use the Perl extension features, you can improve the security
! and speed by disabling Perl extensions completely. 
!URxvt.perl-ext:
!URxvt.perl-ext-common:

! -- Fonts -- !

!URxvt.font: xft:DejaVu Sans Mono:autohint=true:size=12,xft:Inconsolata\ for\ Powerline:autohint=true:size=12

!URxvt*font: xft:SourceCodePro+Powerline+Awesome+Regular:autohint=true:size=10
!URxvt*font: xft:Source\ Code\ Pro\ Medium:pixelsize=13:antialias=true:hinting=true,xft:Source\ Code\ Pro\ Medium:pixelsize=13:antialias=true:hinting=true

!URxvt*font:                 xft:Inconsolata for Powerline:pixelsize=27:minspace=False, xft:DejaVu Sans:pixelsize=18
!URxvt*boldFont:             xft:Inconsolata Bold for Powerline:pixelsize=27:minspace=False, xft:DejaVu Sans:pixelsize=18
!


! special
*.foreground:   #d8dee9
*.background:   #1d1f21
*.cursorColor:  #d8dee9

! black
*.color0:       #2d2d2d
*.color8:       #444444

! red
*.color1:       #ed0b0b
*.color9:       #b55454

! green
*.color2:       #40a62f
*.color10:      #78a670

! yellow
*.color3:       #f2e635
*.color11:      #faf380

! blue
*.color4:       #327bd1
*.color12:      #68a7d4

! magenta
*.color5:       #b30ad0
*.color13:      #c583d0

! cyan
*.color6:       #32d0fc
*.color14:      #8adaf1

! white
*.color7:       #555555
*.color15:      #e0e3e7

! *****************
! Copy and Paste 
! *****************
!  URxvt.clipboard.autocopy: true
!  URxvt.keysym.M-c: perl:clipboard:copy
!  URxvt.keysym.M-v: perl:clipboard:paste

! Disable ISO 14755 unicode input so we can use Ctrl-Shift bindings
URxvt.iso14755:        false
URxvt.iso14755_52:     false

! Disable Ctrl-Alt-c & Ctrl-Alt-v bindings (optional)
URxvt.keysym.C-M-c:    builtin-string:
URxvt.keysym.C-M-v:    builtin-string:

! Bind Ctrl-Shift-c & Ctrl-Shift-v to copy and paste
! I dont know why, but I needed to use hex keysym values to get it to work
URxvt.keysym.C-S-0x43: eval:selection_to_clipboard
URxvt.keysym.C-S-0x56: eval:paste_clipboard

! ***********End Copy and paste*******

! ******************
! /urxvt config
! ******************

其他终端(Termite)显示图标没有任何问题 在此输入图像描述

我只使用 i3 窗口管理器和 ZSH 作为我的默认 shell。执行 fc-list | grep "Source Code Pro for Powerline"返回预期结果

/home/sammy/.local/share/fonts/Source Code Pro for Powerline.otf: Source Code Pro for Powerline:style=Regular
/home/sammy/.fonts/Source Code Pro Black for Powerline.otf: Source Code Pro for Powerline,Source Code Pro Black:style=Black,Regular
/home/sammy/.fonts/Source Code Pro Powerline SemiboldItalic.otf: Source Code Pro for Powerline,Source Code Pro Semibold:style=Semibold Italic,Italic
/home/sammy/.local/share/fonts/Source Code Pro Medium for Powerline.otf: Source Code Pro for Powerline,Source Code Pro Medium:style=Medium,Regular
/home/sammy/.local/share/fonts/Source Code Pro Powerline BoldItalic.otf: Source Code Pro for Powerline:style=Bold Italic
/home/sammy/.fonts/Source Code Pro ExtraLight for Powerline.otf: Source Code Pro for Powerline,Source Code Pro ExtraLight:style=ExtraLight,Regular
/usr/share/fonts/OTF/Source Code Pro ExtraLight for Powerline.otf: Source Code Pro for Powerline,Source Code Pro ExtraLight:style=ExtraLight,Regular
/usr/share/fonts/OTF/Source Code Pro Powerline Italic.otf: Source Code Pro for Powerline:style=Italic
/home/sammy/.local/share/fonts/Source Code Pro Powerline SemiboldItalic.otf: Source Code Pro for Powerline,Source Code Pro Semibold:style=Semibold Italic,Italic
/home/sammy/.fonts/Source Code Pro Medium for Powerline.otf: Source Code Pro for Powerline,Source Code Pro Medium:style=Medium,Regular
/usr/share/fonts/OTF/Source Code Pro Medium for Powerline.otf: Source Code Pro for Powerline,Source Code Pro Medium:style=Medium,Regular
/home/sammy/.fonts/Source Code Pro Powerline MediumItalic.otf: Source Code Pro for Powerline,Source Code Pro Medium:style=Medium Italic,Italic
/usr/share/fonts/OTF/Source Code Pro Powerline BoldItalic.otf: Source Code Pro for Powerline:style=Bold Italic
/home/sammy/.local/share/fonts/Source Code Pro Powerline LightItalic.otf: Source Code Pro for Powerline,Source Code Pro Light:style=Light Italic,Italic
/usr/share/fonts/OTF/Source Code Pro Powerline MediumItalic.otf: Source Code Pro for Powerline,Source Code Pro Medium:style=Medium Italic,Italic
/home/sammy/.fonts/Source Code Pro Bold for Powerline.otf: Source Code Pro for Powerline:style=Bold
/usr/share/fonts/OTF/Source Code Pro Bold for Powerline.otf: Source Code Pro for Powerline:style=Bold
/home/sammy/.fonts/Source Code Pro Powerline Italic.otf: Source Code Pro for Powerline:style=Italic
/home/sammy/.fonts/Source Code Pro Light for Powerline.otf: Source Code Pro for Powerline,Source Code Pro Light:style=Light,Regular
/usr/share/fonts/OTF/Source Code Pro for Powerline.otf: Source Code Pro for Powerline:style=Regular
/home/sammy/.local/share/fonts/Source Code Pro Black for Powerline.otf: Source Code Pro for Powerline,Source Code Pro Black:style=Black,Regular
/home/sammy/.local/share/fonts/Source Code Pro Light for Powerline.otf: Source Code Pro for Powerline,Source Code Pro Light:style=Light,Regular
/usr/share/fonts/OTF/Source Code Pro Semibold for Powerline.otf: Source Code Pro for Powerline,Source Code Pro Semibold:style=Semibold,Regular
/usr/share/fonts/OTF/Source Code Pro Black for Powerline.otf: Source Code Pro for Powerline,Source Code Pro Black:style=Black,Regular
/home/sammy/.fonts/Source Code Pro for Powerline.otf: Source Code Pro for Powerline:style=Regular
/usr/share/fonts/OTF/Source Code Pro Powerline BlackItalic.otf: Source Code Pro for Powerline,Source Code Pro Black:style=Black Italic,Italic
/usr/share/fonts/OTF/Source Code Pro Powerline SemiboldItalic.otf: Source Code Pro for Powerline,Source Code Pro Semibold:style=Semibold Italic,Italic
/home/sammy/.local/share/fonts/Source Code Pro Powerline BlackItalic.otf: Source Code Pro for Powerline,Source Code Pro Black:style=Black Italic,Italic
/usr/share/fonts/OTF/Source Code Pro Powerline LightItalic.otf: Source Code Pro for Powerline,Source Code Pro Light:style=Light Italic,Italic
/home/sammy/.fonts/Source Code Pro Powerline BlackItalic.otf: Source Code Pro for Powerline,Source Code Pro Black:style=Black Italic,Italic
/home/sammy/.local/share/fonts/Source Code Pro Powerline MediumItalic.otf: Source Code Pro for Powerline,Source Code Pro Medium:style=Medium Italic,Italic
/usr/share/fonts/OTF/Source Code Pro Light for Powerline.otf: Source Code Pro for Powerline,Source Code Pro Light:style=Light,Regular
/home/sammy/.fonts/Source Code Pro Powerline ExtraLightItalic.otf: Source Code Pro for Powerline,Source Code Pro ExtraLight:style=ExtraLight Italic,Italic
/home/sammy/.local/share/fonts/Source Code Pro Semibold for Powerline.otf: Source Code Pro for Powerline,Source Code Pro Semibold:style=Semibold,Regular
/home/sammy/.local/share/fonts/Source Code Pro Powerline ExtraLightItalic.otf: Source Code Pro for Powerline,Source Code Pro ExtraLight:style=ExtraLight Italic,Italic
/home/sammy/.local/share/fonts/Source Code Pro ExtraLight for Powerline.otf: Source Code Pro for Powerline,Source Code Pro ExtraLight:style=ExtraLight,Regular
/usr/share/fonts/OTF/Source Code Pro Powerline ExtraLightItalic.otf: Source Code Pro for Powerline,Source Code Pro ExtraLight:style=ExtraLight Italic,Italic
/home/sammy/.local/share/fonts/Source Code Pro Bold for Powerline.otf: Source Code Pro for Powerline:style=Bold
/home/sammy/.fonts/Source Code Pro Semibold for Powerline.otf: Source Code Pro for Powerline,Source Code Pro Semibold:style=Semibold,Regular
/home/sammy/.local/share/fonts/Source Code Pro Powerline Italic.otf: Source Code Pro for Powerline:style=Italic
/home/sammy/.fonts/Source Code Pro Powerline LightItalic.otf: Source Code Pro for Powerline,Source Code Pro Light:style=Light Italic,Italic
/home/sammy/.fonts/Source Code Pro Powerline BoldItalic.otf: Source Code Pro for Powerline:style=Bold Italic

xrdb -m ~/.Xresources我在每次更改 .Xresources 后执行

编辑:屏幕截图中的输出是通过使用 ls 作为 exa 别名生成的,该别名取决于 Nerd 字体,因为我已经安装了它们

fc-list | grep "Nerd"

/usr/share/fonts/TTF/Sauce Code Pro Light Italic Nerd Font Complete Mono.ttf: SauceCodePro Nerd Font Mono:style=Light Italic,Italic
/usr/share/fonts/TTF/Sauce Code Pro Black Italic Nerd Font Complete.ttf: SauceCodePro Nerd Font:style=Black Italic,Italic
/usr/share/fonts/TTF/Sauce Code Pro Semibold Nerd Font Complete Mono.ttf: SauceCodePro Nerd Font Mono:style=Semibold,Regular
/usr/share/fonts/TTF/Sauce Code Pro Bold Nerd Font Complete.ttf: SauceCodePro Nerd Font:style=Bold
/usr/share/fonts/TTF/Sauce Code Pro Semibold Italic Nerd Font Complete.ttf: SauceCodePro Nerd Font:style=Semibold Italic,Italic
/usr/share/fonts/TTF/Sauce Code Pro Italic Nerd Font Complete.ttf: SauceCodePro Nerd Font:style=Italic
/usr/share/fonts/TTF/Sauce Code Pro Light Nerd Font Complete.ttf: SauceCodePro Nerd Font:style=Light,Regular
/usr/share/fonts/TTF/Sauce Code Pro Nerd Font Complete.ttf: SauceCodePro Nerd Font:style=Regular
/usr/share/fonts/TTF/Sauce Code Pro Italic Nerd Font Complete Mono.ttf: SauceCodePro Nerd Font Mono:style=Italic
/usr/share/fonts/TTF/Sauce Code Pro Bold Nerd Font Complete Mono.ttf: SauceCodePro Nerd Font Mono:style=Bold
/usr/share/fonts/TTF/Sauce Code Pro Medium Italic Nerd Font Complete.ttf: SauceCodePro Nerd Font:style=Medium Italic,Italic
/usr/share/fonts/TTF/Sauce Code Pro Medium Nerd Font Complete.ttf: SauceCodePro Nerd Font:style=Medium,Regular
/usr/share/fonts/TTF/Sauce Code Pro ExtraLight Italic Nerd Font Complete.ttf: SauceCodePro Nerd Font:style=ExtraLight Italic,Italic
/usr/share/fonts/TTF/Sauce Code Pro Bold Italic Nerd Font Complete Mono.ttf: SauceCodePro Nerd Font Mono:style=Bold Italic
/usr/share/fonts/TTF/Sauce Code Pro Medium Italic Nerd Font Complete Mono.ttf: SauceCodePro Nerd Font Mono:style=Medium Italic,Italic
/usr/share/fonts/TTF/Sauce Code Pro Light Nerd Font Complete Mono.ttf: SauceCodePro Nerd Font Mono:style=Light,Regular
/usr/share/fonts/TTF/Sauce Code Pro Bold Italic Nerd Font Complete.ttf: SauceCodePro Nerd Font:style=Bold Italic
/usr/share/fonts/TTF/Sauce Code Pro ExtraLight Nerd Font Complete Mono.ttf: SauceCodePro Nerd Font Mono:style=ExtraLight,Regular
/usr/share/fonts/TTF/Sauce Code Pro Black Nerd Font Complete.ttf: SauceCodePro Nerd Font:style=Black,Regular
/usr/share/fonts/TTF/Sauce Code Pro Black Italic Nerd Font Complete Mono.ttf: SauceCodePro Nerd Font Mono:style=Black Italic,Italic
/usr/share/fonts/TTF/Sauce Code Pro ExtraLight Nerd Font Complete.ttf: SauceCodePro Nerd Font:style=ExtraLight,Regular
/usr/share/fonts/TTF/Sauce Code Pro Medium Nerd Font Complete Mono.ttf: SauceCodePro Nerd Font Mono:style=Medium,Regular
/usr/share/fonts/TTF/Sauce Code Pro Black Nerd Font Complete Mono.ttf: SauceCodePro Nerd Font Mono:style=Black,Regular
/usr/share/fonts/TTF/Sauce Code Pro Semibold Italic Nerd Font Complete Mono.ttf: SauceCodePro Nerd Font Mono:style=Semibold Italic,Italic
/usr/share/fonts/TTF/Sauce Code Pro ExtraLight Italic Nerd Font Complete Mono.ttf: SauceCodePro Nerd Font Mono:style=ExtraLight Italic,Italic
/usr/share/fonts/TTF/Sauce Code Pro Nerd Font Complete Mono.ttf: SauceCodePro Nerd Font Mono:style=Regular
/usr/share/fonts/TTF/Sauce Code Pro Semibold Nerd Font Complete.ttf: SauceCodePro Nerd Font:style=Semibold,Regular
/usr/share/fonts/TTF/Sauce Code Pro Light Italic Nerd Font Complete.ttf: SauceCodePro Nerd Font:style=Light Italic,Italic

答案1

我终于找到了导致 URxvt 中无法显示字形/图标的原因。尽管我已经使用 设置了机器en_CA.utf8,但我还必须添加 en_US.utf8 才能在 URxvt 中启用 UTF-8。执行以下命令可解决 URxvt 中所有与 UTF-8 相关的问题:

localectl set-locale LANG=en_US.UTF-8

使用下面的.Xresources文件,解决所有问题

! special colors
*.foreground:  #a39e9b
*.background:  #2f1e2e
*.cursorColor:  #a39e9b
! black
*.color0:      #2f1e2e
*.color8:      #776e71
! red
*.color1:      #ef6155
*.color9:      #ef6155
! green
*.color2:      #48b685
*.color10:     #48b685
! yellow
*.color3:      #fec418
*.color11:     #fec418
! blue
*.color4:      #06b6ef
*.color12:     #06b6ef
! magenta
*.color5:      #815ba4
*.color13:     #815ba4
! cyan
*.color6:      #5bc4bf
*.color14:     #5bc4bf
! white
*.color7:      #a39e9b
*.color15:     #e7e9db

! Urxvt Specific Settings

URxvt*scrollBar:         false
URxvt*scrollBar_right:   false
URxvt.iso14755: false
URxvt.font: xft:MesloLGS Nerd Font:autohint=true:size=12,xft:TerminessTTFNerdFontMono:size=12

*antialias:  true
*autohint:   true

! Restore Ctrl+Shift+(c|v)
URxvt.keysym.Shift-Control-V: eval:paste_clipboard
URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard
!URxvt.iso14755: false
URxvt.iso14755_52: false

! Common navigation  Keybinds

URxvt.keysym.Shift-Up: command:\033]720;1\007
URxvt.keysym.Shift-Down: command:\033]721;1\007
URxvt.keysym.Control-Up: \033[1;5A
URxvt.keysym.Control-Down: \033[1;5B
URxvt.keysym.Control-Right: \033[1;5C
URxvt.keysym.Control-Left: \033[1;5D

!! Copy, Paste + More

URxvt.perl-ext-common: default,clipboard,url-select,keyboard-select
URxvt.keysym.M-Escape: perl:keyboard-select:activate
URxvt.keysym.M-s: perl:keyboard-select:search
URxvt.keysym.M-u: perl:url-select:select_next
URxvt.urlLauncher: firefox
URxvt.underlineURLs: true
URxvt.urlButton: 2 
URxvt.url-select.autocopy:true

感谢@terdon 和@Marc Wilson 的帮助。

相关内容