diff options
author | Matt Wilson <msw@redhat.com> | 2002-12-11 23:54:47 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2002-12-11 23:54:47 +0000 |
commit | 8c307da285ad1cc5b3e900dc2f0ae11faf1fa6ac (patch) | |
tree | 633ca11b3cb87503512a77470a1284f4512afde3 /utils/snarffont.c | |
parent | 1c491c9c515c1790e505a4100c46ab46bcc5aefc (diff) | |
download | anaconda-8c307da285ad1cc5b3e900dc2f0ae11faf1fa6ac.tar.gz anaconda-8c307da285ad1cc5b3e900dc2f0ae11faf1fa6ac.tar.xz anaconda-8c307da285ad1cc5b3e900dc2f0ae11faf1fa6ac.zip |
first pass at using unicode in text mode
Diffstat (limited to 'utils/snarffont.c')
-rw-r--r-- | utils/snarffont.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/utils/snarffont.c b/utils/snarffont.c index efb35ade6..7793ff653 100644 --- a/utils/snarffont.c +++ b/utils/snarffont.c @@ -11,18 +11,27 @@ void die(char * mess) { exit(1); } +#define MAXFONTSIZE 65536 + int main(void) { - char font[8192]; + char buf[MAXFONTSIZE]; + struct console_font_op cfo; unsigned short map[E_TABSZ]; struct unipair descs[2048]; struct unimapdesc d; int fd; - if ((fd = open("/dev/tty1", O_RDONLY)) < 0) + if ((fd = open("/dev/tty", O_RDONLY)) < 0) die("open"); - if (ioctl(fd, GIO_FONT, font)) - die("GIO_FONT"); + cfo.op = KD_FONT_OP_GET; + cfo.flags = 0; + cfo.width = 8; + cfo.height = 16; + cfo.charcount = 512; + cfo.data = buf; + if (ioctl(fd, KDFONTOP, &cfo)) + die("KDFONTOP KD_FONT_OP_GET"); if (ioctl(fd, GIO_UNISCRNMAP, map)) die("GIO_UNISCRNMAP"); @@ -32,7 +41,8 @@ int main(void) { if (ioctl(fd, GIO_UNIMAP, &d)) die("GIO_UNIMAP"); - write(1, font, sizeof(font)); + write(1, &cfo, sizeof(cfo)); + write(1, buf, sizeof(buf)); write(1, map, sizeof(map)); write(1, &d.entry_ct, sizeof(d.entry_ct)); write(1, descs, d.entry_ct * sizeof(descs[0])); |