有没有办法从命令行检查您的 shell/终端仿真器正在使用哪种字体?

Ano*_*non 12 command-line fonts

有没有办法从命令行检查您的 shell/终端仿真器正在使用哪种字体?

如果直接命令不可用,我愿意解决读取配置文件的一部分。

Pan*_*dya 9

选项使用系统固定宽度字体通常等于并由 设置 org.gnome.desktop.interface

屏幕0

当我运行上面的命令时,我发现终端的字体发生了变化(增大了尺寸)!因此,gnome-terminal使用该字体设置。


小智 8

获取系统首选等宽字体的与 DE 无关的方法:

$ fc-match Monospace
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
Run Code Online (Sandbox Code Playgroud)

参考:ArchWiki字体配置


小智 3

检查终端字体:

grep -i "fontface" /etc/default/console-setup
Run Code Online (Sandbox Code Playgroud)


g_p*_*g_p 1

您可以使用以下命令检查 gnome 终端字体

gconftool-2 --get /apps/gnome-terminal/profiles/Default/font
Run Code Online (Sandbox Code Playgroud)

例如,它在 gnome-terminal 中使用此命令

 [guru@guru-pc:~]$gconftool-2 --get /apps/gnome-terminal/profiles/Default/font
  Monospace 12
Run Code Online (Sandbox Code Playgroud)

如果您想使用命令行更改字体,可以使用以下命令

  gconftool-2 --set /apps/gnome-terminal/profiles/Default/font --type string "courier new 12"
Run Code Online (Sandbox Code Playgroud)

其中 12 是字体大小。