vfont-if.h

Go to the documentation of this file.
00001 /*                      V F O N T - I F . H
00002  * BRL-CAD
00003  *
00004  * Copyright (c) 2004-2006 United States Government as represented by
00005  * the U.S. Army Research Laboratory.
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public License
00009  * as published by the Free Software Foundation; either version 2.1 of
00010  * the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this file; see the file named COPYING for more
00019  * information.
00020  */
00021 /** @addtogroup vfont */
00022 /*@{*/
00023 /** @file vfont-if.h
00024  *
00025  *  This header file describes the in-memory format used by
00026  *  the BRL-CAD Package routines for manipulating fonts stored
00027  *  in the Berkeley VFONT format.
00028  *  Note that the VFONT files are in the format found on a VAX --
00029  *  no conversion has been applied.
00030  *  Merely TARing or RCPing the VAX /usr/lib/vfont directory onto
00031  *  any machine suffices to install the fonts.
00032  *  The VAX format of the fonts is invisible to software actually
00033  *  using the fonts, except to be aware that bit zero in a byte of
00034  *  font data is on the right hand side (lsb).
00035  *
00036  *  The VAX declaration of the file is:
00037  *
00038  *      struct header {
00039  *              short           magic;
00040  *              unsigned short  size;
00041  *              short           maxx;
00042  *              short           maxy;
00043  *              short           xtend;
00044  *      };
00045  *      struct dispatch {
00046  *              unsigned short  addr;
00047  *              short           nbytes;
00048  *              char            up, down, left, right;
00049  *              short           width;
00050  *      };
00051  *      char    bits[header.size];
00052  *
00053  *  The char fields up, down, left, and right in the VAX-version
00054  *  of struct dispatch are signed.  Use the SXT macro to extend the sign.
00055  *
00056  *  The actual bits array has the upper left corner of the bitmap in
00057  *  the first byte.  Bits are scanned out of the bytes in a
00058  *  left-to-right, top-to-bottom order (most decidedly non-VAX style).
00059  *  Never seems to be any consistency in data formats.
00060  *
00061  *  @author
00062  *      Michael John Muuss
00063  *
00064  *  @par Source
00065  *      SECAD/VLD Computing Consortium, Bldg 394
00066  *      The U. S. Army Ballistic Research Laboratory
00067  *      Aberdeen Proving Ground, Maryland  21005-5066
00068  *
00069  *  $Header: /cvsroot/brlcad/brlcad/include/vfont-if.h,v 14.8 2006/09/18 05:24:07 lbutler Exp $
00070  */
00071 
00072 #define SXT(c)          ((c)|((c&0x80)?(~0xFF):0))
00073 
00074 struct vfont_dispatch  {
00075         unsigned short  vd_addr;
00076         short           vd_nbytes;
00077         short           vd_up;
00078         short           vd_down;
00079         short           vd_left;
00080         short           vd_right;
00081         short           vd_width;
00082 };
00083 struct vfont {
00084         short   vf_maxx;
00085         short   vf_maxy;
00086         short   vf_xtend;
00087         struct vfont_dispatch   vf_dispatch[256];
00088         char    *vf_bits;
00089 };
00090 #define VFONT_NULL      ((struct vfont *)NULL)
00091 
00092 extern struct vfont     *vfont_get();
00093 extern void             vfont_free();
00094 /*@}*/
00095 /*
00096  * Local Variables:
00097  * mode: C
00098  * tab-width: 8
00099  * c-basic-offset: 4
00100  * indent-tabs-mode: t
00101  * End:
00102  * ex: shiftwidth=4 tabstop=8
00103  */
00104 

Generated on Mon Sep 18 01:24:47 2006 for BRL-CAD by  doxygen 1.4.6