AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 54733
In Process
raldi
raldi
Asked: 2009-08-17 07:33:29 +0800 CST2009-08-17 07:33:29 +0800 CST 2009-08-17 07:33:29 +0800 CST

如何在 Linux 中安装字体以便 xterm 可以使用它?

  • 772

我今天遇到了一个问题,要求使用好的 Linux xterm 字体,答案建议使用一种叫做 Terminus 的字体。我一直在寻找一种新的终端字体,所以我下载了它(顺便说一句,我正在运行 Ubuntu Intrepid)并阅读了自述文件:

1.1. Quick installation.
The commands:
  $ ./configure [--prefix=PREFIX]
  $ make
  # make install
compile and install the Linux console and X11 Window System fonts, and
  # make fontdir
updates fonts.dir for X11 (if you don't know what fonts.dir is, execute the
command).

1.2. Legend.    
The file names are structured as follows: ter-u<SIZE><STYLE>.bdf    
where <SIZE> is 12, 14, 16, 20, 24, 28 or 32, and <STYLE> is n for normal
(all sizes), b for bold (all sizes except 6x12) and v for EGA/VGA bold (8x14
and 8x16 only, makes use of the eight character matrix column).

所以我跑了:

$ ./configure
$ make
$ sudo make install
$ sudo make fontdir

...为了确定,我重新启动了 X11,但找不到新字体:

$ xterm -font ter-u14n
xterm:  unable to open font "ter-u14n", trying "fixed"....

叹。回到自述文件。后来在这个文件中,我看到:

4. X11 Window System.
4.1. Installation.

$ ./configure [--prefix=PREFIX | --x11dir=DIRECTORY]
$ make pcf
# make install-pcf

好吧,我知道“xterm -font 8x16”有效,所以我运行“locate 8x16”并看到这个字体似乎存在于 /usr/share/fonts/X11/misc,所以这似乎是一个很好的 --x11dir利用。所以我跑了:

$ ./configure --x11dir=/usr/share/fonts/X11/misc
$ make pcf
$ make install-pcf
$ sudo make fontdir

...我再次重新启动了 X11,甚至我的整个计算机只是为了更好地衡量,我什至验证了现在有一堆文件,如 /usr/share/fonts/X11/misc/ter-u14n.pcf.gz在我的系统上,但仍然:

$ xterm -font ter-u14n
xterm:  unable to open font "ter-u14n", trying "fixed"....

为了让这个字体与 xterm 一起工作,我必须执行什么魔法咒语?

linux
  • 3 3 个回答
  • 15744 Views

3 个回答

  • Voted
  1. user15323
    2009-08-17T18:28:07+08:002009-08-17T18:28:07+08:00

    Ubuntu有一个包:

    apt-get install xfonts-terminus xfonts-terminus-oblique
    

    请注意,这是在universe存储库中,因此您可能必须将其添加到/etc/apt/sources.list.

    • 3
  2. kmbt
    2015-10-28T22:49:21+08:002015-10-28T22:49:21+08:00

    在 Debian Wheezy 中安装 xfonts-terminus 后,我需要做:

    $ xset fp rehash
    

    另外,我的~/.Xresources说:

    xterm*utf8: 1
    xterm*font: -xos4-terminus-medium-r-normal--20-200-72-72-c-100-iso10646-1
    

    , where-xos4-terminus-medium-r-normal--20-200-72-72-c-100-iso10646-1取自fonts.dir安装字体的文件。就我而言,它是/usr/share/fonts/X11/misc/fonts.dir.

    您使用xterm*utf8: 1并选择iso10646-1是否需要 utf-8。您可能还需要调用包装脚本uxterm而不是xtermutf-8 才能在终端中正常工作。

    所有更改都~/.Xresources需要您执行以下操作:

    $ xrdb ~/.Xresources
    

    让他们在当前的 X 会话中注册。

    该xterm*font规则也可以用通配符星号编写,如下所示:

    xterm*font: -xos4-terminus-medium-r-*--20-*-*-*-*-*-iso10646-*
    

    我希望这对偶然发现类似问题的任何人都有帮助。

    • 2
  3. Rik Schneider
    2009-08-17T13:21:17+08:002009-08-17T13:21:17+08:00

    字体是否列在 /usr/share/fonts/X11/misc 下的 encodings.dir、fonts.alias 和 fonts.dir 文件中?

    自从我需要在 linux 主机上添加字体以来已经有一段时间了,但是有一些帮助工具,名为 mkfontdir、update-fonts-alias、update-fonts-dir 和 update-fonts-scale,应该默认安装。他们处理更新元信息,告诉 X 服务器系统上安装的字体。请参阅他们的手册页。

    在基于 Debian 的系统上(Ubuntu 具有 Debian 传统),当添加字体 .deb 包时,助手通常会自动调用 mkfontdirs。使用 make 安装字体可能没有按照您的系统预期的方式进行设置。

    • 1

相关问题

  • 多操作系统环境的首选电子邮件客户端

  • 你最喜欢的 Linux 发行版是什么?[关闭]

  • 更改 PHP 的默认配置设置?

  • 保护新的 Ubuntu 服务器 [关闭]

  • (软)Ubuntu 7.10 上的 RAID 6,我应该迁移到 8.10 吗?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    从 IP 地址解析主机名

    • 8 个回答
  • Marko Smith

    如何按大小对 du -h 输出进行排序

    • 30 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    Windows 中执行反向 DNS 查找的命令行实用程序是什么?

    • 14 个回答
  • Marko Smith

    如何检查 Windows 机器上的端口是否被阻塞?

    • 4 个回答
  • Marko Smith

    我应该打开哪个端口以允许远程桌面?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    MikeN 在 Nginx 中,如何在维护子域的同时将所有 http 请求重写为 https? 2009-09-22 06:04:43 +0800 CST
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    0x89 bash中的双方括号和单方括号有什么区别? 2009-08-10 13:11:51 +0800 CST
  • Martin Hope
    kch 如何更改我的私钥密码? 2009-08-06 21:37:57 +0800 CST
  • Martin Hope
    Kyle Brandt IPv4 子网如何工作? 2009-08-05 06:05:31 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve