diff options
author | emaste <emaste@FreeBSD.org> | 2016-03-21 20:51:35 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2016-03-21 20:51:35 +0000 |
commit | c056e666c83b74fcf110b2edba6656b6d3a26017 (patch) | |
tree | 3d2f18e027be39f036ac56b5a96757e32097fa35 /tools | |
parent | b8a867f9cd17df02accef2043cf5b9f8a846e73a (diff) | |
download | FreeBSD-src-c056e666c83b74fcf110b2edba6656b6d3a26017.zip FreeBSD-src-c056e666c83b74fcf110b2edba6656b6d3a26017.tar.gz |
Remove tools/vt/setfont
It is included in vidcontrol as of r266836.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'tools')
-rw-r--r-- | tools/tools/vt/setfont/Makefile | 6 | ||||
-rw-r--r-- | tools/tools/vt/setfont/setfont.c | 89 |
2 files changed, 0 insertions, 95 deletions
diff --git a/tools/tools/vt/setfont/Makefile b/tools/tools/vt/setfont/Makefile deleted file mode 100644 index a242d51..0000000 --- a/tools/tools/vt/setfont/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -PROG= setfont -MAN1= - -WARNS?= 6 - -.include <bsd.prog.mk> diff --git a/tools/tools/vt/setfont/setfont.c b/tools/tools/vt/setfont/setfont.c deleted file mode 100644 index 127fad3..0000000 --- a/tools/tools/vt/setfont/setfont.c +++ /dev/null @@ -1,89 +0,0 @@ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/consio.h> -#include <sys/endian.h> -#include <sys/ioctl.h> -#include <sys/param.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> - -struct file_header { - uint8_t magic[8]; - uint8_t width; - uint8_t height; - uint16_t pad; - uint32_t glyph_count; - uint32_t map_count[4]; -} __packed; - -static vfnt_map_t * -load_mappingtable(unsigned int nmappings) -{ - vfnt_map_t *t; - unsigned int i; - - if (nmappings == 0) - return (NULL); - - t = malloc(sizeof *t * nmappings); - - if (fread(t, sizeof *t * nmappings, 1, stdin) != 1) { - perror("mappings"); - exit(1); - } - - for (i = 0; i < nmappings; i++) { - t[i].src = be32toh(t[i].src); - t[i].dst = be16toh(t[i].dst); - t[i].len = be16toh(t[i].len); - } - - return (t); -} - -int -main(int argc __unused, char *argv[] __unused) -{ - struct file_header fh; - static vfnt_t vfnt; - size_t glyphsize; - unsigned int i; - - if (fread(&fh, sizeof fh, 1, stdin) != 1) { - perror("file_header"); - return (1); - } - - if (memcmp(fh.magic, "VFNT0002", 8) != 0) { - fprintf(stderr, "Bad magic\n"); - return (1); - } - - for (i = 0; i < VFNT_MAPS; i++) - vfnt.map_count[i] = be32toh(fh.map_count[i]); - vfnt.glyph_count = be32toh(fh.glyph_count); - vfnt.width = fh.width; - vfnt.height = fh.height; - - glyphsize = howmany(vfnt.width, 8) * vfnt.height * vfnt.glyph_count; - vfnt.glyphs = malloc(glyphsize); - - if (fread(vfnt.glyphs, glyphsize, 1, stdin) != 1) { - perror("glyphs"); - return (1); - } - - for (i = 0; i < VFNT_MAPS; i++) - vfnt.map[i] = load_mappingtable(vfnt.map_count[i]); - - if (ioctl(STDOUT_FILENO, PIO_VFONT, &vfnt) == -1) { - perror("PIO_VFONT"); - return (1); - } - - return (0); -} |