Solved How to make vt console switch to the default "Terminus BSD" font?

Hello everyone!

Before installing FreeBSD 11.0 on my ThinkPad X31, I had met difficulties with supporting Russian language (Cyrillic script) text in console: specifically, it didn’t happen to support UTF-8, so I have had to use the now-obsolete KOI8-R both on console and in X11. This changed with 11.0 and the new vt console driver, which includes a UTF-8 and Cyrillic compatible font (Terminus) which is apparently used by default.

Now, after experimenting with console fonts ( vidcontrol -f <font>), I have found that the specific variant of this font is not in /usr/share/vt/fonts/ and, more than that, is hard-coded into the vt source code at /usr/src/sys/dev/vt/font/vt_font_default.c, under the name “Terminus BSD Console font”. The vidcontrol command seems to require a .fnt file in order to change the console’s font. Using vidfont -r only changes the font to vgarom-thin-8x16, which is obviously not what I have intended to do. Is there any way to restore the original font, preferably without downloading the original Terminus font files?

(Also, when running on VirtualBox, I have found that FreeBSD doesn’t use the aforementioned Terminus BSD font, instead using a font of the vgarom type. This question may warrant a separate thread.)
 
If you run it as just vidfont, does it list terminus-b32? Do you have vgarom-thin-8x16 set in allscreens_flags in /etc/rc.conf?

Edit: I'm using allscreens_flags="-f terminus-b32" in /etc/rc.conf on my laptop with UEFI boot.
 
I’ve expected a mention of terminus-b32. Yes, it’s present, it’s in vidfont list, but the problem is it’s too large (I use 8×16 in my console). The allscreens_flags option is not set in /etc/rc.conf or affected in any way.
 
Update: As it turned out, everything is much simpler. I skipped the description of vidcontrol(1) which states that under vt(4), an empty -f parameter restores the 8×16 Terminus BSD font (something I have discovered by analyzing the source code — /usr/src/usr.sbin/vidcontrol/vidcontrol.c). The topic can now be closed.
 
You are responsible to close (indeed, mark it as solved) your the topics. :)

Go to the top right -> ... (this is a button) -> Edit Thread -> then change the prefix to "Solved".
 
an empty -f parameter restores the 8×16 Terminus BSD font
Hi,

This might be a n00b question from me, but can anyone give me the line I'll have to add to /etc/rc.conf to make this work?

'Work' as in using the 'Teminus BSD Console, size 32' but then in a decent size.

Just allscreens_flags="-f terminus-b32" as yuripv stated just gives the oversized 32pt in my TTY.

TIA,
 
'Work' as in using the 'Teminus BSD Console, size 32' but then in a decent size.
The size of the font is 32 pixels. That's what you've set it to. You're probably confusing things with the resolution of the screen. If the resolution is 800x600, then a 32 pixel font looks larger then when using a 32 pixel font on 1280x1024. The size of the font doesn't change, the size of the pixels does.
 
This might be a n00b question from me, but can anyone give me the line I'll have to add to /etc/rc.conf to make this work?

'Work' as in using the 'Teminus BSD Console, size 32' but then in a decent size.
[EDIT: If changing the screen resolution is not an option], to make it work, in a decent size, there is the need of a appropriate font to set.

There are not much vt(4) fonts to choose from on a default installation, look in /usr/share/vt/fonts or run vidfont(1). If you are unsatisfied with the present fonts, you can convert some custom size fonts with vtfontcvt(8). Here are Terminus fonts to download for conversion, or there are some ready to use .fnt fonts in ports, but those are not to everybody's liking:

x11-fonts/spleen https://forums.freebsd.org/attachments/x11-fonts_spleen-png.8623/
x11-fonts/profont https://forums.freebsd.org/attachments/x11-font_profont-png.8624/
x11-fonts/tamsyn

Here is an example of a converted bold terminus font I use on a VirtualBox installation:


Note, the Terminus font tar ball contains bold (*b.bdf) and normal (*n.bdf) fonts.

If converted or installed from ports/package, set the full path to the font in the allscreens_flags variable, or copy/link them in /usr/share/vt/fonts and set only the font name, e.g.:
Code:
allscreens_flags="-f /usr/local/share/fonts/spleen/spleen-12x24"
allscreens_flags="-f terminus-11x22"
 
That spleen font, I tried to put in rc.conf, but some were too small/blurry,
others were clear but TOO LARGE. What may be the NxXX number for
the screenshot [png] above?
 
That spleen font, I tried to put in rc.conf, but some were too small/blurry,
others were clear but TOO LARGE. What may be the NxXX number for
the screenshot [png] above?
What you see in the image is spleen-12x24.fnt with a screen VT(efifb): resolution 1440x900 on a VirtualBox installation. As SirDice in #8 said, the screen resolution matters also in displaying the font size. Spleen font comes only in 6 sizes, if you can't change the screen resolution then there is not much one can do, except maybe trying to hack the code:

 
This might be a n00b question from me, [...]
Thanks for all your help!

I found out that it was not so much the right font and font size in the console, but faulty lines in my loader.conf and rc.conf. Due to that, the resolution of the console was very low. Confusing for me was that the resolution using X was the wanted 1280x1024.

Several lines in my config files dated from my previous box, where I used sc(4) due to trouble with the Nvidia settings. My new box has Intel graphics and needs other software and settings to make vt(4) output look well. Thanks also to the website of vermaden, providing a step by step setup I used to check the configs.

All well set now, and besides learned some extra Beasty-full things here again!
 
Last edited by a moderator:
Back
Top