Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/wsfont add WSFONT_GLYPH() to get a pointer to a give...



details:   https://anonhg.NetBSD.org/src/rev/2dcf54536de8
branches:  trunk
changeset: 772454:2dcf54536de8
user:      macallan <macallan%NetBSD.org@localhost>
date:      Wed Jan 04 15:53:49 2012 +0000

description:
add WSFONT_GLYPH() to get a pointer to a given glyph in a given font

diffstat:

 sys/dev/wsfont/wsfont.h |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r b8d35324df15 -r 2dcf54536de8 sys/dev/wsfont/wsfont.h
--- a/sys/dev/wsfont/wsfont.h   Wed Jan 04 15:48:54 2012 +0000
+++ b/sys/dev/wsfont/wsfont.h   Wed Jan 04 15:53:49 2012 +0000
@@ -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:
  *



Home | Main Index | Thread Index | Old Index