Module Name: src
Committed By: macallan
Date: Wed Jan 4 15:53:49 UTC 2012
Modified Files:
src/sys/dev/wsfont: wsfont.h
Log Message:
add WSFONT_GLYPH() to get a pointer to a given glyph in a given font
To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/wsfont/wsfont.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/wsfont/wsfont.h
diff -u src/sys/dev/wsfont/wsfont.h:1.22 src/sys/dev/wsfont/wsfont.h:1.23
--- src/sys/dev/wsfont/wsfont.h:1.22 Thu Dec 22 05:01:15 2011
+++ src/sys/dev/wsfont/wsfont.h Wed Jan 4 15:53:49 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: wsfont.h,v 1.22 2011/12/22 05:01:15 macallan Exp $ */
+/* $NetBSD: wsfont.h,v 1.23 2012/01/04 15:53:49 macallan Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002 The NetBSD Foundation, Inc.
@@ -34,7 +34,8 @@
#define WSFONT_FLAGS_MASK 0x7f000000
#define WSFONT_FLAG_OPT 0x01000000 /* use alternate font */
-
+#define WSFONT_GLYPH(c, font) ((uint8_t *)font->data + \
+ ((c) - font->firstchar) * font->stride * font->fontheight)
/*
* Example:
*