Subject: Re: international wscons
To: None <tech-kern@netbsd.org>
From: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
List: tech-kern
Date: 03/22/2002 00:14:57
--ypu60I7LcqmDBIVS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Mar 21, 2002 at 16:16:30 +0100, jakym@volny.cz wrote:

> Is anyone working on $subj (support for iso-8859-*/else keyboard and
> display)? I have some work done (iso-8859-2), it is not much useful
> as of now, as I can't change the font on my -current box (I can load
> it, but no effect), so I can write czech, but still see garbage
> (iso01 chars)...

No userland util currently issues WSDISPLAYIO_USEFONT.  I think
there's a PR for it.  Meanwhile I use the attached hack (with
hardcoded values) when I need cyrillic on my i386 laptop console.

PS: wscons design is severly underdocumented and no, section 9 pages
(thanks Gregory!) are not a substitute.

SY, Uwe
-- 
uwe@ptc.spbu.ru                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen

--ypu60I7LcqmDBIVS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="wsusefont.c"

#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>

#include <dev/wscons/wsconsio.h>

main()
{
    char name[] = "koi8.816";
    struct wsdisplay_usefontdata use = { name };
    int wsfd;
    int res;

    wsfd = open("/dev/tty", O_RDWR, 0);
    if (wsfd < 0) {
	perror("open");
	exit(1);
    }

    res = ioctl(wsfd, WSDISPLAYIO_USEFONT, &use);
    if (res < 0) {
	perror("WSDISPLAY_USEFONT");
	exit(1);
    }
}

--ypu60I7LcqmDBIVS--