13

I want to use the Inconsolata font in the tty console, but I need to generate a psf font for that.

I found that there are two tools that should work, otf2bdf and bdf2psf, but every time I try to use the second one I get:

/usr/bin/bdf2psf: Inconsolata12.bdf: the width is not integer number.
4
  • This one looks extremely close to this Q: unix.stackexchange.com/questions/21100/…
    – slm
    Oct 14, 2014 at 5:34
  • @slm, in my opinion, the question isn't actually about converting a bdf to a psf; it's about converting an otf to a psf. Going through bdf was just a tentative solution that the OP attempted.
    – HalosGhost
    Oct 14, 2014 at 5:40
  • The elsif sequence on $width in /usr/bin/bdf2psf reveals that the program supports only 7, 8 and 9 dots width of the glyphs. Neither 12 nor 16 dots glyphs are seemingly supported. The software looks to be abandoned, as 12 and 16 are common widths on modern display devices. May 7, 2023 at 7:55

1 Answer 1

9

I'm actually trying to solve this very same problem. I worked it out by reading through this thread email exchange that took place some time ago. visit here.

I still need to try this out . I'll report back if I get it to work.

Edit: I was able to create the PSF font but have not tried to use it as a TTY font. I believe that was the implication of the question. This is the way that I created the font (copied quasi-directly from the link).

  1. Convert the OTF to 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
    

    (the sed invocation is required because bdf2psf sanity-checks the AVERAGE_WIDTH property rather than the font bounding box, or checking the DWIDTHs of the glyphs that it actually uses)

  2. Convert the BDF file to a PSF file:

    bdf2psf inconsolata-12.bdf /usr/share/bdf2psf/standard.equivalents \
      /usr/share/bdf2psf/required.set+/usr/share/bdf2psf/useful.set 256 inconsolata-12.psf
    

That's it.

1
  • 2
    Which distribution is required.set part of? It's not in ubuntu or debian.
    – JayEye
    Jun 1, 2019 at 19:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .