diff options
author | Dale S. Rahn <rahnds@cvs.openbsd.org> | 2000-09-06 01:39:17 +0000 |
---|---|---|
committer | Dale S. Rahn <rahnds@cvs.openbsd.org> | 2000-09-06 01:39:17 +0000 |
commit | dc5601084e9158c165f9926e58e2d943f2397966 (patch) | |
tree | 8ba0f02c27253bb42d49c49d5c7f0d449360e3ed /sys/dev/wscons/wscons_rinit.c | |
parent | 7620e968302f943ed2318d1d0328e9e07c191f47 (diff) |
Add support for smaller font, default 23point font is too large for 800x600
or 640x480 screen.
Move font initialization into source file, rather than in header file.
New font added, 8x16, derived from ic/font8x16.c
If gallant font will give 80 or more columns, it is used, if not
the 8x16 font is used.
Diffstat (limited to 'sys/dev/wscons/wscons_rinit.c')
-rw-r--r-- | sys/dev/wscons/wscons_rinit.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/dev/wscons/wscons_rinit.c b/sys/dev/wscons/wscons_rinit.c index 5e37e2b6a49..ffc1019c548 100644 --- a/sys/dev/wscons/wscons_rinit.c +++ b/sys/dev/wscons/wscons_rinit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wscons_rinit.c,v 1.7 2000/05/16 23:49:11 mickey Exp $ */ +/* $OpenBSD: wscons_rinit.c,v 1.8 2000/09/06 01:39:16 rahnds Exp $ */ /* $NetBSD: wscons_rinit.c,v 1.2 1998/05/14 20:49:56 drochner Exp $ */ /* @@ -104,6 +104,13 @@ rcons_init(rc, mrow, mcol) struct raster *rp = rc->rc_sp; int i; + /* force decent minimums */ + if (mrow < 25) { + mrow = 25; + } + if (mcol < 80) { + mcol = 80; + } rcons_initfont(rc, &gallant19); i = rp->height / rc->rc_font->height; @@ -111,6 +118,16 @@ rcons_init(rc, mrow, mcol) i = rp->width / rc->rc_font->width; rc->rc_maxcol = min(i, mcol); + if ( rc->rc_maxcol < 80 ) { + /* font too big, try smaller font */ + rcons_initfont(rc, &fontdata8x16); + + i = rp->height / rc->rc_font->height; + rc->rc_maxrow = min(i, mrow); + + i = rp->width / rc->rc_font->width; + rc->rc_maxcol = min(i, mcol); + } /* Center emulator screen (but align x origin to 32 bits) */ rc->rc_xorigin = |