2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: bdftosnf.h /main/4 1996/06/25 20:13:29 cde-fuj $ */
25 * (c) Copyright 1995 FUJITSU LIMITED
26 * This is source code modified by FUJITSU LIMITED under the Joint
27 * Development Agreement for the CDEnext PST.
28 * This is unpublished proprietary source code of FUJITSU LIMITED
32 #include<X11/Xfuncs.h>
35 #define MIN(a,b) ((a)>(b)?(b):(a))
38 #define MAX(a,b) ((a)>(b)?(a):(b))
41 typedef struct _GlyphMap {
49 * a structure to hold all the pointers to make it easy to pass them all
50 * around. Much like the FONT structure in the server.
53 typedef struct _TempFont {
56 unsigned char *pGlyphs;
61 } TempFont; /* not called font since collides with type in X.h */
64 # define DEFAULTGLPAD 1 /* default padding for glyphs */
65 # define DEFAULTBITORDER LSBFirst /* default bitmap bit order */
66 # define DEFAULTBYTEORDER LSBFirst /* default bitmap byte order */
67 # define DEFAULTSCANUNIT 1 /* default bitmap scan unit */
72 # define DEFAULTGLPAD 4 /* default padding for glyphs */
73 # define DEFAULTBITORDER LSBFirst /* default bitmap bit order */
74 # define DEFAULTBYTEORDER LSBFirst /* default bitmap byte order */
75 # define DEFAULTSCANUNIT 1 /* default bitmap scan unit */
77 # define DEFAULTGLPAD 4 /* default padding for glyphs */
78 # define DEFAULTBITORDER MSBFirst /* default bitmap bit order */
79 # define DEFAULTBYTEORDER MSBFirst /* default bitmap byte order */
80 # define DEFAULTSCANUNIT 1 /* default bitmap scan unit */
85 # define DEFAULTGLPAD 2 /* default padding for glyphs */
86 # define DEFAULTBITORDER MSBFirst /* default bitmap bit order */
87 # define DEFAULTBYTEORDER MSBFirst /* default bitmap byte order */
88 # define DEFAULTSCANUNIT 1 /* default bitmap scan unit */
92 # define DEFAULTGLPAD 1 /* default padding for glyphs */
93 # define DEFAULTBITORDER MSBFirst /* default bitmap bit order */
94 # define DEFAULTBYTEORDER MSBFirst /* default bitmap byte order */
95 # define DEFAULTSCANUNIT 1 /* default bitmap scan unit */
99 # define DEFAULTGLPAD 2 /* default padding for glyphs */
100 # define DEFAULTBITORDER MSBFirst /* default bitmap bit order */
101 # define DEFAULTBYTEORDER MSBFirst /* default bitmap byte order */
102 # define DEFAULTSCANUNIT 1 /* default bitmap scan unit */
104 #elif defined(pegasus)
106 # define DEFAULTGLPAD 4 /* default padding for glyphs */
107 # define DEFAULTBITORDER MSBFirst /* default bitmap bit order */
108 # define DEFAULTBYTEORDER MSBFirst /* default bitmap byte order */
109 # define DEFAULTSCANUNIT 1 /* default bitmap scan unit */
114 # define DEFAULTGLPAD 4 /* default padding for glyphs */
115 # define DEFAULTBITORDER LSBFirst /* default bitmap bit order */
116 # define DEFAULTBYTEORDER LSBFirst /* default bitmap byte order */
117 # define DEFAULTSCANUNIT 1 /* default bitmap scan unit */
120 # define DEFAULTGLPAD 4 /* default padding for glyphs */
121 # define DEFAULTBITORDER MSBFirst /* default bitmap bit order */
122 # define DEFAULTBYTEORDER MSBFirst /* default bitmap byte order */
123 # define DEFAULTSCANUNIT 1 /* default bitmap scan unit */
127 # define DEFAULTGLPAD 1 /* default padding for glyphs */
128 # define DEFAULTBITORDER MSBFirst /* default bitmap bit order */
129 # define DEFAULTBYTEORDER MSBFirst /* default bitmap byte order */
130 # define DEFAULTSCANUNIT 1 /* default bitmap scan unit */
133 #define GLWIDTHBYTESPADDED(bits,nbytes) \
134 ((nbytes) == 1 ? (((bits)+7)>>3) /* pad to 1 byte */ \
135 :(nbytes) == 2 ? ((((bits)+15)>>3)&~1) /* pad to 2 bytes */ \
136 :(nbytes) == 4 ? ((((bits)+31)>>3)&~3) /* pad to 4 bytes */ \
137 :(nbytes) == 8 ? ((((bits)+63)>>3)&~7) /* pad to 8 bytes */ \