为什么 Font Awesome 字符未在我的终端 shell 上呈现或替换?
Why are Font Awesome characters not rendered or replaced on my terminal shell?
我正在尝试使用 i3-wm、polybar[在我的两台计算机上自定义我的 Ubuntu =34=] 和 zsh (上面有 oh-my-zsh)
我的一台电脑上有一些问题而另一台电脑上没有,尽管以相同的方式进行并为它们使用相同的配置文件以便在我的两台电脑上拥有相同的工作区设备。
在 zsh 上,我正在使用我在 oh-my-zsh 上安装的 powerlevel10k/powerlevel10k
主题来拥有一个更漂亮的终端。
问题是 shell 显示漂亮的字体图标,例如我在 git 项目时的分支图标,或显示时间旁边的时钟图标等.
这在我的第一台计算机上运行良好,但在第二台计算机上运行不佳。没有显示图标,所以我的终端在上面没有那么吸引人。
我对 polybar 也有同样的问题。某些图标在一台计算机上呈现良好,而在另一台计算机上则无法呈现。有时,它们甚至被奇怪的亚洲(我认为它来自亚洲语言,但我不确定)字符所取代。
我想知道为什么我在两个设备上的结果不一样,以及如何在计算机 2 上修复它。
这里是所用版本的总结:
Ubuntu = 18.04 LTS
i3-wm = 4.18
Polybar = 3.4.0
zsh = 5.4.2
oh-my-zsh = Version unknown
您需要安装支持的字体并配置您的终端才能使用它。由于您使用的是 powerlevel10k,因此最好使用 the font that powerlevel10k recommends.
Meslo Nerd Font patched for Powerlevel10k
Gorgeous monospace font designed by Jim Lyles for Bitstream,
customized by the same for Apple, further customized by André Berg,
and finally patched by yours truly with customized scripts originally
developed by Ryan L McIntyre of Nerd Fonts. Contains all glyphs and
symbols that Powerlevel10k may need. Battle-tested in dozens of
different terminals on all major operating systems.
Automatic font installation
If you are using iTerm2 or Termux, p10k configure
can install the
recommended font for you. Simply answer Yes
when asked whether to
install Meslo Nerd Font.
If you are using a different terminal, proceed with manual font
installation.
Manual font installation
Download these four ttf files:
Double-click on each file and click "Install". This will make
MesloLGS NF
font available to all applications on your system.
Configure your terminal to use this font:
- iTerm2: Open iTerm2 → Preferences → Profiles → Text and set Font to
MesloLGS NF
. Alternatively, type p10k configure
and answer Yes
when asked whether to install Meslo Nerd Font.
- Apple Terminal Open Terminal → Preferences → Profiles → Text, click Change under Font and select
MesloLGS NF
family.
- Hyper: Open Hyper → Edit → Preferences and change the value of
fontFamily
under module.exports.config
to MesloLGS NF
.
- Visual Studio Code: Open File → Preferences → Settings, enter
terminal.integrated.fontFamily
in the search box and set the value
to MesloLGS NF
.
- GNOME Terminal (the default Ubuntu terminal): Open Terminal → Preferences and click on the selected profile under Profiles. Check
Custom font under Text Appearance and select
MesloLGS NF Regular
.
- Konsole: Open Settings → Edit Current Profile → Appearance, click Select Font and select
MesloLGS NF Regular
.
- Tilix: Open Tilix → Preferences and click on the selected profile under Profiles. Check Custom font under Text Appearance
and select
MesloLGS NF Regular
.
- Windows Console Host (the old thing): Click the icon in the top left corner, then Properties → Font and set Font to
MesloLGS NF
.
- Windows Terminal (the new thing): Open Settings (
Ctrl+,
), search for fontFace
and set value to MesloLGS NF
for every
profile.
- Termux: Type
p10k configure
and answer Yes
when asked whether to install Meslo Nerd Font.
IMPORTANT: Run p10k configure
after changing terminal font. The old ~/.p10k.zsh
may work incorrectly with the new font.
注意:我在此处复制的内容可能已过时。为了安全起见,请检查 primary source.
我正在尝试使用 i3-wm、polybar[在我的两台计算机上自定义我的 Ubuntu =34=] 和 zsh (上面有 oh-my-zsh)
我的一台电脑上有一些问题而另一台电脑上没有,尽管以相同的方式进行并为它们使用相同的配置文件以便在我的两台电脑上拥有相同的工作区设备。
在 zsh 上,我正在使用我在 oh-my-zsh 上安装的 powerlevel10k/powerlevel10k
主题来拥有一个更漂亮的终端。
问题是 shell 显示漂亮的字体图标,例如我在 git 项目时的分支图标,或显示时间旁边的时钟图标等.
这在我的第一台计算机上运行良好,但在第二台计算机上运行不佳。没有显示图标,所以我的终端在上面没有那么吸引人。
我对 polybar 也有同样的问题。某些图标在一台计算机上呈现良好,而在另一台计算机上则无法呈现。有时,它们甚至被奇怪的亚洲(我认为它来自亚洲语言,但我不确定)字符所取代。
我想知道为什么我在两个设备上的结果不一样,以及如何在计算机 2 上修复它。
这里是所用版本的总结:
Ubuntu = 18.04 LTS
i3-wm = 4.18
Polybar = 3.4.0
zsh = 5.4.2
oh-my-zsh = Version unknown
您需要安装支持的字体并配置您的终端才能使用它。由于您使用的是 powerlevel10k,因此最好使用 the font that powerlevel10k recommends.
Meslo Nerd Font patched for Powerlevel10k
Gorgeous monospace font designed by Jim Lyles for Bitstream, customized by the same for Apple, further customized by André Berg, and finally patched by yours truly with customized scripts originally developed by Ryan L McIntyre of Nerd Fonts. Contains all glyphs and symbols that Powerlevel10k may need. Battle-tested in dozens of different terminals on all major operating systems.
Automatic font installation
If you are using iTerm2 or Termux,
p10k configure
can install the recommended font for you. Simply answerYes
when asked whether to install Meslo Nerd Font.If you are using a different terminal, proceed with manual font installation.
Manual font installation
Download these four ttf files:
Double-click on each file and click "Install". This will make
MesloLGS NF
font available to all applications on your system. Configure your terminal to use this font:
- iTerm2: Open iTerm2 → Preferences → Profiles → Text and set Font to
MesloLGS NF
. Alternatively, typep10k configure
and answerYes
when asked whether to install Meslo Nerd Font.- Apple Terminal Open Terminal → Preferences → Profiles → Text, click Change under Font and select
MesloLGS NF
family.- Hyper: Open Hyper → Edit → Preferences and change the value of
fontFamily
undermodule.exports.config
toMesloLGS NF
.- Visual Studio Code: Open File → Preferences → Settings, enter
terminal.integrated.fontFamily
in the search box and set the value toMesloLGS NF
.- GNOME Terminal (the default Ubuntu terminal): Open Terminal → Preferences and click on the selected profile under Profiles. Check Custom font under Text Appearance and select
MesloLGS NF Regular
.- Konsole: Open Settings → Edit Current Profile → Appearance, click Select Font and select
MesloLGS NF Regular
.- Tilix: Open Tilix → Preferences and click on the selected profile under Profiles. Check Custom font under Text Appearance and select
MesloLGS NF Regular
.- Windows Console Host (the old thing): Click the icon in the top left corner, then Properties → Font and set Font to
MesloLGS NF
.- Windows Terminal (the new thing): Open Settings (
Ctrl+,
), search forfontFace
and set value toMesloLGS NF
for every profile.- Termux: Type
p10k configure
and answerYes
when asked whether to install Meslo Nerd Font.IMPORTANT: Run
p10k configure
after changing terminal font. The old~/.p10k.zsh
may work incorrectly with the new font.
注意:我在此处复制的内容可能已过时。为了安全起见,请检查 primary source.