diff --git a/sys/dev/rasops/rasops.h b/sys/dev/rasops/rasops.h index e2d4555d4163..4d110a1bce79 100644 --- a/sys/dev/rasops/rasops.h +++ b/sys/dev/rasops/rasops.h @@ -1,4 +1,4 @@ -/* $NetBSD: rasops.h,v 1.15 2001/09/18 18:15:53 wiz Exp $ */ +/* $NetBSD: rasops.h,v 1.16 2004/03/05 08:33:53 petrov Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -108,6 +108,10 @@ struct rasops_info { #define DELTA(p, d, cast) ((p) = (cast)((caddr_t)(p) + (d))) +#define CHAR_IN_FONT(c,font) \ + ((c) >= (font)->firstchar && \ + ((c) - (font)->firstchar) < (font)->numchars) + /* * rasops_init(). * diff --git a/sys/dev/rasops/rasops8.c b/sys/dev/rasops/rasops8.c index de7418ebe2dc..125c7bb43a9a 100644 --- a/sys/dev/rasops/rasops8.c +++ b/sys/dev/rasops/rasops8.c @@ -1,4 +1,4 @@ -/* $NetBSD: rasops8.c,v 1.16 2002/02/11 20:50:58 uwe Exp $ */ +/* $NetBSD: rasops8.c,v 1.17 2004/03/05 08:33:53 petrov Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rasops8.c,v 1.16 2002/02/11 20:50:58 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rasops8.c,v 1.17 2004/03/05 08:33:53 petrov Exp $"); #include "opt_rasops.h" @@ -118,6 +118,9 @@ rasops8_putchar(cookie, row, col, uc, attr) ri = (struct rasops_info *)cookie; + if (!CHAR_IN_FONT(uc, ri->ri_font)) + return; + #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) @@ -234,6 +237,9 @@ rasops8_putchar8(cookie, row, col, uc, attr) ri = (struct rasops_info *)cookie; + if (!CHAR_IN_FONT(uc, ri->ri_font)) + return; + #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; @@ -305,6 +311,9 @@ rasops8_putchar12(cookie, row, col, uc, attr) ri = (struct rasops_info *)cookie; + if (!CHAR_IN_FONT(uc, ri->ri_font)) + return; + #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; @@ -379,6 +388,9 @@ rasops8_putchar16(cookie, row, col, uc, attr) ri = (struct rasops_info *)cookie; + if (!CHAR_IN_FONT(uc, ri->ri_font)) + return; + #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--;