如何从 otf 为控制台制作 psf 字体?

elo*_*esp 10 fonts tty

我想在 tty 控制台中使用Inconsolata 字体,但我需要为此生成一种psf字体。

我发现有两个工具应该可以工作,otf2bdf并且bdf2psf,但是每次我尝试使用第二个工具时,我都会得到:

/usr/bin/bdf2psf: Inconsolata12.bdf: the width is not integer number.
Run Code Online (Sandbox Code Playgroud)

小智 8

我实际上是在尝试解决同样的问题。我通过阅读前段时间发生的这个线程电子邮件交换来解决这个问题。访问这里

我仍然需要试试这个。如果我让它工作,我会回来报告。

编辑:我能够创建 PSF 字体,但没有尝试将其用作 TTY 字体。我相信这就是问题的含义。这是我创建字体的方式(从链接中准直接复制)。

  1. 将 OTF 转换为 BDF

    otf2bdf -r 72 -p 12 -c C /usr/share/fonts/truetype/incon...a/inconsolata.otf |
        sed -e "s/AVERAGE_WIDTH.*/AVERAGE_WIDTH 80/" > inconsolata-12.bdf
    
    Run Code Online (Sandbox Code Playgroud)

    (需要 sed 调用,因为 bdf2psf 健全性检查 AVERAGE_WIDTH 属性而不是字体边界框,或检查它实际使用的字形的 DWIDTH)

  2. 将 BDF 文件转换为 PSF 文件:

    bdf2psf inconsolata-12.bdf /usr/share/bdf2psf/standard.equivalents \
      /usr/share/bdf2psf/required.set+/usr/share/bdf2psf/useful.set 256 inconsolata-12.psf
    
    Run Code Online (Sandbox Code Playgroud)

就是这样。

  • `required.set` 属于哪个发行版?它不在 ubuntu 或 debian 中。 (2认同)