Solved How to change vt console font size?

Make it persistent with allscreens_flags="-f terminus-b32" in /etc/rc.conf.
Thanks! I've completely missed this variable.
As I need japanese font, I have
if [ "vt" = `sysctl -n -q kern.vty` ] then keymap="jp.kbd" if [ -r /usr/share/vt/fonts/b16.fnt ] ; then vidcontrol -f /usr/share/vt/fonts/b16.fnt fi else keymap="jp.106.kbd" fi
in my /etc/rc.conf but it just sets font for ttyv0.
Changing vidcontrol line to use allscreens_flags= allow other vtys to use the same font as ttyv0.

An additional info:
In this case which terminus font is sufficient, you can put screen.font=16x32 in your /boot/loader.conf.
It would change font before kernel starts and all kernel messages before /etc/rc.conf is read would also changed.
Read man 5 loader.conf and /boot/fonts/INDEX.fonts for details.
 
You can use vidfont(1) to select a font for the console. I'm using Terminus BSD Console, size 32. Make it persistent with allscreens_flags="-f terminus-b32" in /etc/rc.conf. See also rc.conf(5) and vidcontrol(1), especially option -f. The font names to use in allscreens_flags are the ones found under /usr/share/vt/fonts.
In case you ever wish to apply other vidcontrol(1) settings to all screens, it may be safer to supply a size as well as a font file, e.g. allscreens_flags="-f 16x32 terminus-b32". Your supplied font file is unambiguous so what you put as the size doesn't matter at all. However, the usage is
Code:
vidcontrol [-Cx] [-b color] [-c appearance] [-f [[size] file]]
                  [-g geometry] [-h size] [-i active | adapter | mode]
                  [-M char] [-m on | off]
                  [-r foreground background] [-S on | off] [-s number]
                  [-T xterm | cons25] [-t N | off] [mode]
                  [foreground [background]] [show]

It seems the two items following -f, if supplied, are parsed as the size and file, even if the first is unambiguously a font file and not a size, and the second is clearly not. Let's say you later decide to set the number of lines of history in your scrollback buffer to 500 lines and change the display colors to light white text on a blue background. This fails:

Code:
$ vidcontrol -f terminus-b32 -h 500 lightwhite blue
vidcontrol: -h: can't load font file

Unfortunate, as -h is obviously not intended to be supplying a font file. However, the following, verbatim, actually works:

Code:
$ vidcontrol -f dummysize terminus-b32 -h 500 lightwhite blue

Probably best to replace dummysize with 8x16 or whatever is appropriate, even if it's not actually being used to identify the font file. This way if you ever decide to come back and add more later, you just need to append like allscreens_flags="-f 16x32 terminus-b32 -h 500 lightwhite blue" in your rc.conf(5) without getting puzzled about why it doesn't work. See https://forums.freebsd.org/threads/vidcontrol-font-and-color-via-etc-rc-conf-problem.81696/
 
Back
Top