diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2009-09-09 07:01:21 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2009-09-09 07:01:21 +0000 |
commit | a47ae3fd41b55eb872f242d006f24f22b1118178 (patch) | |
tree | 299a8b1d16bdd47b638009ccaac68e0dcbe34de9 /sys | |
parent | 13e385e0c8e75d6b515224b004b945f4a5e4fd0f (diff) |
Today we just support a font width up to 8 pixels. Allow a font width
up to 16 pixels now.
Reported by maja@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/udl.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/dev/usb/udl.c b/sys/dev/usb/udl.c index 3f1e24b161d..68646aef9aa 100644 --- a/sys/dev/usb/udl.c +++ b/sys/dev/usb/udl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udl.c,v 1.33 2009/09/06 12:25:38 mglocker Exp $ */ +/* $OpenBSD: udl.c,v 1.34 2009/09/09 07:01:20 mglocker Exp $ */ /* * Copyright (c) 2009 Marcus Glocker <mglocker@openbsd.org> @@ -1806,9 +1806,9 @@ udl_draw_char(struct udl_softc *sc, uint16_t fg, uint16_t bg, u_int uc, uint32_t x, uint32_t y) { int i, j, ly; - uint8_t *fontchar, fontbits, luc; + uint8_t *fontchar; uint8_t buf[UDL_CMD_MAX_DATA_SIZE]; - uint16_t *line, lrgb16; + uint16_t *line, lrgb16, fontbits, luc; struct wsdisplay_font *font = sc->sc_ri.ri_font; fontchar = (uint8_t *)(font->data + (uc - font->firstchar) * @@ -1816,10 +1816,15 @@ udl_draw_char(struct udl_softc *sc, uint16_t fg, uint16_t bg, u_int uc, ly = y; for (i = 0; i < font->fontheight; i++) { - fontbits = *fontchar; + if (font->fontwidth > 8) { + fontbits = betoh16(*(uint16_t *)fontchar); + } else { + fontbits = *fontchar; + fontbits = fontbits << 8; + } line = (uint16_t *)buf; - for (j = (font->fontwidth - 1); j != -1; j--) { + for (j = 15; j > (15 - font->fontwidth); j--) { luc = 1 << j; if (fontbits & luc) lrgb16 = htobe16(fg); |