1 /* $XConsortium: dixfontstr.h,v 1.15 94/04/17 20:25:39 dpw Exp $ */
2 /***********************************************************
3 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
7 Permission to use, copy, modify, and distribute this software and its
8 documentation for any purpose and without fee is hereby granted,
9 provided that the above copyright notice appear in all copies and that
10 both that copyright notice and this permission notice appear in
11 supporting documentation, and that the name of Digital not be
12 used in advertising or publicity pertaining to distribution of the
13 software without specific, written prior permission.
15 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
16 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
17 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
18 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
19 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
20 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
23 ******************************************************************/
25 #ifndef DIXFONTSTRUCT_H
26 #define DIXFONTSTRUCT_H
30 #include "fontstruct.h"
33 #include "X11/Xproto.h" /* for xQueryFontReply */
35 #define FONTCHARSET(font) (font)
36 #define FONTMAXBOUNDS(font,field) (font)->info.maxbounds.field
37 #define FONTMINBOUNDS(font,field) (font)->info.minbounds.field
38 #define TERMINALFONT(font) (font)->info.terminalFont
39 #define FONTASCENT(font) (font)->info.fontAscent
40 #define FONTDESCENT(font) (font)->info.fontDescent
41 #define FONTGLYPHS(font) 0
42 #define FONTCONSTMETRICS(font) (font)->info.constantMetrics
43 #define FONTCONSTWIDTH(font) (font)->info.constantWidth
44 #define FONTALLEXIST(font) (font)->info.allExist
45 #define FONTFIRSTCOL(font) (font)->info.firstCol
46 #define FONTLASTCOL(font) (font)->info.lastCol
47 #define FONTFIRSTROW(font) (font)->info.firstRow
48 #define FONTLASTROW(font) (font)->info.lastRow
49 #define FONTDEFAULTCH(font) (font)->info.defaultCh
50 #define FONTINKMIN(font) (&((font)->info.ink_minbounds))
51 #define FONTINKMAX(font) (&((font)->info.ink_maxbounds))
52 #define FONTPROPS(font) (font)->info.props
53 #define FONTGLYPHBITS(base,pci) ((unsigned char *) (pci)->bits)
54 #define FONTINFONPROPS(font) (font)->info.nprops
56 /* some things haven't changed names, but we'll be careful anyway */
58 #define FONTREFCNT(font) (font)->refcnt
61 * for linear char sets
63 #define N1dChars(pfont) (FONTLASTCOL(pfont) - FONTFIRSTCOL(pfont) + 1)
68 #define N2dChars(pfont) (N1dChars(pfont) * \
69 (FONTLASTROW(pfont) - FONTFIRSTROW(pfont) + 1))
72 #define GLYPHPADBYTES -1
75 #if GLYPHPADBYTES == 0 || GLYPHPADBYTES == 1
76 #define GLYPHWIDTHBYTESPADDED(pci) (GLYPHWIDTHBYTES(pci))
77 #define PADGLYPHWIDTHBYTES(w) (((w)+7)>>3)
80 #if GLYPHPADBYTES == 2
81 #define GLYPHWIDTHBYTESPADDED(pci) ((GLYPHWIDTHBYTES(pci)+1) & ~0x1)
82 #define PADGLYPHWIDTHBYTES(w) (((((w)+7)>>3)+1) & ~0x1)
85 #if GLYPHPADBYTES == 4
86 #define GLYPHWIDTHBYTESPADDED(pci) ((GLYPHWIDTHBYTES(pci)+3) & ~0x3)
87 #define PADGLYPHWIDTHBYTES(w) (((((w)+7)>>3)+3) & ~0x3)
90 #if GLYPHPADBYTES == 8 /* for a cray? */
91 #define GLYPHWIDTHBYTESPADDED(pci) ((GLYPHWIDTHBYTES(pci)+7) & ~0x7)
92 #define PADGLYPHWIDTHBYTES(w) (((((w)+7)>>3)+7) & ~0x7)
95 #endif /* DIXFONTSTRUCT_H */