Libvte unicode font handling

fontsgtkunicodex11

I am trying to display some ANSI text which contains characters from the Unicode private use area. I have two fonts which contain these characters. The first is a PCF (bitmap) font, and the second is a TTF font, generated from the first and containing the exact same set of glyphs.

The PCF font is available in Debian and Ubuntu in the "tv-fonts" package and is called "teletext". The TTF versions are available here.

I display this text file by configuring my terminal to use one of my fonts, and then cat'ing this file.

This produces different results in different terminals:

Xterm can only use PCF fonts. With xterm -fg white -bg black -fn teletext I see the correct output:

xterm pcf

Terminator can use both PCF and TTF fonts. With PCF font the output is correct:

terminator pcf

But if I tell terminator to use a TTF font the output contains an unexpected character after the big "BBC" logo:

terminator ttf

The character in question is , unicode 0xee20. It is an empty space in both the PCF and TTF fonts.

When using xfce4-terminal the results are the same. Terminator and Xfce4-terminal both use libvte.

So my question:

  • Why is libvte displaying the wrong glyph?
  • Why does it behave differently between TTF and PCF? (Remember that both fonts contain an identical set of glyphs.)

Update: It seems that this isn't actually related to VTE but to Gtk, and possibly X11 itself. The same results can be seen when setting the font in a text editor, such as mousepad (which uses GtkSourceView.)

Best Answer

Actually, xterm (and xfd) can use TrueType fonts, using the -fa option. With the latter, you can see that 0xee20 is missing from the font:

enter image description here

Given that, xterm would show a missing glyph (because it uses only one font). Likely vte is doing the same because none of the fallback fonts which it may be using has this particular private use code.

For comparison, here is a screenshot with xfd displaying the PCF font (which does have the glyph):

enter image description here

Whether the fonts are "identical" depends on how they were created (and maintained). I see 7 missing glyphs on the screenshot of the TrueType font, and none on the PCF font.

Related Question