NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NetBSD vs. VirtualBox



woods%planix.ca@localhost ("Greg A. Woods") writes:

> However it would be
>nice to be able to explicitly say what size terminal should be emulated,
>with some/all of the same screen types as the old vga(4) driver
>supports.

For a raster display, the kernel has only a couple of fixed size fonts
available and selects the "best" one to produce a 80x25 terminal.
You can compile more fonts into the kernel.

I use a modified heuristic on what is considered "best" with the patch:

Index: wsfont.c
===================================================================
RCS file: /cvsroot/src/sys/dev/wsfont/wsfont.c,v
retrieving revision 1.83
diff -p -u -r1.83 wsfont.c
--- wsfont.c    25 Mar 2025 10:50:12 -0000      1.83
+++ wsfont.c    22 Aug 2026 22:20:28 -0000
@@ -635,12 +635,9 @@ wsfont_matches(struct wsdisplay_font *fo
                                return (0);
                } else {
                        if (font->fontwidth > width) {
-                               score -= uimin(font->fontwidth - width, 9999);
-                               if ((flags & WSFONT_PREFER_WIDE) == 0) {
-                                       score -= 10000;
-                               }
+                               score -= uimin(font->fontwidth - width, 4999) * 2 + 1;
                        } else {
-                               score -= uimin(width - font->fontwidth, 9999);
+                               score -= uimin(width - font->fontwidth, 4999) * 2;
                                if ((flags & WSFONT_PREFER_WIDE) != 0) {
                                        score -= 10000;
                                }




Home | Main Index | Thread Index | Old Index