]> git.sesse.net Git - rdpsrv/blob - Xserver/programs/Xserver/include/dixfontstr.h
Import X server from vnc-3.3.7.
[rdpsrv] / Xserver / programs / Xserver / include / dixfontstr.h
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.
4
5                         All Rights Reserved
6
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.
14
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
21 SOFTWARE.
22
23 ******************************************************************/
24
25 #ifndef DIXFONTSTRUCT_H
26 #define DIXFONTSTRUCT_H
27
28 #include "servermd.h"
29 #include "dixfont.h"
30 #include "fontstruct.h"
31 #include "closure.h"
32 #define NEED_REPLIES
33 #include "X11/Xproto.h" /* for xQueryFontReply */
34
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
55
56 /* some things haven't changed names, but we'll be careful anyway */
57
58 #define FONTREFCNT(font)          (font)->refcnt
59
60 /*
61  * for linear char sets
62  */
63 #define N1dChars(pfont) (FONTLASTCOL(pfont) - FONTFIRSTCOL(pfont) + 1)
64
65 /*
66  * for 2D char sets
67  */
68 #define N2dChars(pfont) (N1dChars(pfont) * \
69                          (FONTLASTROW(pfont) - FONTFIRSTROW(pfont) + 1))
70
71 #ifndef GLYPHPADBYTES
72 #define GLYPHPADBYTES -1
73 #endif
74
75 #if GLYPHPADBYTES == 0 || GLYPHPADBYTES == 1
76 #define GLYPHWIDTHBYTESPADDED(pci)      (GLYPHWIDTHBYTES(pci))
77 #define PADGLYPHWIDTHBYTES(w)           (((w)+7)>>3)
78 #endif
79
80 #if GLYPHPADBYTES == 2
81 #define GLYPHWIDTHBYTESPADDED(pci)      ((GLYPHWIDTHBYTES(pci)+1) & ~0x1)
82 #define PADGLYPHWIDTHBYTES(w)           (((((w)+7)>>3)+1) & ~0x1)
83 #endif
84
85 #if GLYPHPADBYTES == 4
86 #define GLYPHWIDTHBYTESPADDED(pci)      ((GLYPHWIDTHBYTES(pci)+3) & ~0x3)
87 #define PADGLYPHWIDTHBYTES(w)           (((((w)+7)>>3)+3) & ~0x3)
88 #endif
89
90 #if GLYPHPADBYTES == 8 /* for a cray? */
91 #define GLYPHWIDTHBYTESPADDED(pci)      ((GLYPHWIDTHBYTES(pci)+7) & ~0x7)
92 #define PADGLYPHWIDTHBYTES(w)           (((((w)+7)>>3)+7) & ~0x7)
93 #endif
94
95 #endif                          /* DIXFONTSTRUCT_H */