diff options
author | Frederic Cambus <fcambus@cvs.openbsd.org> | 2019-01-09 11:23:33 +0000 |
---|---|---|
committer | Frederic Cambus <fcambus@cvs.openbsd.org> | 2019-01-09 11:23:33 +0000 |
commit | f0987b017f0755b6175edc46211d53faf2a50997 (patch) | |
tree | 4ad6a6ceb77a48dc397ca3e65277587acea51b9b /sys/dev/rasops/rasops.c | |
parent | b29fcd459d1d366a8885b6292a5495ffc9a32f5b (diff) |
Enable Spleen in wsfont and modify the font selection logic at runtime
in rasops(9) to allow selecting larger fonts when available.
Summary of the changes:
- Enable spleen8x16 for all architectures, replacing bold8x16_iso1.
- Enable spleen12x24 on all arches but sparc64, replacing gallant12x22.
- Enable spleen16x32 and spleen32x64 on amd64, i386, and arm64 for
GENERIC kernels.
- Modify the font selection logic in rasops(9) so the 16x32 and 32x64
fonts are selected if at least 120 columns can be displayed. Screens
with widths equal or larger than 1920px will use the 16x32 font, and
screens with widths equal or larger than 3840px the 32x64 one.
OK kettenis@, ratchov@, deraadt@
Diffstat (limited to 'sys/dev/rasops/rasops.c')
-rw-r--r-- | sys/dev/rasops/rasops.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/sys/dev/rasops/rasops.c b/sys/dev/rasops/rasops.c index 4c1e8d28031..f9a017214cf 100644 --- a/sys/dev/rasops/rasops.c +++ b/sys/dev/rasops/rasops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.c,v 1.57 2018/09/22 17:40:57 kettenis Exp $ */ +/* $OpenBSD: rasops.c,v 1.58 2019/01/09 11:23:32 fcambus Exp $ */ /* $NetBSD: rasops.c,v 1.35 2001/02/02 06:01:01 marcus Exp $ */ /*- @@ -211,15 +211,24 @@ rasops_init(struct rasops_info *ri, int wantrows, int wantcols) #ifdef _KERNEL /* Select a font if the caller doesn't care */ if (ri->ri_font == NULL) { - int cookie; + int cookie = -1; wsfont_init(); - if (ri->ri_width > 80*12) - /* High res screen, choose a big font */ + if (ri->ri_width >= 120 * 32) + /* Screen width larger than 3840px, 32px wide font */ + cookie = wsfont_find(NULL, 32, 0, 0); + + if (cookie <= 0 && ri->ri_width >= 120 * 16) + /* Screen width larger than 1920px, 16px wide font */ + cookie = wsfont_find(NULL, 16, 0, 0); + + if (cookie <= 0 && ri->ri_width > 80 * 12) + /* Screen width larger than 960px, 12px wide font */ cookie = wsfont_find(NULL, 12, 0, 0); - else - /* lower res, choose a 8 pixel wide font */ + + if (cookie <= 0) + /* Lower resolution, choose a 8px wide font */ cookie = wsfont_find(NULL, 8, 0, 0); if (cookie <= 0) |