如何更改 NetBSD 中的字体大小(TTY 无 GUI)

如何更改 NetBSD 中的字体大小(TTY 无 GUI)

NetBSD 7.1(GENERIC.201703111743Z)amd64

在没有 gui 的 TTY 中,启动时设置了更好的屏幕分辨率,但字体确实太小了。
那么如何改变这种情况

在 debian dpkg 上,在 grub 中重新配置控制台设置
GRUB_GFXMODE=800x600

我找到了 wsconscfg 的例子:

wsconscfg -t 80x50 -e vt100 3

但我得到

wsconscfg: WSDISPLAYIO_ADDSCREEN: Device not configured

我查看 man wsconscfg wsconsctl wscons wsdisplay vga 等。
所有这些都链接到另一个,但我找不到方法。

答案1

在看/etc/wsconf.conf。它允许您配置启动时使用的终端环境,包括使用不同的字体。在 PC 硬件上,您只能使用几种文本大小:80x25、80x43 和 80x50。 80x50 是最小的字体(但屏幕上可以容纳 50 行,所以非常有用。)

如果您使用 80x50 模式(在您的示例中提到),您需要首先加载 8 像素高的字体;其配置位于我提到的文件顶部附近。您还可以使用该wsfontload命令从 shell 加载字体。

请注意,我从未将 NetBSD 系统配置为 80x43 模式。我认为它可能还需要 8 像素高的字体。

答案2

如果有人正在寻找更好的线索,我将发布我的线索/etc/wscons.conf以供参考。这不会启用latin2(而是启用 80x50 屏幕),但这可以通过注释掉几行并取消注释其他几行来完成。

#   $NetBSD: wscons.conf,v 1.19 2011/07/22 19:06:23 christos Exp $
#
# workstation console configuration

# fonts to load
#
# Note that not all wsdisplay(4) driver implementations are capable of
# loading fonts.
#
# Note:  You must uncomment the 'font ibm - 8' line to get a useful font for
#        any 50 line screens on vga(4) screens, and otherwise you may get what
#        appears to be a black-on-black display.
#
# - 50-line screens need fonts with a height of 8 pixels
# - 40-line screens need fonts with a height of 10 pixels.
#
#   name    width   height  enc file
font    ibm -   8   ibm /usr/share/wscons/fonts/vt220l.808
font    ibm10   -   10  ibm /usr/share/wscons/fonts/vt220l.810
font    ibm16   -   16  ibm /usr/share/wscons/fonts/vt220l.816

#
# You could use the '80x50bf" screen type and also load the "pcvt08" font into
# the upper half of the extended character set, but doing so limits the number
# of colours to 8 instead of the standard 16.
#
# Note: the upper half of the "pcvt" encoded fonts are only useful
# with the "*bf" screen types of the "vga" driver.  The kernel must be
# compiled with the option "WSCONS_SUPPORT_PCVTFONTS" turned on.  See
# vga(4) and wsfontload(8).
#
#font   pcvt    -   -   pcvt    /usr/share/wscons/fonts/vt220h.816
#font   pcvt    -   8   pcvt    /usr/share/wscons/fonts/vt220h.808

# Font for central european languages (ISO 8859-2).
#  Uncomment to load. Needs to be explicitly enabled (see below).
#font   latin2  -   16  iso /usr/share/wscons/fonts/latin2.816

# screens to create
#
# Available emulations depend on which wscons(4) WSEMUL_* kernel
# options have been used.  "vt100", "sun" and "dumb" are the ones
# currently supported in the driver, and which are available by
# default depends on which architcture is in use.
#
# Note the "vt100" emulation should be used with the "TERM=wsvt25" or
# "TERM=wsvt25m", especially for applications using NetBSD curses(3).
#
# See ega(4), vga(4), etc. for supported screen types.
#
# Note: You must uncomment the 'font    ibm' line above to get a useful
#   font for any 50 line screens.
#
#   index   type    emul
# Screen 0 is already configured as console in most cases.
#  Uncomment if a serial console is used.
screen  0   80x50   vt100
screen  1   80x50   vt100
screen  2   80x50   vt100
screen  3   80x50   vt100
screen  4   80x50   vt100
screen  5   80x50   vt100
# leave the last active one as 80x25 just in case the font load fails
screen  6   80x25   vt100
# Screen 7 is for the X11 server started by xdm (on vt08) to attach to
screen  7   -   -

# Keyboard and mux are automatically configured if they are the console.
#  Uncomment the next two lines if a serial console is used.
#keyboard   auto
#mux

# Select a kernel builtin keyboard map by uncommenting the following line and
# altering the country code to your requirements
#
# (choose from user, us, uk, be, cz, dk, nl, fi, fr, de, gr, hu, it, jp, no,
# pl, pt, ru, es, sv, sf, sg, ua)
#
# See wsconsctl(8), pckbd(4), ukbd(4) etc. for more details.
#
#encoding sv
#
# N.B.:  you will want to disable swapctrlcaps if using VirtualBox on
# a host which already has had the swapping done on it!
#
# Also N.B.:  the virtual console swapping may still use the "real" Ctrl-L key
# 
encoding us.swapctrlcaps

# Redefine individual keys from a file containing "keysym" and/or "keycode"
# entries.
#
# See wsconsctl(8) and /usr/share/wscons/keymaps for more details.
#
#mapfile /usr/share/wscons/keymaps/pckbd.sv.svascii

# Set arbitrary wscons variable using specified control device
#   ctldev  var     value
#setvar ttyE0   font        ibm
#setvar ttyE1   font        ibm

# Uncomment for ISO 8859-2 support
#setvar ttyE0   font        latin2
#setvar ttyE1   font        latin2
#setvar ttyE2   font        latin2
#setvar ttyE3   font        latin2

# Change keyboard repeat speed to faster settings.
#setvar wskbd   repeat.del1 250
#setvar wskbd   repeat.deln 30

相关内容