Index: sys/dev/wsfb/genfb.c =================================================================== RCS file: /cvsroot/src/sys/dev/wsfb/genfb.c,v retrieving revision 1.90 diff -p -u -r1.90 genfb.c --- sys/dev/wsfb/genfb.c 1 Aug 2022 23:30:10 -0000 1.90 +++ sys/dev/wsfb/genfb.c 4 Dec 2023 14:04:04 -0000 @@ -765,12 +765,14 @@ static int genfb_calc_cols(struct genfb_softc *sc, struct rasops_info *ri) { const int hsize = genfb_calc_hsize(sc); + const int cols = hsize ? hsize / GENFB_CHAR_WIDTH_MM : RASOPS_DEFAULT_WIDTH; - if (hsize != 0) { + if (hsize != 0 && + cols > 2 * RASOPS_DEFAULT_WIDTH) { ri->ri_flg |= RI_PREFER_WIDEFONT; } - return MAX(RASOPS_DEFAULT_WIDTH, hsize / GENFB_CHAR_WIDTH_MM); + return MIN(cols, hsize / GENFB_CHAR_WIDTH_MM); } static int Index: sys/dev/wsfont/wsfont.c =================================================================== RCS file: /cvsroot/src/sys/dev/wsfont/wsfont.c,v retrieving revision 1.80 diff -p -u -r1.80 wsfont.c --- sys/dev/wsfont/wsfont.c 19 Feb 2023 05:35:35 -0000 1.80 +++ sys/dev/wsfont/wsfont.c 4 Dec 2023 14:04:04 -0000 @@ -619,15 +619,11 @@ 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); - if ((flags & WSFONT_PREFER_WIDE) != 0) { + score -= uimin(width - font->fontwidth, 4999) * 2; + if ((flags & WSFONT_PREFER_WIDE) != 0) score -= 10000; - } } } }