diff options
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) |