Git init
authorKibum Kim <kb0929.kim@samsung.com>
Fri, 6 Jan 2012 16:09:05 +0000 (01:09 +0900)
committerKibum Kim <kb0929.kim@samsung.com>
Fri, 6 Jan 2012 16:09:05 +0000 (01:09 +0900)
27 files changed:
COPYING [new file with mode: 0644]
ChangeLog [new file with mode: 0755]
FS.h [new file with mode: 0644]
FSproto.h [new file with mode: 0644]
Makefile.am [new file with mode: 0755]
README [new file with mode: 0755]
autogen.sh [new file with mode: 0644]
configure.ac [new file with mode: 0755]
debian/README.source [new file with mode: 0644]
debian/changelog [new file with mode: 0755]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0755]
debian/copyright [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/watch [new file with mode: 0644]
debian/x11proto-fonts-dev.install [new file with mode: 0644]
debian/xsfbs/repack.sh [new file with mode: 0644]
debian/xsfbs/xsfbs.mk [new file with mode: 0644]
debian/xsfbs/xsfbs.sh [new file with mode: 0644]
font.h [new file with mode: 0644]
fontproto.h [new file with mode: 0644]
fontsproto.pc.in [new file with mode: 0644]
fontstruct.h [new file with mode: 0644]
fsmasks.h [new file with mode: 0644]
packaging/xorg-x11-proto-fontsproto.spec [new file with mode: 0644]
specs/Makefile.am [new file with mode: 0755]
specs/fsproto.xml [new file with mode: 0755]

diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..eac45aa
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,86 @@
+Copyright 1990, 1991 Network Computing Devices;
+Portions Copyright 1987 by Digital Equipment Corporation
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee, provided
+that the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation, and that the names of Network Computing Devices or Digital
+not be used in advertising or publicity pertaining to distribution
+of the software without specific, written prior permission.
+Network Computing Devices and Digital make no representations
+about the suitability of this software for any purpose.  It is provided
+"as is" without express or implied warranty.
+
+NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES
+OR DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+THIS SOFTWARE.
+
+
+Copyright 1990, 1991, 1998  The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+
+Copyright (c) 1999  The XFree86 Project Inc.
+
+All Rights Reserved.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The XFree86 Project
+Inc. shall not be used in advertising or otherwise to promote the
+sale, use or other dealings in this Software without prior written
+authorization from The XFree86 Project Inc..
diff --git a/ChangeLog b/ChangeLog
new file mode 100755 (executable)
index 0000000..10e7cfa
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,280 @@
+commit 2fce721a9a0c0ff820f2cbbf7309990c25852f02
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Fri Oct 29 21:29:15 2010 -0700
+
+    fontsproto 2.1.1
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit aa59b49bb7673ba7ae1ddd8f3b182ec6ba95b5e0
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Fri Oct 29 21:26:13 2010 -0700
+
+    fsproto.xml: Convert ASCII art figures to UTF-8 line drawings
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit ddb2392d7a403595a78df46ee952f796a39b54ae
+Author: Matt Dew <matt@osource.org>
+Date:   Mon Aug 9 12:10:20 2010 -0400
+
+    specs: convert protocol fsproto from xorg-docs to DocBook XML
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 40b8f3e37445b55c616b1bd9f06b2f5a05151152
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Mar 28 19:25:52 2010 -0400
+
+    config: update AC_PREREQ statement to 2.60
+    
+    Unrelated to the previous patches, the new value simply reflects
+    the reality that the minimum level for autoconf to configure
+    all x.org modules is 2.60 dated June 2006.
+    
+    ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit b018907748cb4705f855e2f311c0b44cb2896c64
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Mar 28 19:00:31 2010 -0400
+
+    config: remove the pkgconfig pc.in file from EXTRA_DIST
+    
+    Automake always includes it in the tarball.
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 4a85fd6b8972b1623806772a527ba88b3d723706
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 22 19:24:48 2009 -0500
+
+    Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+    
+    Now that the INSTALL file is generated.
+    Allows running make maintainer-clean.
+
+commit 96fe6327d6886953a444dca667edbecf718e9319
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon Nov 16 11:13:30 2009 -0500
+
+    README: file created or updated #24206
+    
+    Contains a set of URLs to freedesktop.org.
+
+commit 84f5d55eec62fbb393463c4b2c6207587a75d8f9
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 15 19:45:26 2009 -0500
+
+    Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432
+    
+    ChangeLog filename is known to Automake and requires no further
+    coding in the makefile.
+
+commit 5cd013191e8d4adf2c3b8818a7e1892e4566ed19
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 15 18:31:28 2009 -0500
+
+    Makefile.am: INSTALL file is missing or incorrect #24206
+    
+    The standard GNU file on building/installing  tarball is copied
+    using the XORG_INSTALL macro contained in XORG_DEFAULT_OPTIONS
+    Add INSTALL target
+
+commit 8bb119d1c7cbbb5e3a6d3b0d997513f1012f2a86
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 15 18:11:36 2009 -0500
+
+    configure.ac: deploy the new XORG_DEFAULT_OPTIONS #24242
+    
+    This macro aggregate a number of existing macros that sets commmon
+    X.Org components configuration options. It shields the configuration file from
+    future changes.
+
+commit b6b91c61fa178becdc0a2e0dfdd8c3fc467364e4
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 15 13:55:25 2009 -0500
+
+    configure.ac: AM_MAINTAINER_MODE missing #24238
+    
+    This turns off maintainer mode build rules in tarballs.
+    Works in conjunction with autogen.sh --enable-maintainer-mode
+
+commit ef2976f9b4bdeae4efccbb4af082c03597e211bd
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sat Nov 14 18:26:46 2009 -0500
+
+    .gitignore: use common defaults with custom section # 24239
+    
+    Using common defaults will reduce errors and maintenance.
+    Only the very small or inexistent custom section need periodic maintenance
+    when the structure of the component changes. Do not edit defaults.
+
+commit 8ce8e2e50381e8cc7f21af58e6481175d1689ea6
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Aug 27 16:21:09 2009 +1000
+
+    fontsproto 2.1.0
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit c2c7f7c5b7bc45a2ff99fe252892b803c3d222fd
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Aug 27 16:16:36 2009 +1000
+
+    Remove RCS tags
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 72c22dd717afe4c7e796eae634e8c4ec175af677
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Jan 27 20:06:28 2009 -0200
+
+    Janitor: Correct make distcheck and dont distribute autogen.sh
+
+commit 451d42b3e5a32b91e874a32d0874485899e3b350
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Dec 6 16:39:01 2007 -0500
+
+    Replace static ChangeLog with dist-hook to generate from git log
+
+commit 863651c2af7b32bba7eedf5d43fdbd97998bd580
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Mon Sep 3 05:54:04 2007 -0400
+
+    Add *~ to .gitignore to skip patch/emacs droppings
+
+commit 8d5cafd32d08753050738314a291dd2fd3ad91c2
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Jul 14 18:56:15 2006 -0700
+
+    renamed: .cvsignore -> .gitignore
+
+commit 6ddcf067a4b10a306f13b2732c712c0a95fe26ea
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:37 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit bb2fe46e444a270e506904856e4f989deb67c1bc
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:48:14 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit 9956a3dd5c2931a790c6e7150ddfbd0d620fdf1f
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Tue Aug 2 19:19:38 2005 +0000
+
+    Add basic .cvsignore files for proto modules.
+
+commit d63eb21475e0c75a6bf3bb1eeef12b395ccab7b0
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:55 2005 +0000
+
+    Various changes preparing packages for RC0:
+    - Verify and update package version numbers as needed
+    - Implement versioning scheme
+    - Change bug address to point to bugzilla bug entry form
+    - Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to
+        reenable it)
+    - Fix makedepend to use pkgconfig and pass distcheck
+    - Update build script to build macros first
+    - Update modular Xorg version
+
+commit 4a938cdb4e61bb249c36a36ed480033282dba0c4
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Sat May 21 03:52:47 2005 +0000
+
+    Change version to 2.0.
+
+commit 82b845b9a129ec244e42a5718867bdb3f4c5e62d
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Thu May 19 00:22:39 2005 +0000
+
+    revert last change, didn't do right thing at all, sorry for the noise
+
+commit 46342b904dfb936a8859c1d9a268f0d8c8af123a
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Thu May 19 00:10:18 2005 +0000
+
+    Require automake 1.7 in AM_INIT_AUTOMAKE
+
+commit e25b847cf67fd41ad36c4cb7b900bf0ed5ce8fb9
+Author: Josh Triplett <josh@speakeasy.net>
+Date:   Sat May 14 09:35:25 2005 +0000
+
+    The headers should go in include/X11/fonts, not include/X11/extensions.
+
+commit 747b5f710fd29f8e34d7d5eefbbca3a728fa8346
+Author: Josh Triplett <josh@speakeasy.net>
+Date:   Sat May 14 08:58:05 2005 +0000
+
+    Add COPYING file for Fonts.
+
+commit f875959fca0981f17522c6325e072391582090de
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Mon May 9 18:20:04 2005 +0000
+
+    Change all the protonames from <extension>Ext to <extension>Proto.
+
+commit 79c89e7f8bd4a291cc58bc18727503ab853764db
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri May 6 01:46:30 2005 +0000
+
+    Initial build system files for proto module.
+
+commit f8419f84622bf0b65e1ed62c1828d041613a3e01
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 18:43:08 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 89c4f5b099d21bab972166ea898d8f333d98dad5
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:31:37 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit ae0ac1684eca92422687ae874e058f17239f503e
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:10:54 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit 08666a657f4c63581c582807760d53dbd44d068f
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:35:14 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit bd9361f063b45969747cc3458c4028aeb63a17d1
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:22:28 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit ba8889a4f7dff3d3f4ca15e7cde42baa792cecea
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:28:02 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit 5be5f868949cb6cd23acf73db79193c9adca9681
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:44 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit d551e3eaf4060cb24ed68eee06323337f12a95ad
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:44 2003 +0000
+
+    Initial revision
+
+commit 387de4c2e956ae535a37da724803bc4acdd9ae3c
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 15:54:35 2003 +0000
+
+    R6.6 is the Xorg base-line
diff --git a/FS.h b/FS.h
new file mode 100644 (file)
index 0000000..605b5a8
--- /dev/null
+++ b/FS.h
@@ -0,0 +1,129 @@
+/*
+ * Copyright 1990, 1991 Network Computing Devices;
+ * Portions Copyright 1987 by Digital Equipment Corporation 
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of Network Computing Devices or Digital
+ * not be used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission.
+ * Network Computing Devices and Digital make no representations 
+ * about the suitability of this software for any purpose.  It is provided 
+ * "as is" without express or implied warranty.
+ *
+ * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES
+ * OR DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+
+/*
+
+Portions Copyright 1987, 1994, 1998  The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+
+#ifndef _FS_H_
+#define        _FS_H_
+
+#include <X11/Xdefs.h>
+#include <X11/fonts/fsmasks.h>
+
+#define        FS_PROTOCOL             2
+#define        FS_PROTOCOL_MINOR       0
+
+#ifndef X_PROTOCOL
+/* protocol familes */
+#define FamilyInternet          0
+#define FamilyDECnet            1
+#define FamilyChaos             2
+#define FamilyInternet6         6
+
+
+typedef unsigned int    FSDrawDirection;
+#endif
+
+#ifndef None
+#define        None            0L
+#endif
+
+#define        LeftToRightDrawDirection        0
+#define        RightToLeftDrawDirection        1
+
+/* font info flags */
+#define        FontInfoAllCharsExist           (1L << 0)
+#define        FontInfoInkInside               (1L << 1)
+#define        FontInfoHorizontalOverlap       (1L << 2)
+
+/* auth status flags */
+#define        AuthSuccess     0
+#define        AuthContinue    1
+#define        AuthBusy        2
+#define        AuthDenied      3
+
+/* property types */
+#define        PropTypeString          0
+#define        PropTypeUnsigned        1
+#define        PropTypeSigned          2
+
+#ifndef LSBFirst
+/* byte order */
+#define LSBFirst                0
+#define MSBFirst                1
+#endif
+
+/* event masks */
+#define        CatalogueChangeNotifyMask       (1L << 0)
+#define        FontChangeNotifyMask            (1L << 1)
+
+/* errors */
+#define        FSSuccess               -1
+#define        FSBadRequest            0
+#define        FSBadFormat             1
+#define        FSBadFont               2
+#define        FSBadRange              3
+#define        FSBadEventMask          4
+#define        FSBadAccessContext      5
+#define        FSBadIDChoice           6
+#define        FSBadName               7
+#define        FSBadResolution         8
+#define        FSBadAlloc              9
+#define        FSBadLength             10
+#define        FSBadImplementation     11
+
+#define        FirstExtensionError     128
+#define        LastExtensionError      255
+
+/* events */
+#define        KeepAlive               0
+#define        CatalogueChangeNotify   1
+#define        FontChangeNotify        2
+#define FSLASTEvent            3
+
+#endif                         /* _FS_H_ */
diff --git a/FSproto.h b/FSproto.h
new file mode 100644 (file)
index 0000000..028156f
--- /dev/null
+++ b/FSproto.h
@@ -0,0 +1,814 @@
+/*
+Copyright 1990, 1991, 1998  The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+ * Copyright 1990, 1991 Network Computing Devices;
+ * Portions Copyright 1987 by Digital Equipment Corporation 
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of Network Computing Devices, or Digital
+ * not be used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission.
+ *
+ * NETWORK COMPUTING DEVICES, AND DIGITAL DISCLAIM ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES,
+ * OR DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+
+#ifndef _FS_PROTO_H_
+#define _FS_PROTO_H_
+
+#include <X11/fonts/FS.h>
+
+#define sz_fsPropOffset 20
+#define sz_fsPropInfo 8
+#define sz_fsResolution 6
+
+#define sz_fsChar2b 2
+#define sz_fsChar2b_version1 2
+#define sz_fsOffset32 8
+#define sz_fsRange             4
+
+#define        sz_fsXCharInfo          12
+#define        sz_fsXFontInfoHeader            40
+
+#define        sz_fsConnClientPrefix   8
+#define        sz_fsConnSetup          12
+#define        sz_fsConnSetupExtra     8
+#define        sz_fsConnSetupAccept    12
+
+/* request sizes */
+#define        sz_fsReq                4
+#define        sz_fsListExtensionsReq  4
+#define        sz_fsResourceReq        8
+
+#define        sz_fsNoopReq                    4
+#define        sz_fsListExtensionReq           4
+#define        sz_fsQueryExtensionReq          4
+#define        sz_fsListCataloguesReq          12
+#define        sz_fsSetCataloguesReq           4
+#define        sz_fsGetCataloguesReq           4
+#define        sz_fsSetEventMaskReq            8
+#define        sz_fsGetEventMaskReq            4
+#define        sz_fsCreateACReq                8
+#define        sz_fsFreeACReq                  8
+#define        sz_fsSetAuthorizationReq        8
+#define        sz_fsSetResolutionReq           4
+#define        sz_fsGetResolutionReq           4
+#define        sz_fsListFontsReq               12
+#define        sz_fsListFontsWithXInfoReq      12
+#define        sz_fsOpenBitmapFontReq          16
+#define        sz_fsQueryXInfoReq              8
+#define        sz_fsQueryXExtents8Req          12
+#define        sz_fsQueryXExtents16Req         12
+#define        sz_fsQueryXBitmaps8Req          16
+#define        sz_fsQueryXBitmaps16Req         16
+#define        sz_fsCloseReq                   8
+
+/* reply sizes */
+#define        sz_fsReply                      8
+#define        sz_fsGenericReply               8
+
+#define        sz_fsListExtensionsReply        8
+#define        sz_fsQueryExtensionReply        20
+#define        sz_fsListCataloguesReply        16
+#define        sz_fsGetCataloguesReply         8
+#define        sz_fsGetEventMaskReply          12
+#define        sz_fsCreateACReply              12
+#define        sz_fsGetResolutionReply         8
+#define        sz_fsListFontsReply             16
+#define        sz_fsListFontsWithXInfoReply    (12 + sz_fsXFontInfoHeader)
+#define        sz_fsOpenBitmapFontReply        16
+#define        sz_fsQueryXInfoReply            (8 + sz_fsXFontInfoHeader)
+#define        sz_fsQueryXExtents8Reply        12
+#define        sz_fsQueryXExtents16Reply       12
+#define        sz_fsQueryXBitmaps8Reply        20
+#define        sz_fsQueryXBitmaps16Reply       20
+
+#define        sz_fsError              16
+#define        sz_fsEvent              12
+#define sz_fsKeepAliveEvent    12
+
+#define        fsTrue  1
+#define        fsFalse 0
+
+/* temp decls */
+#define        Mask            CARD32
+#define        Font            CARD32
+#define        AccContext      CARD32
+
+typedef CARD32 fsTimestamp;
+
+#ifdef NOTDEF /* in fsmasks.h */
+typedef CARD32 fsBitmapFormat;
+typedef CARD32 fsBitmapFormatMask;
+#endif
+#define sz_fsBitmapFormat      4
+
+typedef struct {
+    INT16      left B16,
+                right B16;
+    INT16      width B16;
+    INT16      ascent B16,
+                descent B16;
+    CARD16     attributes B16;
+}           fsXCharInfo;
+
+typedef struct {
+    CARD8       high;
+    CARD8       low;
+}           fsChar2b;
+
+typedef struct {
+    CARD8       low;
+    CARD8       high;
+}           fsChar2b_version1;
+
+typedef struct {
+    CARD8      min_char_high;
+    CARD8      min_char_low;
+    CARD8      max_char_high;
+    CARD8      max_char_low;
+}           fsRange;
+
+typedef struct {
+    CARD32     position B32;
+    CARD32     length B32;
+}          fsOffset32;
+
+typedef struct {
+    fsOffset32 name;
+    fsOffset32 value;
+    CARD8      type;
+    BYTE        pad0;
+    CARD16     pad1 B16;
+}           fsPropOffset;
+
+typedef struct {
+    CARD32     num_offsets B32;
+    CARD32     data_len B32;
+    /* offsets */
+    /* data */
+}          fsPropInfo;
+
+typedef struct {
+    CARD16     x_resolution B16;
+    CARD16     y_resolution B16;
+    CARD16     point_size B16;
+}          fsResolution;
+
+  
+typedef struct {
+    CARD32     flags B32;
+    CARD8      char_range_min_char_high;
+    CARD8      char_range_min_char_low;
+    CARD8      char_range_max_char_high;
+    CARD8      char_range_max_char_low;
+
+    CARD8      draw_direction;
+    CARD8      pad;
+    CARD8      default_char_high;
+    CARD8      default_char_low;
+    INT16      min_bounds_left B16;
+    INT16      min_bounds_right B16;
+
+    INT16      min_bounds_width B16;
+    INT16      min_bounds_ascent B16;
+    INT16      min_bounds_descent B16;
+    CARD16     min_bounds_attributes B16;
+
+    INT16      max_bounds_left B16;
+    INT16      max_bounds_right B16;
+    INT16      max_bounds_width B16;
+    INT16      max_bounds_ascent B16;
+
+    INT16      max_bounds_descent B16;
+    CARD16     max_bounds_attributes B16;
+    INT16      font_ascent B16;
+    INT16      font_descent B16;
+    /* propinfo */
+}           fsXFontInfoHeader;
+
+
+/* requests */
+
+typedef struct {
+    BYTE        byteOrder;
+    CARD8       num_auths;
+    CARD16     major_version B16;
+    CARD16     minor_version B16;
+    CARD16     auth_len B16;
+    /* auth data */
+}           fsConnClientPrefix;
+
+typedef struct {
+    CARD16      status B16;
+    CARD16     major_version B16;
+    CARD16     minor_version B16;
+    CARD8      num_alternates;
+    CARD8      auth_index;
+    CARD16     alternate_len B16;
+    CARD16     auth_len B16;
+    /* alternates */
+    /* auth data */
+}           fsConnSetup;
+
+typedef struct {
+    CARD32     length B32;
+    CARD16      status B16;
+    CARD16     pad B16;
+    /* more auth data */
+}           fsConnSetupExtra;
+
+typedef struct {
+    CARD32     length B32;
+    CARD16     max_request_len B16;
+    CARD16     vendor_len B16;
+    CARD32     release_number B32;
+    /* vendor string */
+}          fsConnSetupAccept;
+
+typedef struct {
+    CARD8       reqType;
+    CARD8       data;
+    CARD16     length B16;
+}           fsReq;
+
+/*
+ * The fsFakeReq structure is never used in the protocol; it is prepended
+ * to incoming packets when setting up a connection so we can index
+ * through InitialVector.  To avoid alignment problems, it is padded
+ * to the size of a word on the largest machine this code runs on.
+ * Hence no sz_fsFakeReq constant is necessary.
+ */
+typedef struct {
+    CARD8       reqType;
+    CARD8       data;
+    CARD16     length B16;
+    CARD32     pad B32;        /* to fill out to multiple of 64 bits */
+}           fsFakeReq;
+
+typedef struct {
+    CARD8       reqType;
+    BYTE        pad;
+    CARD16      length B16;
+    Font        id B32;
+}           fsResourceReq;
+
+typedef fsReq  fsNoopReq;
+typedef fsReq  fsListExtensionsReq;
+
+typedef struct {
+    CARD8       reqType;
+    BYTE        nbytes;
+    CARD16     length B16;
+    /* name */
+}           fsQueryExtensionReq;
+
+typedef struct {
+    CARD8       reqType;
+    CARD8       data;
+    CARD16     length B16;
+    CARD32     maxNames B32;
+    CARD16     nbytes B16;
+    CARD16     pad2 B16;
+    /* pattern */
+}          fsListCataloguesReq;
+
+typedef struct {
+    CARD8       reqType;
+    BYTE        num_catalogues;
+    CARD16     length B16;
+    /* catalogues */
+}           fsSetCataloguesReq;
+
+typedef fsReq  fsGetCataloguesReq;
+
+typedef struct {
+    CARD8       reqType;
+    CARD8       ext_opcode;
+    CARD16     length B16;
+    Mask       event_mask;
+}           fsSetEventMaskReq;
+
+typedef struct {
+    CARD8       reqType;
+    CARD8       ext_opcode;
+    CARD16     length B16;
+}           fsGetEventMaskReq;
+
+typedef struct {
+    CARD8       reqType;
+    BYTE        num_auths;
+    CARD16      length B16;
+    AccContext  acid B32;
+    /* auth protocols */
+}           fsCreateACReq;
+
+typedef fsResourceReq  fsFreeACReq;
+typedef fsResourceReq  fsSetAuthorizationReq;
+
+typedef struct {
+    CARD8      reqType;
+    BYTE       num_resolutions;
+    CARD16     length B16;
+    /* resolutions */
+}          fsSetResolutionReq;
+
+typedef fsReq  fsGetResolutionReq;
+
+typedef struct {
+    CARD8       reqType;
+    BYTE        pad;
+    CARD16     length B16;
+    CARD32     maxNames B32;
+    CARD16     nbytes B16;
+    CARD16     pad2 B16;
+    /* pattern */
+}           fsListFontsReq;
+
+typedef fsListFontsReq fsListFontsWithXInfoReq;
+
+typedef struct {
+    CARD8       reqType;
+    BYTE        pad;
+    CARD16     length B16;
+    Font       fid B32;
+    fsBitmapFormatMask format_mask B32;
+    fsBitmapFormat format_hint B32;
+    /* pattern */
+}           fsOpenBitmapFontReq;
+
+typedef fsResourceReq fsQueryXInfoReq;
+
+typedef struct {
+    CARD8       reqType;
+    BOOL        range;
+    CARD16     length B16;
+    Font       fid B32;
+    CARD32     num_ranges B32;
+    /* list of chars */
+}           fsQueryXExtents8Req;
+
+typedef fsQueryXExtents8Req    fsQueryXExtents16Req;
+
+typedef struct {
+    CARD8       reqType;
+    BOOL       range;
+    CARD16     length B16;
+    Font       fid B32;
+    fsBitmapFormat format B32;
+    CARD32     num_ranges B32;
+    /* list of chars */
+}           fsQueryXBitmaps8Req;
+
+typedef fsQueryXBitmaps8Req    fsQueryXBitmaps16Req;
+
+typedef fsResourceReq fsCloseReq;
+
+
+/* replies */
+typedef struct {
+    BYTE        type;
+    BYTE        data1;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+}           fsGenericReply;
+
+typedef struct {
+    BYTE        type;
+    CARD8       nExtensions;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    /* extension names */
+}           fsListExtensionsReply;
+
+typedef struct {
+    BYTE        type;
+    CARD8       present;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD16     major_version B16;
+    CARD16     minor_version B16;
+    CARD8       major_opcode;
+    CARD8       first_event;
+    CARD8       num_events;
+    CARD8       first_error;
+    CARD8       num_errors;
+    CARD8      pad1;
+    CARD16     pad2 B16;
+}           fsQueryExtensionReply;
+
+typedef struct {
+    BYTE        type;
+    BYTE        pad;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     num_replies B32;
+    CARD32     num_catalogues B32;
+    /* catalog names */
+}          fsListCataloguesReply;
+
+typedef struct {
+    BYTE        type;
+    CARD8       num_catalogues;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    /* catalogue names */
+}           fsGetCataloguesReply;
+
+typedef struct {
+    BYTE        type;
+    BYTE        pad1;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     event_mask B32;
+}          fsGetEventMaskReply;
+
+typedef struct {
+    BYTE       type;
+    CARD8      auth_index;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD16     status B16;
+    CARD16     pad B16;
+    /* auth data */
+}          fsCreateACReply;
+
+typedef struct {
+    CARD32     length B32;
+    CARD16     status B16;
+    CARD16     pad B16;
+    /* auth data */
+}          fsCreateACExtraReply;
+
+typedef struct {
+    BYTE       type;
+    CARD8      num_resolutions;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    /* resolutions */
+}          fsGetResolutionReply;
+
+typedef struct {
+    BYTE        type;
+    BYTE        pad1;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     following B32;
+    CARD32     nFonts B32;
+    /* font names */
+}           fsListFontsReply;
+
+/*
+ * this one is messy.  the reply itself is variable length (unknown
+ * number of replies) and the contents of each is variable (unknown
+ * number of properties)
+ *
+ */
+
+typedef struct {
+    BYTE        type;
+    CARD8       nameLength;    /* 0 is end-of-reply */
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     nReplies B32;
+    CARD32     font_header_flags B32;
+    CARD8      font_hdr_char_range_min_char_high;
+    CARD8      font_hdr_char_range_min_char_low;
+    CARD8      font_hdr_char_range_max_char_high;
+    CARD8      font_hdr_char_range_max_char_low;
+    CARD8      font_header_draw_direction;
+    CARD8      font_header_pad;
+    CARD8      font_header_default_char_high;
+    CARD8      font_header_default_char_low;
+    INT16      font_header_min_bounds_left B16;
+    INT16      font_header_min_bounds_right B16;
+    INT16      font_header_min_bounds_width B16;
+    INT16      font_header_min_bounds_ascent B16;
+    INT16      font_header_min_bounds_descent B16;
+    CARD16     font_header_min_bounds_attributes B16;
+    INT16      font_header_max_bounds_left B16;
+    INT16      font_header_max_bounds_right B16;
+    INT16      font_header_max_bounds_width B16;
+    INT16      font_header_max_bounds_ascent B16;
+    INT16      font_header_max_bounds_descent B16;
+    CARD16     font_header_max_bounds_attributes B16;
+    INT16      font_header_font_ascent B16;
+    INT16      font_header_font_descent B16;
+    /* propinfo */
+    /* name */
+}           fsListFontsWithXInfoReply;
+    
+typedef struct {
+    BYTE        type;
+    CARD8       otherid_valid;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     otherid B32;
+    BYTE       cachable;
+    BYTE       pad1;
+    CARD16     pad2 B16;
+}           fsOpenBitmapFontReply;
+
+typedef struct {
+    BYTE        type;
+    CARD8       pad0;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     font_header_flags B32;
+    CARD8      font_hdr_char_range_min_char_high;
+    CARD8      font_hdr_char_range_min_char_low;
+    CARD8      font_hdr_char_range_max_char_high;
+    CARD8      font_hdr_char_range_max_char_low;
+    CARD8      font_header_draw_direction;
+    CARD8      font_header_pad;
+    CARD8      font_header_default_char_high;
+    CARD8      font_header_default_char_low;
+    INT16      font_header_min_bounds_left B16;
+    INT16      font_header_min_bounds_right B16;
+    INT16      font_header_min_bounds_width B16;
+    INT16      font_header_min_bounds_ascent B16;
+    INT16      font_header_min_bounds_descent B16;
+    CARD16     font_header_min_bounds_attributes B16;
+    INT16      font_header_max_bounds_left B16;
+    INT16      font_header_max_bounds_right B16;
+    INT16      font_header_max_bounds_width B16;
+    INT16      font_header_max_bounds_ascent B16;
+    INT16      font_header_max_bounds_descent B16;
+    CARD16     font_header_max_bounds_attributes B16;
+    INT16      font_header_font_ascent B16;
+    INT16      font_header_font_descent B16;
+    /* propinfo */
+}           fsQueryXInfoReply;
+
+typedef struct {
+    BYTE        type;
+    CARD8       pad0;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32      num_extents B32;
+    /* extents */
+}           fsQueryXExtents8Reply;
+
+typedef fsQueryXExtents8Reply  fsQueryXExtents16Reply;
+
+typedef struct {
+    BYTE        type;
+    CARD8       pad0;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     replies_hint B32;
+    CARD32     num_chars B32;
+    CARD32     nbytes B32;
+    /* offsets */
+    /* glyphs */
+}           fsQueryXBitmaps8Reply;
+
+typedef fsQueryXBitmaps8Reply  fsQueryXBitmaps16Reply;
+
+typedef union {
+    fsGenericReply generic;
+    fsListExtensionsReply extensions;
+    fsGetResolutionReply getres;
+}           fsReply;
+
+/* errors */
+typedef struct {
+    BYTE        type;
+    BYTE        request;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    fsTimestamp        timestamp;
+    CARD8      major_opcode;
+    CARD8      minor_opcode;
+    CARD16     pad B16;
+}          fsError;
+
+typedef struct {
+    BYTE        type;
+    BYTE        request;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    fsTimestamp        timestamp;
+    CARD8      major_opcode;
+    CARD8      minor_opcode;
+    CARD16     pad B16;
+}          fsRequestError;
+
+typedef struct {
+    BYTE        type;
+    BYTE        request;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    fsTimestamp        timestamp;
+    CARD8      major_opcode;
+    CARD8      minor_opcode;
+    CARD16     pad B16;
+    fsBitmapFormat     format B32;
+}          fsFormatError;
+
+typedef struct {
+    BYTE        type;
+    BYTE        request;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    fsTimestamp        timestamp;
+    CARD8      major_opcode;
+    CARD8      minor_opcode;
+    CARD16     pad B16;
+    Font       fontid;
+}          fsFontError;
+
+typedef struct {
+    BYTE        type;
+    BYTE        request;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    fsTimestamp        timestamp;
+    CARD8      major_opcode;
+    CARD8      minor_opcode;
+    CARD16     pad B16;
+    fsRange    range;
+}          fsRangeError;
+
+typedef struct {
+    BYTE        type;
+    BYTE        request;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    fsTimestamp        timestamp;
+    CARD8      major_opcode;
+    CARD8      minor_opcode;
+    CARD16     pad B16;
+    Mask       event_mask;
+}          fsEventMaskError;
+
+typedef struct {
+    BYTE        type;
+    BYTE        request;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    fsTimestamp        timestamp;
+    CARD8      major_opcode;
+    CARD8      minor_opcode;
+    CARD16     pad B16;
+    AccContext acid;
+}          fsAccessContextError;
+
+typedef struct {
+    BYTE        type;
+    BYTE        request;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    fsTimestamp        timestamp;
+    CARD8      major_opcode;
+    CARD8      minor_opcode;
+    CARD16     pad B16;
+    Font       fontid;
+}          fsIDChoiceError;
+
+typedef struct {
+    BYTE        type;
+    BYTE        request;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    fsTimestamp        timestamp;
+    CARD8      major_opcode;
+    CARD8      minor_opcode;
+    CARD16     pad B16;
+}          fsNameError;
+
+typedef struct {
+    BYTE        type;
+    BYTE        request;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    fsTimestamp        timestamp;
+    CARD8      major_opcode;
+    CARD8      minor_opcode;
+    fsResolution resolution;
+}          fsResolutionError;
+
+typedef struct {
+    BYTE        type;
+    BYTE        request;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    fsTimestamp        timestamp;
+    CARD8      major_opcode;
+    CARD8      minor_opcode;
+    CARD16     pad B16;
+}          fsAllocError;
+
+typedef struct {
+    BYTE        type;
+    BYTE        request;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    fsTimestamp        timestamp;
+    CARD8      major_opcode;
+    CARD8      minor_opcode;
+    CARD16     pad B16;
+    CARD32     bad_length B32;
+}          fsLengthError;
+
+typedef struct {
+    BYTE        type;
+    BYTE        request;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    fsTimestamp        timestamp;
+    CARD8      major_opcode;
+    CARD8      minor_opcode;
+    CARD16     pad B16;
+}          fsImplementationError;
+
+/* events */
+typedef struct {
+    BYTE        type;
+    BYTE        event_code;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    fsTimestamp        timestamp;
+}          fsKeepAliveEvent;
+
+typedef struct {
+    BYTE        type;
+    BYTE        event_code;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    fsTimestamp        timestamp;
+    BOOL       added;
+    BOOL       deleted;
+    CARD16     pad B16;
+}          fsCatalogueChangeNotifyEvent;
+
+typedef fsCatalogueChangeNotifyEvent   fsFontChangeNotifyEvent;
+
+typedef fsCatalogueChangeNotifyEvent   fsEvent;
+
+/* reply codes */
+#define        FS_Reply                0       /* normal reply */
+#define        FS_Error                1       /* error */
+#define        FS_Event                2
+
+/* request codes */
+#define                FS_Noop                 0
+#define                FS_ListExtensions       1
+#define                FS_QueryExtension       2
+#define                FS_ListCatalogues       3
+#define                FS_SetCatalogues        4
+#define                FS_GetCatalogues        5
+#define                FS_SetEventMask         6
+#define                FS_GetEventMask         7
+#define                FS_CreateAC             8
+#define                FS_FreeAC               9
+#define                FS_SetAuthorization     10
+#define                FS_SetResolution        11
+#define                FS_GetResolution        12
+#define                FS_ListFonts            13
+#define                FS_ListFontsWithXInfo   14
+#define                FS_OpenBitmapFont       15
+#define                FS_QueryXInfo           16
+#define                FS_QueryXExtents8       17
+#define                FS_QueryXExtents16      18
+#define                FS_QueryXBitmaps8       19
+#define                FS_QueryXBitmaps16      20
+#define                FS_CloseFont            21
+
+/* restore decls */
+#undef Mask
+#undef Font
+#undef  AccContext
+
+#endif                         /* _FS_PROTO_H_ */
diff --git a/Makefile.am b/Makefile.am
new file mode 100755 (executable)
index 0000000..2714762
--- /dev/null
@@ -0,0 +1,26 @@
+SUBDIRS=specs
+
+fontsdir = $(includedir)/X11/fonts
+fonts_HEADERS = \
+       font.h \
+       fontproto.h \
+       fontstruct.h \
+       FS.h \
+       fsmasks.h \
+       FSproto.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = fontsproto.pc
+
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/README b/README
new file mode 100755 (executable)
index 0000000..0f8ba55
--- /dev/null
+++ b/README
@@ -0,0 +1,25 @@
+                               X Fonts Extension
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/proto/fontsproto
+
+        http://cgit.freedesktop.org/xorg/proto/fontsproto
+
+For patch submission instructions, see:
+
+       http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
diff --git a/autogen.sh b/autogen.sh
new file mode 100644 (file)
index 0000000..904cd67
--- /dev/null
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/configure.ac b/configure.ac
new file mode 100755 (executable)
index 0000000..1719886
--- /dev/null
@@ -0,0 +1,19 @@
+AC_PREREQ([2.60])
+AC_INIT([FontsProto], [2.1.1],
+        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros minimum of 1.10 for HAVE_STYLESHEETS in XORG_CHECK_SGML_DOCTOOLS
+m4_ifndef([XORG_MACROS_VERSION],
+         [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.10)
+XORG_DEFAULT_OPTIONS
+XORG_ENABLE_SPECS
+XORG_WITH_XMLTO(0.0.20)
+XORG_WITH_FOP
+XORG_CHECK_SGML_DOCTOOLS(1.5)
+
+AC_OUTPUT([Makefile
+           specs/Makefile
+           fontsproto.pc])
diff --git a/debian/README.source b/debian/README.source
new file mode 100644 (file)
index 0000000..34ab4bf
--- /dev/null
@@ -0,0 +1,73 @@
+------------------------------------------------------
+Quick Guide To Patching This Package For The Impatient
+------------------------------------------------------
+
+1. Make sure you have quilt installed
+2. Unpack the package as usual with "dpkg-source -x"
+3. Run the "patch" target in debian/rules
+4. Create a new patch with "quilt new" (see quilt(1))
+5. Edit all the files you want to include in the patch with "quilt edit" 
+   (see quilt(1)).
+6. Write the patch with "quilt refresh" (see quilt(1))
+7. Run the "clean" target in debian/rules
+
+Alternatively, instead of using quilt directly, you can drop the patch in to 
+debian/patches and add the name of the patch to debian/patches/series.
+
+------------------------------------
+Guide To The X Strike Force Packages
+------------------------------------
+
+The X Strike Force team maintains X packages in git repositories on
+git.debian.org in the pkg-xorg subdirectory. Most upstream packages
+are actually maintained in git repositories as well, so they often
+just need to be pulled into git.debian.org in a "upstream-*" branch.
+Otherwise, the upstream sources are manually installed in the Debian
+git repository.
+
+The .orig.tar.gz upstream source file could be generated this
+"upstream-*" branch in the Debian git repository but it is actually
+copied from upstream tarballs directly.
+
+Due to X.org being highly modular, packaging all X.org applications
+as their own independent packages would have created too many Debian
+packages. For this reason, some X.org applications have been grouped
+into larger packages: xutils, xutils-dev, x11-apps, x11-session-utils,
+x11-utils, x11-xfs-utils, x11-xkb-utils, x11-xserver-utils.
+Most packages, including the X.org server itself and all libraries
+and drivers are, however maintained independently.
+
+The Debian packaging is added by creating the "debian-*" git branch
+which contains the aforementioned "upstream-*" branch plus the debian/
+repository files.
+When a patch has to be applied to the Debian package, two solutions
+are involved:
+* If the patch is available in one of the upstream branches, it
+  may be git'cherry-picked into the Debian repository. In this
+  case, it appears directly in the .diff.gz.
+* Otherwise, the patch is added to debian/patches/ which is managed
+  with quilt as documented in /usr/share/doc/quilt/README.source.
+
+quilt is actually invoked by the Debian X packaging through a larger
+set of scripts called XSFBS. XSFBS brings some other X specific
+features such as managing dependencies and conflicts due to the video
+and input driver ABIs.
+XSFBS itself is maintained in a separate repository at
+  git://git.debian.org/pkg-xorg/xsfbs.git
+and it is pulled inside the other Debian X repositories when needed.
+
+The XSFBS patching system requires a build dependency on quilt. Also
+a dependency on $(STAMP_DIR)/patch has to be added to debian/rules
+so that the XSFBS patching occurs before the actual build. So the
+very first target of the build (likely the one running autoreconf)
+should depend on $(STAMP_DIR)/patch. It should also not depend on
+anything so that parallel builds are correctly supported (nothing
+should probably run while patching is being done). And finally, the
+clean target should depend on the xsfclean target so that patches
+are unapplied on clean.
+
+When the upstream sources contain some DFSG-nonfree files, they are
+listed in text files in debian/prune/ in the "debian-*" branch of
+the Debian repository. XSFBS' scripts then take care of removing
+these listed files during the build so as to generate a modified
+DFSG-free .orig.tar.gz tarball.
diff --git a/debian/changelog b/debian/changelog
new file mode 100755 (executable)
index 0000000..bafce41
--- /dev/null
@@ -0,0 +1,108 @@
+x11proto-fonts (2.1.1-1slp2) unstable; urgency=low
+
+  * [X11R7.6] upgrade package
+  * Git: 165.213.180.234:slp/pkgs/xorg/proto/x11proto-fonts
+  * Tag: x11proto-fonts_2.1.1-1slp2
+
+ -- SooChan Lim <sc1.lim@samsung.com>  Mon, 03 Jan 2011 20:06:26 +0900
+
+x11proto-fonts (2.1.0-5slp2) unstable; urgency=low
+
+  * To sync git and dpkg
+  * Git: 165.213.180.234:/git/slp/pkgs/xorg/proto/x11proto-fonts
+  * Tag: x11proto-fonts_2.1.0-5slp2
+
+ -- YoungHoon Jung <yhoon.jung@samsung.com>  Thu, 02 Dec 2010 15:49:03 +0900
+
+x11proto-fonts (2.1.0-4slp2) unstable; urgency=low
+
+  * Update maintainer
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
+  * Tag: x11proto-fonts_2.1.0-4slp2
+
+ -- Sung-Jin Park <sj76.park@samsung.com>  Wed, 21 Apr 2010 11:18:30 +0900
+
+x11proto-fonts (2.1.0-3slp2) unstable; urgency=low
+
+  * Changed package name as a pure open souroce code.
+
+ -- YoungHoon Jung <yhoon.jung@samsung.com>  Thu, 25 Mar 2010 17:01:41 +0900
+
+x11proto-fonts (2.1.0-2) unstable; urgency=low
+
+  * Import debian package
+
+ -- Sung-Jin Park <sj76.park@samsung.com>  Mon, 21 Dec 2009 13:09:21 +0900
+
+x11proto-fonts (2.1.0-1) unstable; urgency=low
+
+  * New upstream release.
+  * Run autoreconf at build time.
+  * Bump debhelper compat level to 5.
+  * Parse space-separated DEB_BUILD_OPTIONS, handle parallel=N.
+  * Drop Conflicts/Replaces on libfs-dev and Pre-Depends on x11-common, only
+    needed for upgrades from sarge.
+  * Bump Standards-Version to 3.8.3.
+
+ -- Julien Cristau <jcristau@debian.org>  Sun, 06 Sep 2009 12:54:51 +0200
+
+x11proto-fonts (2.0.2-6) unstable; urgency=low
+
+  [ Brice Goglin ]
+  * Update the long description.
+  * Add URL in debian/copyright.
+  * Add Vcs-* to debian/control.
+  * Remove Fabio from Uploaders, with his permission.
+
+  [ Julien Cristau ]
+  * Remove Branden from Uploaders with his permission.
+  * Add myself to Uploaders.
+  * Bump Standards-Version to 3.7.3.
+
+ -- Julien Cristau <jcristau@debian.org>  Sun, 11 May 2008 18:41:14 +0200
+
+x11proto-fonts (2.0.2-5) unstable; urgency=low
+
+  * Depends: x11proto-core-dev, since headers #include some base X11
+    headers. Closes: #387597.
+
+ -- Drew Parsons <dparsons@debian.org>  Sun, 17 Sep 2006 23:19:27 +1000
+
+x11proto-fonts (2.0.2-4) unstable; urgency=low
+
+  * Test for obj-$(DEB_BUILD_GNU_TYPE) before creating it during build;
+    idempotency fix.
+  * Run dh_install w/ --list-missing.
+  * Change debhelper build-dep-indep to a normal build-dep, as dh_clean
+    is called inside the clean rule.
+  * Drop duplicate x11-common dep in -dev package.
+  * Bump standards version to 3.7.2.0.
+  * Version x11-common pre-dep in -dev package to 1:7.0.0 to match
+    the rest of Debian.
+
+ -- Andres Salomon <dilinger@debian.org>  Fri, 21 Jul 2006 02:56:59 -0400
+
+x11proto-fonts (2.0.2-3) unstable; urgency=low
+
+  * Upload to unstable
+
+ -- David Nusinow <dnusinow@debian.org>  Thu, 23 Mar 2006 21:36:04 -0500
+
+x11proto-fonts (2.0.2-2) experimental; urgency=low
+
+  * Add epoch to versioned Pre-Depends on x11-common to make upgrades
+    from monolithic x11-common work (Closes: #351779).
+
+ -- Michel Dänzer <daenzer@debian.org>  Thu,  9 Feb 2006 16:40:58 +0100
+
+x11proto-fonts (2.0.2-1) experimental; urgency=low
+
+  * First upload to Debian
+
+ -- David Nusinow <dnusinow@debian.org>  Fri, 30 Dec 2005 14:35:54 -0500
+
+x11proto-fonts (2.0-1) breezy; urgency=low
+
+  * First x11proto-fonts release.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com>  Mon, 16 May 2005 22:10:17 +1000
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100755 (executable)
index 0000000..b0dd421
--- /dev/null
@@ -0,0 +1,22 @@
+Source: x11proto-fonts
+Section: x11
+Priority: optional
+Maintainer: YoungHoon Jung <yhoon.jung@samsung.com>, SangJin Lee <lsj119@samsung.com>, Debian X Strike Force <debian-x@lists.debian.org>
+Uploaders: SooChan Lim <sc1.lim@samsung.com>, David Nusinow <dnusinow@debian.org>, Andres Salomon <dilinger@debian.org>, Julien Cristau <jcristau@debian.org>, YoungHoon Jung <yhoon.jung@samsung.com>
+Build-Depends: debhelper (>= 5.0.0), automake, xutils-dev (>= 1:7.3+4)
+Standards-Version: 3.8.3
+Vcs-Git: git://git.debian.org/git/pkg-xorg/proto/x11proto-fonts
+Vcs-Browser: http://git.debian.org/?p=pkg-xorg/proto/x11proto-fonts.git
+
+Package: x11proto-fonts-dev
+Architecture: all
+Depends: x11proto-core-dev, ${shlibs:Depends}, ${misc:Depends}
+Description: X11 font extension wire protocol
+ This package provides development headers describing the wire protocol
+ for font-related extensions, used to control the server-side font
+ configuration, and also the font server headers.
+ .
+ More information about X.Org can be found at:
+ <URL:http://www.X.org>
+ <URL:http://xorg.freedesktop.org>
+ <URL:http://lists.freedesktop.org/mailman/listinfo/xorg>
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..62928d6
--- /dev/null
@@ -0,0 +1,89 @@
+This package was downloaded from
+http://xorg.freedesktop.org/releases/individual/proto/
+
+Copyright 1990, 1991 Network Computing Devices;
+Portions Copyright 1987 by Digital Equipment Corporation
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee, provided
+that the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation, and that the names of Network Computing Devices or Digital
+not be used in advertising or publicity pertaining to distribution
+of the software without specific, written prior permission.
+Network Computing Devices and Digital make no representations
+about the suitability of this software for any purpose.  It is provided
+"as is" without express or implied warranty.
+
+NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES
+OR DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+THIS SOFTWARE.
+
+
+Copyright 1990, 1991, 1998  The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+
+Copyright (c) 1999  The XFree86 Project Inc.
+
+All Rights Reserved.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The XFree86 Project
+Inc. shall not be used in advertising or otherwise to promote the
+sale, use or other dealings in this Software without prior written
+authorization from The XFree86 Project Inc..
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..291f25b
--- /dev/null
@@ -0,0 +1,96 @@
+#!/usr/bin/make -f
+# debian/rules for the Debian x11proto-fonts-dev package.
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>
+# Copyright © 2005 Daniel Stone <daniel@fooishbar.org>
+# Copyright © 2005 David Nusinow <dnusinow@debian.org>
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+PACKAGE = x11proto-fonts-dev
+
+include debian/xsfbs/xsfbs.mk
+
+CFLAGS = -Wall -g
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+else
+       CFLAGS += -O2
+endif
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+       NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+       MAKEFLAGS += -j$(NUMJOBS)
+endif
+
+DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
+       confflags += --build=$(DEB_HOST_GNU_TYPE)
+else
+       confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
+#      confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
+endif
+
+
+build: build-stamp
+build-stamp:
+       dh_testdir
+       autoreconf -vfi
+       mkdir -p obj-$(DEB_BUILD_GNU_TYPE)
+       cd obj-$(DEB_BUILD_GNU_TYPE) && \
+       ../configure --prefix=/usr --mandir=\$${prefix}/share/man \
+                    --infodir=\$${prefix}/share/info --disable-shared \
+                    $(confflags) CFLAGS="$(CFLAGS)" 
+       cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
+       >$@
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp
+
+       rm -f config.cache config.log config.status config.guess config.sub
+       rm -f */config.cache */config.log */config.status */config.guess */config.sub
+       rm -f conftest* */conftest*
+       rm -rf autom4te.cache */autom4te.cache
+       rm -rf obj-*
+       rm -f aclocal.m4 configure install-sh missing mkinstalldirs
+       find -name Makefile.in -exec rm -f {} \;
+       #find -name Makefile.in -delete
+
+       dh_clean
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k
+       dh_installdirs
+
+       cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+# Build architecture-independent files here.
+binary-indep: build install
+       dh_testdir
+       dh_testroot
+
+#      dh_installdocs
+#      dh_installman
+       dh_install --sourcedir=debian/tmp --list-missing
+#      dh_installchangelogs
+       dh_link
+       dh_strip
+       dh_compress
+       dh_fixperms
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+# Build architecture-dependent files here.
+binary-arch: build install
+# Nothing to do
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
diff --git a/debian/watch b/debian/watch
new file mode 100644 (file)
index 0000000..d13d303
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/proto/ fontsproto-(.*)\.tar\.gz
diff --git a/debian/x11proto-fonts-dev.install b/debian/x11proto-fonts-dev.install
new file mode 100644 (file)
index 0000000..1ab921a
--- /dev/null
@@ -0,0 +1,2 @@
+usr/include/X11/fonts/*
+usr/lib/pkgconfig/fontsproto.pc
diff --git a/debian/xsfbs/repack.sh b/debian/xsfbs/repack.sh
new file mode 100644 (file)
index 0000000..5935cc9
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+set -e
+
+if ! [ -d debian/prune ]; then
+       exit 0
+fi
+
+if [ "x$1" != x--upstream-version ]; then
+       exit 1
+fi
+
+version="$2"
+filename="$3"
+
+if [ -z "$version" ] || ! [ -f "$filename" ]; then
+       exit 1
+fi
+
+dir="$(pwd)"
+tempdir="$(mktemp -d)"
+
+cd "$tempdir"
+tar xf "$dir/$filename"
+cat "$dir"/debian/prune/* | while read file; do rm -f */$file; done
+
+tar czf "$dir/$filename" *
+cd "$dir"
+rm -rf "$tempdir"
+echo "Done pruning upstream tarball"
+
+exit 0
diff --git a/debian/xsfbs/xsfbs.mk b/debian/xsfbs/xsfbs.mk
new file mode 100644 (file)
index 0000000..1f86848
--- /dev/null
@@ -0,0 +1,289 @@
+#!/usr/bin/make -f
+
+# Debian X Strike Force Build System (XSFBS): Make portion
+
+# Copyright 1996 Stephen Early
+# Copyright 1997 Mark Eichin
+# Copyright 1998-2005, 2007 Branden Robinson
+# Copyright 2005 David Nusinow
+#
+# Licensed under the GNU General Public License, version 2.  See the file
+# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
+
+# Originally by Stephen Early <sde1000@debian.org>
+# Modified by Mark W. Eichin <eichin@kitten.gen.ma.us>
+# Modified by Adam Heath <doogie@debian.org>
+# Modified by Branden Robinson <branden@debian.org>
+# Modified by Fabio Massimo Di Nitto <fabbione@fabbione.net>
+# Modified by David Nusinow <dnusinow@debian.org>
+# Acknowledgements to Manoj Srivastava.
+
+# Pass $(DH_OPTIONS) into the environment for debhelper's benefit.
+export DH_OPTIONS
+
+# force quilt to not use ~/.quiltrc and to use debian/patches
+QUILT = QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null
+
+# Set up parameters for the upstream build environment.
+
+# Determine (source) package name from Debian changelog.
+SOURCE_NAME:=$(shell dpkg-parsechangelog -ldebian/changelog \
+                        | grep '^Source:' | awk '{print $$2}')
+
+# Determine package version from Debian changelog.
+SOURCE_VERSION:=$(shell dpkg-parsechangelog -ldebian/changelog \
+                        | grep '^Version:' | awk '{print $$2}')
+
+# Determine upstream version number.
+UPSTREAM_VERSION:=$(shell echo $(SOURCE_VERSION) | sed 's/-.*//')
+
+# Determine the source version without the epoch for make-orig-tar-gz
+NO_EPOCH_VER:=$(shell echo $(UPSTREAM_VERSION) | sed 's/^.://')
+
+# Figure out who's building this package.
+BUILDER:=$(shell echo $${DEBEMAIL:-$${EMAIL:-$$(echo $$LOGNAME@$$(cat /etc/mailname 2>/dev/null))}})
+
+# Find out if this is an official build; an official build has nothing but
+# digits, dots, and/or the codename of a release in the Debian part of the
+# version number.  Anything else indicates an unofficial build.
+OFFICIAL_BUILD:=$(shell VERSION=$(SOURCE_VERSION); if ! expr "$$(echo $${VERSION\#\#*-} | sed 's/\(woody\|sarge\|etch\|lenny\)//g')" : ".*[^0-9.].*" >/dev/null 2>&1; then echo yes; fi)
+
+# Set up parameters for the Debian build environment.
+
+# Determine our architecture.
+BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+# Work around some old-time dpkg braindamage.
+BUILD_ARCH:=$(subst i486,i386,$(BUILD_ARCH))
+# The DEB_HOST_ARCH variable may be set per the Debian cross-compilation policy.
+ifdef DEB_HOST_ARCH
+ ARCH:=$(DEB_HOST_ARCH)
+else
+ # dpkg-cross sets the ARCH environment variable; if set, use it.
+ ifdef ARCH
+  ARCH:=$(ARCH)
+ else
+  ARCH:=$(BUILD_ARCH)
+ endif
+endif
+
+# $(STAMP_DIR) houses stamp files for complex targets.
+STAMP_DIR:=stampdir
+
+# $(DEBTREEDIR) is where all install rules are told (via $(DESTDIR)) to place
+# their files.
+DEBTREEDIR:=$(CURDIR)/debian/tmp
+
+# All "important" targets have four lines:
+#   1) A target name that is invoked by a package-building tool or the user.
+#      This consists of a dependency on a "$(STAMP_DIR)/"-prefixed counterpart.
+#   2) A line delcaring 1) as a phony target (".PHONY:").
+#   3) A "$(STAMP_DIR)/"-prefixed target which does the actual work, and may
+#   depend on other targets.
+#   4) A line declaring 3) as a member of the $(stampdir_targets) variable; the
+#   "$(STAMP_DIR)/" prefix is omitted.
+#
+# This indirection is needed so that the "stamp" files that signify when a rule
+# is done can be located in a separate "stampdir".  Recall that make has no way
+# to know when a goal has been met for a phony target (like "build" or
+# "install").
+#
+# At the end of each "$(STAMP_DIR)/" target, be sure to run the command ">$@"
+# so that the target will not be run again.  Removing the file will make Make
+# run the target over.
+
+# All phony targets should be declared as dependencies of .PHONY, even if they
+# do not have "($STAMP_DIR)/"-prefixed counterparts.
+
+# Define a harmless default rule to keep things from going nuts by accident.
+.PHONY: default
+default:
+
+# Set up the $(STAMP_DIR) directory.
+.PHONY: stampdir
+stampdir_targets+=stampdir
+stampdir: $(STAMP_DIR)/stampdir
+$(STAMP_DIR)/stampdir:
+       mkdir $(STAMP_DIR)
+       >$@
+
+# Set up the package build directory as quilt expects to find it.
+.PHONY: prepare
+stampdir_targets+=prepare
+prepare: $(STAMP_DIR)/prepare
+$(STAMP_DIR)/prepare: $(STAMP_DIR)/log $(STAMP_DIR)/genscripts
+       >$@
+
+.PHONY: log
+stampdir_targets+=log
+log: $(STAMP_DIR)/log
+$(STAMP_DIR)/log: $(STAMP_DIR)/stampdir
+       mkdir -p $(STAMP_DIR)/log
+
+# Apply all patches to the upstream source.
+.PHONY: patch
+stampdir_targets+=patch
+patch: $(STAMP_DIR)/patch
+$(STAMP_DIR)/patch: $(STAMP_DIR)/prepare
+       if ! [ `which quilt` ]; then \
+               echo "Couldn't find quilt. Please install it or add it to the build-depends for this package."; \
+               exit 1; \
+       fi; \
+       if $(QUILT) next >/dev/null 2>&1; then \
+         echo -n "Applying patches..."; \
+         if $(QUILT) push -a -v >$(STAMP_DIR)/log/patch 2>&1; then \
+           cat $(STAMP_DIR)/log/patch; \
+           echo "successful."; \
+         else \
+           cat $(STAMP_DIR)/log/patch; \
+           echo "failed! (check $(STAMP_DIR)/log/patch for details)"; \
+           exit 1; \
+         fi; \
+       else \
+         echo "No patches to apply"; \
+       fi; \
+       >$@
+
+# Revert all patches to the upstream source.
+.PHONY: unpatch
+unpatch: $(STAMP_DIR)/log
+       rm -f $(STAMP_DIR)/patch
+       @echo -n "Unapplying patches..."; \
+       if $(QUILT) applied >/dev/null 2>/dev/null; then \
+         if $(QUILT) pop -a -v >$(STAMP_DIR)/log/unpatch 2>&1; then \
+           cat $(STAMP_DIR)/log/unpatch; \
+           echo "successful."; \
+         else \
+           cat $(STAMP_DIR)/log/unpatch; \
+           echo "failed! (check $(STAMP_DIR)/log/unpatch for details)"; \
+           exit 1; \
+         fi; \
+       else \
+         echo "nothing to do."; \
+       fi
+
+# Clean the generated maintainer scripts.
+.PHONY: cleanscripts
+cleanscripts:
+       rm -f $(STAMP_DIR)/genscripts
+       rm -f debian/*.config \
+             debian/*.postinst \
+             debian/*.postrm \
+             debian/*.preinst \
+             debian/*.prerm
+
+# Clean the package build tree.
+.PHONY: xsfclean
+xsfclean: cleanscripts unpatch
+       dh_testdir
+       rm -rf .pc
+       rm -rf $(STAMP_DIR) $(SOURCE_DIR)
+       rm -rf imports
+       dh_clean debian/shlibs.local \
+                debian/po/pothead
+
+# Generate the debconf templates POT file header.
+debian/po/pothead: debian/po/pothead.in
+       sed -e 's/SOURCE_VERSION/$(SOURCE_VERSION)/' \
+         -e 's/DATE/$(shell date "+%F %X%z"/)' <$< >$@
+
+# Update POT and PO files.
+.PHONY: updatepo
+updatepo: debian/po/pothead
+       debian/scripts/debconf-updatepo --pot-header=pothead --verbose
+
+# Remove files from the upstream source tree that we don't need, or which have
+# licensing problems.  It must be run before creating the .orig.tar.gz.
+#
+# Note: This rule is for Debian package maintainers' convenience, and is not
+# needed for conventional build scenarios.
+.PHONY: prune-upstream-tree
+prune-upstream-tree:
+       # Ensure we're in the correct directory.
+       dh_testdir
+       grep -rvh '^#' debian/prune/ | xargs --no-run-if-empty rm -rf
+
+# Verify that there are no offsets or fuzz in the patches we apply.
+#
+# Note: This rule is for Debian package maintainers' convenience, and is not
+# needed for conventional build scenarios.
+.PHONY: patch-audit
+patch-audit: prepare unpatch
+       @echo -n "Auditing patches..."; \
+       >$(STAMP_DIR)/log/patch; \
+       FUZZY=; \
+       while [ -n "$$($(QUILT) next)" ]; do \
+         RESULT=$$($(QUILT) push -v | tee -a $(STAMP_DIR)/log/patch | grep ^Hunk | sed 's/^Hunk.*\(succeeded\|FAILED\).*/\1/');\
+         case "$$RESULT" in \
+           succeeded) \
+             echo "fuzzy patch: $$($(QUILT) top)" \
+               | tee -a $(STAMP_DIR)/log/$$($(QUILT) top); \
+             FUZZY=yes; \
+             ;; \
+           FAILED) \
+             echo "broken patch: $$($(QUILT) next)" \
+               | tee -a $(STAMP_DIR)/log/$$($(QUILT) next); \
+             exit 1; \
+             ;; \
+         esac; \
+       done; \
+       if [ -n "$$FUZZY" ]; then \
+         echo "there were fuzzy patches; please fix."; \
+         exit 1; \
+       else \
+         echo "done."; \
+       fi
+
+# Generate the maintainer scripts.
+.PHONY: genscripts
+stampdir_targets+=genscripts
+genscripts: $(STAMP_DIR)/genscripts
+$(STAMP_DIR)/genscripts: $(STAMP_DIR)/stampdir
+       for FILE in debian/*.config.in \
+                   debian/*.postinst.in \
+                   debian/*.postrm.in \
+                   debian/*.preinst.in \
+                   debian/*.prerm.in; do \
+         if [ -e "$$FILE" ]; then \
+           MAINTSCRIPT=$$(echo $$FILE | sed 's/.in$$//'); \
+           sed -n '1,/^#INCLUDE_SHELL_LIB#$$/p' <$$FILE \
+             | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >$$MAINTSCRIPT.tmp; \
+           cat debian/xsfbs/xsfbs.sh >>$$MAINTSCRIPT.tmp; \
+           sed -n '/^#INCLUDE_SHELL_LIB#$$/,$$p' <$$FILE \
+             | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >>$$MAINTSCRIPT.tmp; \
+           sed -e 's/@SOURCE_VERSION@/$(SOURCE_VERSION)/' \
+               -e 's/@OFFICIAL_BUILD@/$(OFFICIAL_BUILD)/' \
+               -e 's/@DEFAULT_DCRESOLUTIONS@/$(DEFAULT_DCRESOLUTIONS)/' \
+             <$$MAINTSCRIPT.tmp >$$MAINTSCRIPT; \
+           rm $$MAINTSCRIPT.tmp; \
+         fi; \
+       done
+       # Validate syntax of generated shell scripts.
+       #sh debian/scripts/validate-posix-sh debian/*.config \
+       #                                    debian/*.postinst \
+       #                                    debian/*.postrm \
+       #                                    debian/*.preinst \
+       #                                    debian/*.prerm
+       >$@
+
+SERVERMINVERS = $(shell cat /usr/share/xserver-xorg/serverminver 2>/dev/null)
+VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null)
+INPUTABI = $(shell cat /usr/share/xserver-xorg/inputabiver 2>/dev/null)
+SERVER_DEPENDS = xserver-xorg-core (>= $(SERVERMINVERS))
+VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI)
+INPDRIVER_PROVIDES = xserver-xorg-input-$(INPUTABI)
+ifeq ($(PACKAGE),)
+PACKAGE=$(shell awk '/^Package:/ { print $$2; exit }' < debian/control)
+endif
+
+.PHONY: serverabi
+serverabi: install
+ifeq ($(SERVERMINVERS),)
+       @echo error: xserver-xorg-dev needs to be installed
+       @exit 1
+else
+       echo "xserver:Depends=$(SERVER_DEPENDS)" >> debian/$(PACKAGE).substvars
+       echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
+       echo "xinpdriver:Provides=$(INPDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
+endif
+
+# vim:set noet ai sts=8 sw=8 tw=0:
diff --git a/debian/xsfbs/xsfbs.sh b/debian/xsfbs/xsfbs.sh
new file mode 100644 (file)
index 0000000..45acd59
--- /dev/null
@@ -0,0 +1,624 @@
+# $Id$
+
+# This is the X Strike Force shell library for X Window System package
+# maintainer scripts.  It serves to define shell functions commonly used by
+# such packages, and performs some error checking necessary for proper operation
+# of those functions.  By itself, it does not "do" much; the maintainer scripts
+# invoke the functions defined here to accomplish package installation and
+# removal tasks.
+
+# If you are reading this within a Debian package maintainer script (e.g.,
+# /var/lib/dpkg)info/PACKAGE.{config,preinst,postinst,prerm,postrm}), you can
+# skip past this library by scanning forward in this file to the string
+# "GOBSTOPPER".
+
+SOURCE_VERSION=@SOURCE_VERSION@
+OFFICIAL_BUILD=@OFFICIAL_BUILD@
+
+# Use special abnormal exit codes so that problems with this library are more
+# easily tracked down.
+SHELL_LIB_INTERNAL_ERROR=86
+SHELL_LIB_THROWN_ERROR=74
+SHELL_LIB_USAGE_ERROR=99
+
+# old -> new variable names
+if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then
+  DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE"
+fi
+if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then
+  DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF"
+fi
+
+# initial sanity checks
+if [ -z "$THIS_PACKAGE" ]; then
+  cat >&2 <<EOF
+Error: package maintainer script attempted to use shell library without
+definining \$THIS_PACKAGE shell variable.  Please report the package name,
+version, and the text of this error message to the Debian Bug Tracking System.
+Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
+instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
+"doc-debian" package, or install the "reportbug" package and use the command of
+the same name to file a report against version $SOURCE_VERSION of this package.
+EOF
+  exit $SHELL_LIB_USAGE_ERROR
+fi
+
+if [ -z "$THIS_SCRIPT" ]; then
+  cat >&2 <<EOF
+Error: package maintainer script attempted to use shell library without
+definining \$THIS_SCRIPT shell variable.  Please report the package name,
+version, and the text of this error message to the Debian Bug Tracking System.
+Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
+instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
+"doc-debian" package, or install the "reportbug" package and use the command of
+the same name to file a report against version $SOURCE_VERSION of the
+"$THIS_PACKAGE" package.
+EOF
+  exit $SHELL_LIB_USAGE_ERROR
+fi
+
+if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
+  RECONFIGURE="true"
+else
+  RECONFIGURE=
+fi
+
+if ([ "$1" = "install" ] || [ "$1" = "configure" ]) && [ -z "$2" ]; then
+  FIRSTINST="yes"
+fi
+
+if [ -z "$RECONFIGURE" ] && [ -z "$FIRSTINST" ]; then
+  UPGRADE="yes"
+fi
+
+trap "message;\
+      message \"Received signal.  Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\
+      message;\
+      exit 1" HUP INT QUIT TERM
+
+reject_nondigits () {
+  # syntax: reject_nondigits [ operand ... ]
+  #
+  # scan operands (typically shell variables whose values cannot be trusted) for
+  # characters other than decimal digits and barf if any are found
+  while [ -n "$1" ]; do
+    # does the operand contain anything but digits?
+    if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then
+      # can't use die(), because it wraps message() which wraps this function
+      echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \
+           "possibly malicious garbage \"$1\"" >&2
+      exit $SHELL_LIB_THROWN_ERROR
+    fi
+    shift
+  done
+}
+
+reject_unlikely_path_chars () {
+  # syntax: reject_unlikely_path_chars [ operand ... ]
+  #
+  # scan operands (typically shell variables whose values cannot be trusted) for
+  # characters unlikely to be seen in a path and which the shell might
+  # interpret and barf if any are found
+  while [ -n "$1" ]; do
+    # does the operand contain any funny characters?
+    if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then
+      # can't use die(), because I want to avoid forward references
+      echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \
+           "encountered possibly malicious garbage \"$1\"" >&2
+      exit $SHELL_LIB_THROWN_ERROR
+    fi
+    shift
+  done
+}
+
+# Query the terminal to establish a default number of columns to use for
+# displaying messages to the user.  This is used only as a fallback in the
+# event the COLUMNS variable is not set.  ($COLUMNS can react to SIGWINCH while
+# the script is running, and this cannot, only being calculated once.)
+DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
+if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
+  DEFCOLUMNS=80
+fi
+
+message () {
+  # pretty-print messages of arbitrary length
+  reject_nondigits "$COLUMNS"
+  echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2
+}
+
+observe () {
+  # syntax: observe message ...
+  #
+  # issue observational message suitable for logging someday when support for
+  # it exists in dpkg
+  if [ -n "$DEBUG_XORG_PACKAGE" ]; then
+    message "$THIS_PACKAGE $THIS_SCRIPT note: $*"
+  fi
+}
+
+warn () {
+  # syntax: warn message ...
+  #
+  # issue warning message suitable for logging someday when support for
+  # it exists in dpkg; also send to standard error
+  message "$THIS_PACKAGE $THIS_SCRIPT warning: $*"
+}
+
+die () {
+  # syntax: die message ...
+  #
+  # exit script with error message
+  message "$THIS_PACKAGE $THIS_SCRIPT error: $*"
+  exit $SHELL_LIB_THROWN_ERROR
+}
+
+internal_error () {
+  # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
+  message "internal error: $*"
+  if [ -n "$OFFICIAL_BUILD" ]; then
+    message "Please report a bug in the $THIS_SCRIPT script of the" \
+            "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
+            "Tracking System.  Include all messages above that mention the" \
+            "$THIS_PACKAGE package.  Visit " \
+            "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
+            "instructions, read the file" \
+            "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
+            "package, or install the reportbug package and use the command of" \
+            "the same name to file a report."
+  fi
+  exit $SHELL_LIB_INTERNAL_ERROR
+}
+
+usage_error () {
+  message "usage error: $*"
+  message "Please report a bug in the $THIS_SCRIPT script of the" \
+          "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
+          "Tracking System.  Include all messages above that mention the" \
+          "$THIS_PACKAGE package.  Visit " \
+          "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
+          "instructions, read the file" \
+          "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
+          "package, or install the reportbug package and use the command of" \
+          "the same name to file a report."
+  exit $SHELL_LIB_USAGE_ERROR
+}
+
+font_update () {
+  # run $UPDATECMDS in $FONTDIRS
+
+  local dir cmd shortcmd x_font_dir_prefix
+
+  x_font_dir_prefix="/usr/share/fonts/X11"
+
+  if [ -z "$UPDATECMDS" ]; then
+    usage_error "font_update() called but \$UPDATECMDS not set"
+  fi
+  if [ -z "$FONTDIRS" ]; then
+    usage_error "font_update() called but \$FONTDIRS not set"
+  fi
+
+  reject_unlikely_path_chars "$UPDATECMDS"
+  reject_unlikely_path_chars "$FONTDIRS"
+
+  for dir in $FONTDIRS; do
+    if [ -d "$x_font_dir_prefix/$dir" ]; then
+      for cmd in $UPDATECMDS; do
+        if which "$cmd" > /dev/null 2>&1; then
+          shortcmd=${cmd##*/}
+          observe "running $shortcmd in $dir font directory"
+         cmd_opts=
+          if [ "$shortcmd" = "update-fonts-alias" ]; then
+            cmd_opts=--x11r7-layout
+          fi
+          if [ "$shortcmd" = "update-fonts-dir" ]; then
+            cmd_opts=--x11r7-layout
+          fi
+          if [ "$shortcmd" = "update-fonts-scale" ]; then
+            cmd_opts=--x11r7-layout
+          fi
+          $cmd $cmd_opts $dir || warn "$cmd $cmd_opts $dir" \
+                              "failed; font directory data may not" \
+                              "be up to date"
+        else
+          warn "$cmd not found; not updating corresponding $dir font" \
+               "directory data"
+        fi
+      done
+    else
+      warn "$dir is not a directory; not updating font directory data"
+    fi
+  done
+}
+
+remove_conffile_prepare () {
+  # syntax: remove_conffile_prepare filename official_md5sum ...
+  #
+  # Check a conffile "filename" against a list of canonical MD5 checksums.
+  # If the file's current MD5 checksum matches one of the "official_md5sum"
+  # operands provided, then prepare the conffile for removal from the system.
+  # We defer actual deletion until the package is configured so that we can
+  # roll this operation back if package installation fails.
+  #
+  # Call this function from a preinst script in the event $1 is "upgrade" or
+  # "install" and verify $2 to ensure the package is being upgraded from a
+  # version (or installed over a version removed-but-not-purged) prior to the
+  # one in which the conffile was obsoleted.
+
+  local conffile current_checksum
+
+  # validate arguments
+  if [ $# -lt 2 ]; then
+    usage_error "remove_conffile_prepare() called with wrong number of" \
+                "arguments; expected at least 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+  shift
+
+  # does the conffile even exist?
+  if [ -e "$conffile" ]; then
+    # calculate its checksum
+    current_checksum=$(md5sum < "$conffile" | sed 's/[[:space:]].*//')
+    # compare it to each supplied checksum
+    while [ -n "$1" ]; do
+      if [ "$current_checksum" = "$1" ]; then
+        # we found a match; move the confffile and stop looking
+        observe "preparing obsolete conffile $conffile for removal"
+        mv "$conffile" "$conffile.$THIS_PACKAGE-tmp"
+        break
+      fi
+      shift
+    done
+  fi
+}
+
+remove_conffile_lookup () {
+  # syntax: remove_conffile_lookup package filename
+  #
+  # Lookup the md5sum of a conffile in dpkg's database, and prepare for removal
+  # if it matches the actual file's md5sum.
+  #
+  # Call this function when you would call remove_conffile_prepare but only
+  # want to check against dpkg's status database instead of known checksums.
+
+  local package conffile old_md5sum
+
+  # validate arguments
+  if [ $# -ne 2 ]; then
+    usage_error "remove_conffile_lookup() called with wrong number of" \
+                "arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  package="$1"
+  conffile="$2"
+
+  if ! [ -e "$conffile" ]; then
+    return
+  fi
+  old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$package" | \
+    awk '{ if (match($0, "^ '"$conffile"' ")) print $2}')"
+  if [ -n "$old_md5sum" ]; then
+    remove_conffile_prepare "$conffile" "$old_md5sum"
+  fi
+}
+
+remove_conffile_commit () {
+  # syntax: remove_conffile_commit filename
+  #
+  # Complete the removal of a conffile "filename" that has become obsolete.
+  #
+  # Call this function from a postinst script after having used
+  # remove_conffile_prepare() in the preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 1 ]; then
+    usage_error "remove_conffile_commit() called with wrong number of" \
+                "arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+
+  # if the temporary file created by remove_conffile_prepare() exists, remove it
+  if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
+    observe "committing removal of obsolete conffile $conffile"
+    rm "$conffile.$THIS_PACKAGE-tmp"
+  fi
+}
+
+remove_conffile_rollback () {
+  # syntax: remove_conffile_rollback filename
+  #
+  # Roll back the removal of a conffile "filename".
+  #
+  # Call this function from a postrm script in the event $1 is "abort-upgrade"
+  # or "abort-install" is  after having used remove_conffile_prepare() in the
+  # preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 1 ]; then
+    usage_error "remove_conffile_rollback() called with wrong number of" \
+                "arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+
+  # if the temporary file created by remove_conffile_prepare() exists, move it
+  # back
+  if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
+    observe "rolling back removal of obsolete conffile $conffile"
+    mv "$conffile.$THIS_PACKAGE-tmp" "$conffile"
+  fi
+}
+
+replace_conffile_with_symlink_prepare () {
+  # syntax: replace_conffile_with_symlink_prepare oldfilename newfilename \
+  # official_md5sum ...
+  #
+  # Check a conffile "oldfilename" against a list of canonical MD5 checksums.
+  # If the file's current MD5 checksum matches one of the "official_md5sum"
+  # operands provided, then prepare the conffile for removal from the system.
+  # We defer actual deletion until the package is configured so that we can
+  # roll this operation back if package installation fails. Otherwise copy it
+  # to newfilename and let dpkg handle it through conffiles mechanism.
+  #
+  # Call this function from a preinst script in the event $1 is "upgrade" or
+  # "install" and verify $2 to ensure the package is being upgraded from a
+  # version (or installed over a version removed-but-not-purged) prior to the
+  # one in which the conffile was obsoleted.
+
+  local conffile current_checksum
+
+  # validate arguments
+  if [ $# -lt 3 ]; then
+    usage_error "replace_conffile_with_symlink_prepare() called with wrong" \
+                " number of arguments; expected at least 3, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  oldconffile="$1"
+  shift
+  newconffile="$1"
+  shift
+
+  remove_conffile_prepare "$_oldconffile" "$@"
+  # If $oldconffile still exists, then md5sums didn't match.
+  # Copy it to new one.
+  if [ -f "$oldconffile" ]; then
+    cp "$oldconffile" "$newconffile"
+  fi
+
+}
+
+replace_conffile_with_symlink_commit () {
+  # syntax: replace_conffile_with_symlink_commit oldfilename
+  #
+  # Complete the removal of a conffile "oldfilename" that has been
+  # replaced by a symlink.
+  #
+  # Call this function from a postinst script after having used
+  # replace_conffile_with_symlink_prepare() in the preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 1 ]; then
+    usage_error "replace_conffile_with_symlink_commit() called with wrong" \
+                "number of arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+
+  remove_conffile_commit "$conffile"
+}
+
+replace_conffile_with_symlink_rollback () {
+  # syntax: replace_conffile_with_symlink_rollback oldfilename newfilename
+  #
+  # Roll back the replacing of a conffile "oldfilename" with symlink to
+  # "newfilename".
+  #
+  # Call this function from a postrm script in the event $1 is "abort-upgrade"
+  # or "abort-install" and verify $2 to ensure the package failed to upgrade
+  # from a version (or install over a version removed-but-not-purged) prior
+  # to the one in which the conffile was obsoleted.
+  # You should have  used replace_conffile_with_symlink_prepare() in the
+  # preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 2 ]; then
+    usage_error "replace_conffile_with_symlink_rollback() called with wrong" \
+                "number of arguments; expected 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  oldconffile="$1"
+  newconffile="$2"
+
+  remove_conffile_rollback "$_oldconffile"
+  if [ -f "$newconffile" ]; then
+    rm "$newconffile"
+  fi
+}
+
+run () {
+  # syntax: run command [ argument ... ]
+  #
+  # Run specified command with optional arguments and report its exit status.
+  # Useful for commands whose exit status may be nonzero, but still acceptable,
+  # or commands whose failure is not fatal to us.
+  #
+  # NOTE: Do *not* use this function with db_get or db_metaget commands; in
+  # those cases the return value of the debconf command *must* be checked
+  # before the string returned by debconf is used for anything.
+
+  local retval
+
+  # validate arguments
+  if [ $# -lt 1 ]; then
+    usage_error "run() called with wrong number of arguments; expected at" \
+                "least 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  "$@" || retval=$?
+
+  if [ ${retval:-0} -ne 0 ]; then
+    observe "command \"$*\" exited with status $retval"
+  fi
+}
+
+make_symlink_sane () {
+  # syntax: make_symlink_sane symlink target
+  #
+  # Ensure that the symbolic link symlink exists, and points to target.
+  #
+  # If symlink does not exist, create it and point it at target.
+  #
+  # If symlink exists but is not a symbolic link, back it up.
+  #
+  # If symlink exists, is a symbolic link, but points to the wrong location, fix
+  # it.
+  #
+  # If symlink exists, is a symbolic link, and already points to target, do
+  # nothing.
+  #
+  # This function wouldn't be needed if ln had an -I, --idempotent option.
+
+  # Validate arguments.
+  if [ $# -ne 2 ]; then
+    usage_error "make_symlink_sane() called with wrong number of arguments;" \
+      "expected 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  # We could just use the positional parameters as-is, but that makes things
+  # harder to follow.
+  local symlink target
+
+  symlink="$1"
+  target="$2"
+
+  if [ -L "$symlink" ] && [ "$(readlink "$symlink")" = "$target" ]; then
+      observe "link from $symlink to $target already exists"
+  else
+    observe "creating symbolic link from $symlink to $target"
+    mkdir -p "${target%/*}" "${symlink%/*}"
+    ln -s -b -S ".dpkg-old" "$target" "$symlink"
+  fi
+}
+
+migrate_dir_to_symlink () {
+  # syntax: migrate_dir_to_symlink old_location new_location
+  #
+  # Per Debian Policy section 6.5.4, "A directory will never be replaced by a
+  # symbolic link to a directory or vice versa; instead, the existing state
+  # (symlink or not) will be left alone and dpkg will follow the symlink if
+  # there is one."
+  #
+  # We have to do it ourselves.
+  #
+  # This function moves the contents of old_location, a directory, into
+  # new_location, a directory, then makes old_location a symbolic link to
+  # new_location.
+  #
+  # old_location need not exist, but if it does, it must be a directory (or a
+  # symlink to a directory).  If it is not, it is backed up.  If new_location
+  # exists already and is not a directory, it is backed up.
+  #
+  # This function should be called from a package's preinst so that other
+  # packages unpacked after this one --- but before this package's postinst runs
+  # --- are unpacked into new_location even if their payloads contain
+  # old_location filespecs.
+
+  # Validate arguments.
+  if [ $# -ne 2 ]; then
+    usage_error "migrate_dir_to_symlink() called with wrong number of"
+                "arguments; expected 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  # We could just use the positional parameters as-is, but that makes things
+  # harder to follow.
+  local new old
+
+  old="$1"
+  new="$2"
+
+  # Is old location a symlink?
+  if [ -L "$old" ]; then
+    # Does it already point to new location?
+    if [ "$(readlink "$old")" = "$new" ]; then
+      # Nothing to do; migration has already been done.
+      observe "migration of $old to $new already done"
+      return 0
+    else
+      # Back it up.
+      warn "backing up symbolic link $old as $old.dpkg-old"
+      mv -b "$old" "$old.dpkg-old"
+    fi
+  fi
+
+  # Does old location exist, but is not a directory?
+  if [ -e "$old" ] && ! [ -d "$old" ]; then
+      # Back it up.
+      warn "backing up non-directory $old as $old.dpkg-old"
+      mv -b "$old" "$old.dpkg-old"
+  fi
+
+  observe "migrating $old to $new"
+
+  # Is new location a symlink?
+  if [ -L "$new" ]; then
+    # Does it point the wrong way, i.e., back to where we're migrating from?
+    if [ "$(readlink "$new")" = "$old" ]; then
+      # Get rid of it.
+      observe "removing symbolic link $new which points to $old"
+      rm "$new"
+    else
+      # Back it up.
+      warn "backing up symbolic link $new as $new.dpkg-old"
+      mv -b "$new" "$new.dpkg-old"
+    fi
+  fi
+
+  # Does new location exist, but is not a directory?
+  if [ -e "$new" ] && ! [ -d "$new" ]; then
+    warn "backing up non-directory $new as $new.dpkg-old"
+    mv -b "$new" "$new.dpkg-old"
+  fi
+
+  # Create new directory if it does not yet exist.
+  if ! [ -e "$new" ]; then
+    observe "creating $new"
+    mkdir -p "$new"
+  fi
+
+  # Copy files in old location to new location.  Back up any filenames that
+  # already exist in the new location with the extension ".dpkg-old".
+  observe "copying files from $old to $new"
+  if ! (cd "$old" && cp -a -b -S ".dpkg-old" . "$new"); then
+    die "error(s) encountered while copying files from $old to $new"
+  fi
+
+  # Remove files at old location.
+  observe "removing $old"
+  rm -r "$old"
+
+  # Create symlink from old location to new location.
+  make_symlink_sane "$old" "$new"
+}
+
+# vim:set ai et sw=2 ts=2 tw=80:
+
+# GOBSTOPPER: The X Strike Force shell library ends here.
diff --git a/font.h b/font.h
new file mode 100644 (file)
index 0000000..b71046b
--- /dev/null
+++ b/font.h
@@ -0,0 +1,166 @@
+/***********************************************************
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+#ifndef FONT_H
+#define FONT_H
+
+#ifndef BitmapFormatByteOrderMask
+#include       "fsmasks.h"
+#endif
+
+/* data structures */
+#ifndef _XTYPEDEF_FONTPTR
+typedef struct _Font *FontPtr;
+#define _XTYPEDEF_FONTPTR
+#endif
+
+typedef struct _FontInfo *FontInfoPtr;
+typedef struct _FontProp *FontPropPtr;
+typedef struct _ExtentInfo *ExtentInfoPtr;
+typedef struct _FontPathElement *FontPathElementPtr;
+
+#ifndef _XTYPEDEF_CHARINFOPTR
+typedef struct _CharInfo *CharInfoPtr;
+#define _XTYPEDEF_CHARINFOPTR
+#endif
+
+typedef struct _FontNames *FontNamesPtr;
+typedef struct _FontResolution *FontResolutionPtr;
+
+#define NullCharInfo   ((CharInfoPtr) 0)
+#define NullFont       ((FontPtr) 0)
+#define NullFontInfo   ((FontInfoPtr) 0)
+
+ /* draw direction */
+#define LeftToRight 0
+#define RightToLeft 1
+#define BottomToTop 2
+#define TopToBottom 3
+typedef int DrawDirection;
+
+#define NO_SUCH_CHAR   -1
+
+
+#define        FontAliasType   0x1000
+
+#define        AllocError      80
+#define        StillWorking    81
+#define        FontNameAlias   82
+#define        BadFontName     83
+#define        Suspended       84
+#define        Successful      85
+#define        BadFontPath     86
+#define        BadCharRange    87
+#define        BadFontFormat   88
+#define        FPEResetFailed  89      /* for when an FPE reset won't work */
+
+/* OpenFont flags */
+#define FontLoadInfo   0x0001
+#define FontLoadProps  0x0002
+#define FontLoadMetrics        0x0004
+#define FontLoadBitmaps        0x0008
+#define FontLoadAll    0x000f
+#define        FontOpenSync    0x0010
+#define FontReopen     0x0020
+
+/* Query flags */
+#define        LoadAll         0x1
+#define        FinishRamge     0x2
+#define       EightBitFont    0x4
+#define       SixteenBitFont  0x8
+
+/* Glyph Caching Modes */
+#define CACHING_OFF 0
+#define CACHE_16_BIT_GLYPHS 1
+#define CACHE_ALL_GLYPHS 2
+#define DEFAULT_GLYPH_CACHING_MODE CACHE_16_BIT_GLYPHS
+extern int glyphCachingMode;
+
+struct _Client;
+
+extern int StartListFontsWithInfo(
+    struct _Client * /*client*/,
+    int /*length*/,
+    unsigned char * /*pattern*/,
+    int /*max_names*/
+);
+
+extern FontNamesPtr MakeFontNamesRecord(
+    unsigned /* size */
+);
+
+extern void FreeFontNames(
+    FontNamesPtr /* pFN*/
+);
+
+extern int  AddFontNamesName(
+    FontNamesPtr /* names */,
+    char * /* name */,
+    int /* length */
+);
+
+#if 0 /* unused */
+extern int  FontToFSError();
+extern FontResolutionPtr GetClientResolution();
+#endif
+
+typedef struct _FontPatternCache    *FontPatternCachePtr;
+
+extern FontPatternCachePtr  MakeFontPatternCache (
+    void
+);
+
+extern void                FreeFontPatternCache (
+    FontPatternCachePtr /* cache */
+);
+
+extern void                EmptyFontPatternCache (
+    FontPatternCachePtr /* cache */
+);
+
+extern void                CacheFontPattern (
+    FontPatternCachePtr /* cache */,
+    char * /* pattern */,
+    int /* patlen */,
+    FontPtr /* pFont */
+);
+extern FontResolutionPtr GetClientResolutions(
+    int * /* num */
+);
+
+extern FontPtr             FindCachedFontPattern (
+    FontPatternCachePtr /* cache */,
+    char * /* pattern */,
+    int /* patlen */
+);
+
+extern void                RemoveCachedFontPattern (
+    FontPatternCachePtr /* cache */,
+    FontPtr /* pFont */
+);
+
+typedef enum {
+    Linear8Bit, TwoD8Bit, Linear16Bit, TwoD16Bit
+}           FontEncoding;
+
+#endif                         /* FONT_H */
diff --git a/fontproto.h b/fontproto.h
new file mode 100644 (file)
index 0000000..1ab8f37
--- /dev/null
@@ -0,0 +1,91 @@
+/***********************************************************
+
+Copyright (c) 1999  The XFree86 Project Inc.
+
+All Rights Reserved.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The XFree86 Project
+Inc. shall not be used in advertising or otherwise to promote the
+sale, use or other dealings in this Software without prior written
+authorization from The XFree86 Project Inc..
+
+*/
+#ifndef _FONTPROTO_H
+#define _FONTPROTO_H
+
+/* Externally provided functions required by libXfont */
+
+extern int RegisterFPEFunctions ( NameCheckFunc name_func, 
+                                 InitFpeFunc init_func, 
+                                 FreeFpeFunc free_func, 
+                                 ResetFpeFunc reset_func, 
+                                 OpenFontFunc open_func, 
+                                 CloseFontFunc close_func, 
+                                 ListFontsFunc list_func, 
+                                 StartLfwiFunc start_lfwi_func, 
+                                 NextLfwiFunc next_lfwi_func, 
+                                 WakeupFpeFunc wakeup_func, 
+                                 ClientDiedFunc client_died, 
+                                 LoadGlyphsFunc load_glyphs, 
+                                 StartLaFunc start_list_alias_func, 
+                                 NextLaFunc next_list_alias_func, 
+                                 SetPathFunc set_path_func);
+
+extern int GetDefaultPointSize ( void );
+
+extern int init_fs_handlers ( FontPathElementPtr fpe, 
+                             BlockHandlerProcPtr block_handler);
+extern void remove_fs_handlers ( FontPathElementPtr fpe, 
+                                BlockHandlerProcPtr block_handler, 
+                                Bool all );
+
+extern int client_auth_generation ( ClientPtr client );
+
+#ifndef ___CLIENTSIGNAL_DEFINED___
+#define ___CLIENTSIGNAL_DEFINED___
+extern Bool ClientSignal ( ClientPtr client );
+#endif /* ___CLIENTSIGNAL_DEFINED___ */
+
+extern void DeleteFontClientID ( Font id );
+extern Font GetNewFontClientID ( void );
+extern int StoreFontClientFont ( FontPtr pfont, Font id );
+extern void FontFileRegisterFpeFunctions ( void );
+extern void FontFileCheckRegisterFpeFunctions ( void );
+
+extern Bool XpClientIsBitmapClient ( ClientPtr client );
+extern Bool XpClientIsPrintClient( ClientPtr client, FontPathElementPtr fpe );
+extern void PrinterFontRegisterFpeFunctions ( void );
+
+extern void fs_register_fpe_functions ( void );
+extern void check_fs_register_fpe_functions ( void );
+
+/* util/private.c */
+extern FontPtr  CreateFontRec (void);
+extern void  DestroyFontRec (FontPtr font);
+extern Bool     _FontSetNewPrivate (FontPtr        /* pFont */,
+                                   int            /* n */,
+                                   pointer        /* ptr */);
+extern int      AllocateFontPrivateIndex (void);
+extern void ResetFontPrivateIndex (void);
+
+/* Type1/t1funcs.c */
+extern void Type1RegisterFontFileFunctions(void);
+extern void CIDRegisterFontFileFunctions(void);
+
+/* Speedo/spfuncs.c */
+extern void SpeedoRegisterFontFileFunctions(void);
+
+/* FreeType/ftfuncs.c */
+extern void FreeTypeRegisterFontFileFunctions(void);
+
+#endif
diff --git a/fontsproto.pc.in b/fontsproto.pc.in
new file mode 100644 (file)
index 0000000..b7db169
--- /dev/null
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+Name: FontsProto
+Description: Fonts extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/fontstruct.h b/fontstruct.h
new file mode 100644 (file)
index 0000000..97e771a
--- /dev/null
@@ -0,0 +1,293 @@
+/***********************************************************
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+#ifndef FONTSTR_H
+#define FONTSTR_H
+
+#include <X11/Xproto.h>
+#include "font.h"
+#include <X11/Xfuncproto.h>
+#include <X11/Xdefs.h>
+
+/*
+ * This version of the server font data strucutre is only for describing
+ * the in memory data structure. The file structure is not necessarily a
+ * copy of this. That is up to the compiler and the OS layer font loading
+ * machinery.
+ */
+
+#define GLYPHPADOPTIONS 4      /* 1, 2, 4, or 8 */
+
+typedef struct _FontProp {
+    long        name;
+    long        value;         /* assumes ATOM is not larger than INT32 */
+}           FontPropRec;
+
+typedef struct _FontResolution {
+    unsigned short x_resolution;
+    unsigned short y_resolution;
+    unsigned short point_size;
+}           FontResolutionRec;
+
+typedef struct _ExtentInfo {
+    DrawDirection drawDirection;
+    int         fontAscent;
+    int         fontDescent;
+    int         overallAscent;
+    int         overallDescent;
+    int         overallWidth;
+    int         overallLeft;
+    int         overallRight;
+}           ExtentInfoRec;
+
+typedef struct _CharInfo {
+    xCharInfo   metrics;       /* info preformatted for Queries */
+    char       *bits;          /* pointer to glyph image */
+}           CharInfoRec;
+
+/*
+ * Font is created at font load time. It is specific to a single encoding.
+ * e.g. not all of the glyphs in a font may be part of a single encoding.
+ */
+
+typedef struct _FontInfo {
+    unsigned short firstCol;
+    unsigned short lastCol;
+    unsigned short firstRow;
+    unsigned short lastRow;
+    unsigned short defaultCh;
+    unsigned int noOverlap:1;
+    unsigned int terminalFont:1;
+    unsigned int constantMetrics:1;
+    unsigned int constantWidth:1;
+    unsigned int inkInside:1;
+    unsigned int inkMetrics:1;
+    unsigned int allExist:1;
+    unsigned int drawDirection:2;
+    unsigned int cachable:1;
+    unsigned int anamorphic:1;
+    short       maxOverlap;
+    short       pad;
+    xCharInfo   maxbounds;
+    xCharInfo   minbounds;
+    xCharInfo   ink_maxbounds;
+    xCharInfo   ink_minbounds;
+    short       fontAscent;
+    short       fontDescent;
+    int         nprops;
+    FontPropPtr props;
+    char       *isStringProp;
+}           FontInfoRec;
+
+typedef struct _Font {
+    int         refcnt;
+    FontInfoRec info;
+    char        bit;
+    char        byte;
+    char        glyph;
+    char        scan;
+    fsBitmapFormat format;
+    int         (*get_glyphs) (FontPtr         /* font */,
+                              unsigned long   /* count */,
+                              unsigned char * /* chars */,
+                              FontEncoding    /* encoding */,
+                              unsigned long * /* count */,
+                              CharInfoPtr *   /* glyphs */);
+    int         (*get_metrics) (FontPtr         /* font */,
+                               unsigned long   /* count */,
+                               unsigned char * /* chars */,
+                               FontEncoding    /* encoding */,
+                               unsigned long * /* count */,
+                               xCharInfo **    /* glyphs */);
+    void        (*unload_font) (FontPtr         /* font */);
+    void        (*unload_glyphs) (FontPtr         /* font */);
+    FontPathElementPtr fpe;
+    pointer     svrPrivate;
+    pointer     fontPrivate;
+    pointer     fpePrivate;
+    int                maxPrivate;
+    pointer    *devPrivates;
+}           FontRec;
+
+#define FontGetPrivate(pFont,n) ((n) > (pFont)->maxPrivate ? (pointer) 0 : \
+                            (pFont)->devPrivates[n])
+
+#define FontSetPrivate(pFont,n,ptr) ((n) > (pFont)->maxPrivate ? \
+                       _FontSetNewPrivate (pFont, n, ptr) : \
+                       ((((pFont)->devPrivates[n] = (ptr)) != 0) || TRUE))
+
+typedef struct _FontNames {
+    int         nnames;
+    int         size;
+    int        *length;
+    char      **names;
+}           FontNamesRec;
+
+/* External view of font paths */
+typedef struct _FontPathElement {
+    int         name_length;
+    char       *name;
+    int         type;
+    int         refcount;
+    pointer     private;
+}           FontPathElementRec;
+
+typedef Bool (*NameCheckFunc) (char *name);
+typedef int (*InitFpeFunc) (FontPathElementPtr fpe);
+typedef int (*FreeFpeFunc) (FontPathElementPtr fpe);
+typedef int (*ResetFpeFunc) (FontPathElementPtr fpe);
+typedef int (*OpenFontFunc) ( pointer client,
+                             FontPathElementPtr fpe,
+                             Mask flags,
+                             char* name,
+                             int namelen,
+                             fsBitmapFormat format,
+                             fsBitmapFormatMask fmask,
+                             XID id,
+                             FontPtr* pFont,
+                             char** aliasName,
+                             FontPtr non_cachable_font);
+typedef void (*CloseFontFunc) (FontPathElementPtr fpe, FontPtr pFont);
+typedef int (*ListFontsFunc) (pointer client,
+                             FontPathElementPtr fpe,
+                             char* pat,
+                             int len,
+                             int max,
+                             FontNamesPtr names);
+
+typedef int (*StartLfwiFunc) (pointer client,
+                             FontPathElementPtr fpe,
+                             char* pat,
+                             int len,
+                             int max,
+                             pointer* privatep);
+
+typedef int (*NextLfwiFunc) (pointer client,
+                            FontPathElementPtr fpe,
+                            char** name,
+                            int* namelen,
+                            FontInfoPtr* info,
+                            int* numFonts,
+                            pointer private);
+
+typedef int (*WakeupFpeFunc) (FontPathElementPtr fpe,
+                             unsigned long* LastSelectMask);
+
+typedef void (*ClientDiedFunc) (pointer client,
+                              FontPathElementPtr fpe);
+
+typedef int (*LoadGlyphsFunc) (pointer client,
+                              FontPtr pfont,
+                              Bool range_flag,
+                              unsigned int nchars,
+                              int item_size,
+                              unsigned char* data);
+
+typedef int (*StartLaFunc) (pointer client,
+                           FontPathElementPtr fpe,
+                           char* pat,
+                           int len,
+                           int max,
+                           pointer* privatep);
+
+typedef int (*NextLaFunc) (pointer client,
+                          FontPathElementPtr fpe,
+                          char** namep,
+                          int* namelenp,
+                          char** resolvedp,
+                          int* resolvedlenp,
+                          pointer private);
+
+typedef void (*SetPathFunc)(void);
+
+typedef struct _FPEFunctions {
+    NameCheckFunc       name_check;
+    InitFpeFunc        init_fpe;
+    ResetFpeFunc       reset_fpe;
+    FreeFpeFunc         free_fpe;
+    OpenFontFunc        open_font;
+    CloseFontFunc       close_font;
+    ListFontsFunc       list_fonts;
+    StartLaFunc         start_list_fonts_and_aliases;
+    NextLaFunc          list_next_font_or_alias;
+    StartLfwiFunc       start_list_fonts_with_info;
+    NextLfwiFunc        list_next_font_with_info;
+    WakeupFpeFunc       wakeup_fpe;
+    ClientDiedFunc     client_died;
+               /* for load_glyphs, range_flag = 0 ->
+                       nchars = # of characters in data
+                       item_size = bytes/char
+                       data = list of characters
+                  range_flag = 1 ->
+                       nchars = # of fsChar2b's in data
+                       item_size is ignored
+                       data = list of fsChar2b's */
+    LoadGlyphsFunc     load_glyphs;
+    SetPathFunc                set_path_hook;
+} FPEFunctionsRec, FPEFunctions;
+
+/*
+ * Various macros for computing values based on contents of
+ * the above structures
+ */
+
+#define        GLYPHWIDTHPIXELS(pci) \
+       ((pci)->metrics.rightSideBearing - (pci)->metrics.leftSideBearing)
+
+#define        GLYPHHEIGHTPIXELS(pci) \
+       ((pci)->metrics.ascent + (pci)->metrics.descent)
+
+#define        GLYPHWIDTHBYTES(pci)    (((GLYPHWIDTHPIXELS(pci))+7) >> 3)
+
+#define GLYPHWIDTHPADDED(bc)   (((bc)+7) & ~0x7)
+
+#define BYTES_PER_ROW(bits, nbytes) \
+       ((nbytes) == 1 ? (((bits)+7)>>3)        /* pad to 1 byte */ \
+       :(nbytes) == 2 ? ((((bits)+15)>>3)&~1)  /* pad to 2 bytes */ \
+       :(nbytes) == 4 ? ((((bits)+31)>>3)&~3)  /* pad to 4 bytes */ \
+       :(nbytes) == 8 ? ((((bits)+63)>>3)&~7)  /* pad to 8 bytes */ \
+       : 0)
+
+#define BYTES_FOR_GLYPH(ci,pad)        (GLYPHHEIGHTPIXELS(ci) * \
+                                BYTES_PER_ROW(GLYPHWIDTHPIXELS(ci),pad))
+/*
+ * Macros for computing different bounding boxes for fonts; from
+ * the font protocol
+ */
+
+#define FONT_MAX_ASCENT(pi)    ((pi)->fontAscent > (pi)->ink_maxbounds.ascent ? \
+                           (pi)->fontAscent : (pi)->ink_maxbounds.ascent)
+#define FONT_MAX_DESCENT(pi)   ((pi)->fontDescent > (pi)->ink_maxbounds.descent ? \
+                           (pi)->fontDescent : (pi)->ink_maxbounds.descent)
+#define FONT_MAX_HEIGHT(pi)    (FONT_MAX_ASCENT(pi) + FONT_MAX_DESCENT(pi))
+#define FONT_MIN_LEFT(pi)      ((pi)->ink_minbounds.leftSideBearing < 0 ? \
+                           (pi)->ink_minbounds.leftSideBearing : 0)
+#define FONT_MAX_RIGHT(pi)     ((pi)->ink_maxbounds.rightSideBearing > \
+                               (pi)->ink_maxbounds.characterWidth ? \
+                           (pi)->ink_maxbounds.rightSideBearing : \
+                               (pi)->ink_maxbounds.characterWidth)
+#define FONT_MAX_WIDTH(pi)     (FONT_MAX_RIGHT(pi) - FONT_MIN_LEFT(pi))
+
+#include "fontproto.h"
+
+#endif                         /* FONTSTR_H */
diff --git a/fsmasks.h b/fsmasks.h
new file mode 100644 (file)
index 0000000..c86be83
--- /dev/null
+++ b/fsmasks.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright 1990, 1991 Network Computing Devices;
+ * Portions Copyright 1987 by Digital Equipment Corporation 
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of Network Computing Devices or Digital
+ * not be used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission.
+ * Network Computing Devices and Digital make no representations 
+ * about the suitability of this software for any purpose.  It is provided 
+ * "as is" without express or implied warranty.
+ *
+ * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES
+ * OR DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+
+/*
+
+Portions Copyright 1987, 1994, 1998  The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+
+
+/*
+ * masks & values used by the font lib and the font server
+ */
+
+#ifndef _FSMASKS_H_
+#define _FSMASKS_H_
+
+#include <X11/Xmd.h>
+
+/* font format macros */
+#define BitmapFormatByteOrderMask       (1L << 0)
+#define BitmapFormatBitOrderMask        (1L << 1)
+#define BitmapFormatImageRectMask       (3L << 2)
+#define BitmapFormatScanlinePadMask     (3L << 8)
+#define BitmapFormatScanlineUnitMask    (3L << 12)
+
+#define BitmapFormatByteOrderLSB        (0)
+#define BitmapFormatByteOrderMSB        (1L << 0)
+#define BitmapFormatBitOrderLSB         (0)
+#define BitmapFormatBitOrderMSB         (1L << 1)
+
+#define BitmapFormatImageRectMin        (0L << 2)
+#define BitmapFormatImageRectMaxWidth   (1L << 2)
+#define BitmapFormatImageRectMax        (2L << 2)
+
+#define BitmapFormatScanlinePad8        (0L << 8)
+#define BitmapFormatScanlinePad16       (1L << 8)
+#define BitmapFormatScanlinePad32       (2L << 8)
+#define BitmapFormatScanlinePad64       (3L << 8)
+
+#define BitmapFormatScanlineUnit8       (0L << 12)
+#define BitmapFormatScanlineUnit16      (1L << 12)
+#define BitmapFormatScanlineUnit32      (2L << 12)
+#define BitmapFormatScanlineUnit64      (3L << 12)
+
+#define BitmapFormatMaskByte            (1L << 0)
+#define BitmapFormatMaskBit             (1L << 1)
+#define BitmapFormatMaskImageRectangle  (1L << 2)
+#define BitmapFormatMaskScanLinePad     (1L << 3)
+#define BitmapFormatMaskScanLineUnit    (1L << 4)
+
+typedef CARD32 fsBitmapFormat;
+typedef CARD32 fsBitmapFormatMask;
+
+#endif /* _FSMASKS_H_ */
diff --git a/packaging/xorg-x11-proto-fontsproto.spec b/packaging/xorg-x11-proto-fontsproto.spec
new file mode 100644 (file)
index 0000000..bf7340a
--- /dev/null
@@ -0,0 +1,53 @@
+Name:       xorg-x11-proto-fontsproto
+Summary:    X.Org X11 Protocol fontsproto
+Version:    2.1.1
+Release:    0 
+Group:      Development/System
+License:    MIT
+URL:        http://www.x.org
+Source0:    http://xorg.freedesktop.org/releases/individual/proto/fontsproto-%{version}.tar.gz
+Provides:   fontsproto
+BuildRequires: pkgconfig(xorg-macros)
+
+
+%description
+Description: %{summary}
+
+
+
+%prep
+%setup -q -n fontsproto-%{version}
+
+%build
+
+%reconfigure --disable-static \
+    --libdir=%{_datadir}
+
+# Call make instruction with smp support
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+
+%clean
+rm -rf %{buildroot}
+
+
+
+
+
+
+%files
+%defattr(-,root,root,-)
+%{_datadir}/pkgconfig/fontsproto.pc
+%{_includedir}/X11/fonts/fsmasks.h
+%{_includedir}/X11/fonts/FS.h
+%{_includedir}/X11/fonts/fontstruct.h
+%{_includedir}/X11/fonts/font.h
+%{_includedir}/X11/fonts/fontproto.h
+%{_includedir}/X11/fonts/FSproto.h
+/usr/share/doc/fontsproto/fsproto.xml
+
+
diff --git a/specs/Makefile.am b/specs/Makefile.am
new file mode 100755 (executable)
index 0000000..516ece0
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+
+if ENABLE_SPECS
+doc_sources = fsproto.xml
+dist_doc_DATA = $(doc_sources)
+
+if HAVE_XMLTO
+doc_DATA = $(doc_sources:.xml=.html)
+
+if HAVE_FOP
+doc_DATA += $(doc_sources:.xml=.ps) $(doc_sources:.xml=.pdf)
+endif
+
+if HAVE_XMLTO_TEXT
+doc_DATA += $(doc_sources:.xml=.txt)
+endif
+
+if HAVE_STYLESHEETS
+XMLTO_FLAGS = -m $(XSL_STYLESHEET)
+
+doc_DATA += xorg.css
+xorg.css: $(STYLESHEET_SRCDIR)/xorg.css
+       $(AM_V_GEN)cp -pf $(STYLESHEET_SRCDIR)/xorg.css $@
+endif
+
+CLEANFILES = $(doc_DATA)
+
+SUFFIXES = .xml .ps .pdf .txt .html
+
+.xml.txt:
+       $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) txt $<
+
+.xml.html:
+       $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) xhtml-nochunks $<
+
+.xml.pdf:
+       $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) --with-fop pdf $<
+
+.xml.ps:
+       $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) --with-fop ps $<
+
+endif HAVE_XMLTO
+endif ENABLE_SPECS
diff --git a/specs/fsproto.xml b/specs/fsproto.xml
new file mode 100755 (executable)
index 0000000..95530f1
--- /dev/null
@@ -0,0 +1,4084 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+
+
+<book id="fsproto">
+
+<bookinfo>
+   <title>The X Font Service Protocol</title>
+   <subtitle>X Window System Standard</subtitle>
+   <releaseinfo>Version 2.0</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Jim</firstname><surname>Fulton</surname>
+         <affiliation><orgname>
+Network Computing Devices, Inc.
+         </orgname></affiliation>
+      </author>
+   </authorgroup>
+   <corpname>X Consortium Standard</corpname>
+   <copyright><year>1991</year><holder>Network Computing Devices, Inc.</holder></copyright>
+   <copyright><year>1994</year><holder>X Consortium</holder></copyright>
+   <affiliation><orgname>X Consortium</orgname></affiliation>
+   <productnumber>X Version 11, Release 6.8</productnumber>
+   <edition>Revised May 2, 1994</edition>
+
+<legalnotice>
+
+<para>
+Permission to use, copy, modify, distribute, and sell this
+documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice and this permission
+notice appear in all copies.  Network Computing Devices, Inc.
+makes no representations about the suitability for any purpose
+of the information in this document.  This documentation is
+provided "as is" without express or implied warranty.
+</para>
+<para>
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+</para>
+<para>
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+</para>
+
+<para>
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+</para>
+
+<para>
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+</para>
+</legalnotice>
+</bookinfo>
+
+<chapter>
+<title>TITLE</title>
+<sect1 id="introduction">
+<title>Introduction</title>
+<para>
+The management of fonts in large, heterogeneous environments is one of the
+hardest aspects of using the X Window System
+<footnote><para>
+<emphasis remap='I'>X Window System</emphasis>
+is a trademark of The Open Group.
+</para></footnote>
+.  Multiple formats and the lack of
+a consistent mechanism for exporting font data to all displays on a network
+prevent the transparent use of applications across different display platforms.
+The X Font Service protocol is designed to address this and other issues, with
+specific emphasis on the needs of the core X protocol.  Upward-compatible
+changes (typically in the form of new requests) are expected as consensus is
+reached on new features (particularly outline font support).
+</para>
+<para>
+Currently, most X displays use network file protocols such as NFS and TFTP to
+obtain raw font data which they parse directly.  Since a common binary format
+for this data doesn't exist, displays must be able to interpret a variety of
+formats if they are to be used with different application hosts.  This leads to
+wasted code and data space and a loss of interoperability as displays are used
+in unforeseen environments.
+</para>
+<para>
+By moving the interpretation of font data out of the X server into a separate
+service on the network, these problems can be greatly reduced.  In addition,
+new technologies, such as dynamically generating bitmaps from scaled or outline
+fonts, can be provided to all displays transparently.  For horizontal text,
+caching techniques and increased processor power can potentially make
+rasterization more efficient on large, centralized hosts than on individual
+displays.
+</para>
+<para>
+Each font server provides sets of fonts that may be listed and queried for
+header, property, glyph extents, and bitmap information.  This data is
+transmitted over the network using a binary format (with variations to support
+different bit- and byte-orders) designed to minimize the amount of processing
+required by the display.  Since the font server, rather than the display, is
+responsible for parsing the raw font data, new formats can be used by all
+displays by modifying a single font server.
+</para>
+<para>
+From the user's point of view, font servers are simply a new type of name in
+the X font path.  Network name services allow descriptive names (such as
+DEPARTMENT-FONTS or APPLICATION-FONTS) to be translated into proper network
+addresses.  X displays send requests to and read replies from the font server
+rather than reading directly from files.  Since the X Font Service protocol is
+designed to allow subsets of the font data to be requested, displays may easily
+implement a variety of strategies for fine-grained demand-loading of glyphs.
+</para>
+</sect1>
+
+<sect1 id="architectural_model">
+<title>Architectural Model</title>
+<!-- .XS -->
+<!-- (SN Architectural Model -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+In this document, the words "client" and "server" refer to the consumer and
+provider of a font, respectively, unless otherwise indicated.  It is important
+to note that in this context, the X server is also a font client.
+</para>
+<para>
+The X Font Service protocol does not require any changes to the core X protocol
+or to any applications.  To the user, font servers are simply additional types
+of font path elements.  As such, X servers may connect to multiple font
+servers, as shown in Figure 2.1.  Although the font protocol is geared towards
+the X Window System, it may be also used by other consumers of font data (such
+as printer drivers).
+</para>
+
+<literallayout class="monospaced">
+ ┌────────┐              ┌───────────────┐
+ │   X1   ├──────────────┤               │
+ │ Server │              │  Font Server  │
+ └────────┘      ┌───────┤      1        │
+                 │       └───────────────┘
+ ┌────────┐      │
+ │   X2   ├──────┘       ┌───────────────┐
+ │ Server ├──────────────┤               │
+ └────────┘              │  Font Server  │
+                 ┌───────┤      2        │
+┌─────────┐      │       └───────────────┘
+│  other  │      │
+│ clients ├──────┘
+└─────────┘
+</literallayout>
+
+<para>
+Figure 2.1:  Connecting to a Font Server
+</para>
+
+<para>
+<!-- .LP  -->
+Clients communicate with the font server using the request/reply/event model
+over any mutually-understood virtual stream connection (such as TCP/IP, DECnet,
+<footnote><para>
+DECnet is a trademark of Digital Equipment Corporation.
+</para></footnote>
+etc.).  Font servers are responsible for providing data in the bit and byte
+orders requested by the client.  The set of requests and events provided in the
+first version of the X Font Service protocol is limited to supporting the needs
+of the bitmap-oriented core X Window System protocol.  Extensions are expected
+as new needs evolve.
+</para>
+<para>
+<!-- .LP -->
+A font server reads raw font data from a variety of sources (possibly
+including other font servers) and converts it into a common format that is
+transmitted to the client using the protocol described in Section 4.  New font
+formats are handled by adding new converters to a font server, as shown in
+Figure 2.2.
+</para>
+
+<literallayout class="monospaced">
+                ┌────────────┐
+                │   client   │
+                │ (X server) │
+                └─────┬──────┘
+                      │
+                   network
+                      │
+┌─────────────────────┴──────────────────────┐
+│                                            │
+│                font server 1               │
+│                                            │
+├─────┬─────┬─────┬─────┬────┬─────┬───┬─────┤
+│ bdf │ snf │ pcf │ atm │ f3 │ dwf │ │ │ ... │
+└─────┴─────┴─────┴─────┴────┴─────┴─│─┴─────┘
+                                     │
+                                  network
+                                     │
+                               ┌─────┴────┐
+                               │   font   │
+                               │ server 2 │
+                               └──────────┘
+</literallayout>
+
+<para>
+Figure 2.2:  Where Font Data Comes From
+</para>
+
+<para>
+The server may choose to provide named sets of fonts called "catalogues."
+Clients may specify which of the sets should be used in listing or opening a
+font.
+</para>
+
+<para>
+An event mechanism similar to that used in the X protocol is provided for
+asynchronous notification of clients by the server.
+</para>
+
+<para>
+<!-- .LP -->
+Clients may provide authorization data for the server to be used in determining
+(according to the server's licensing policy) whether or not access should be
+granted to particular fonts.  This is particularly useful for clients whose
+authorization changes over time (such as an X server that can verify the
+identity of the user).
+</para>
+<para>
+<!-- .LP -->
+Implementations that wish to provide additional requests or events may use the
+extension mechanism.  Adding to the core font service protocol (with the
+accompanying change in the major or minor version numbers) is reserved to the X
+Consortium.
+</para>
+</sect1>
+
+<sect1 id="font_server_naming">
+<title>Font Server Naming</title>
+<!-- .XS -->
+<!-- (SN Font Server Naming -->
+<!-- .XE -->
+<para>
+Font clients that expose font server names to the user are encouraged to
+provide ways of naming font servers symbolically (e.g. DEPARTMENT-FONTS).
+However, for environments that lack appropriate name services
+transport-specific names are necessary.  Since these names do occur in the
+protocol, clients and servers should support at least the applicable formats
+described below.  Formats for additional transports may be registered with the
+X Consortium.
+</para>
+
+<sect2 id="tcpip_names">
+<title>TCP/IP Names</title>
+<!-- .XS -->
+<!-- (SN TCP/IP Names -->
+<!-- .XE -->
+<para>
+The following syntax should be used for TCP/IP names:
+</para>
+
+<literallayout class="monospaced">
+    &lt;TCP name&gt;  ::=  "tcp/" &lt;hostname&gt;":" &lt;ipportnumber&gt; ["/" &lt;cataloguelist&gt;]
+</literallayout>
+
+<para>
+where &lt;hostname&gt; is either symbolic (such as expo.lcs.mit.edu) or numeric
+decimal (such as 18.30.0.212).  The &lt;ipportnumber&gt; is the port on
+which the
+font server is listening for connections.  The &lt;cataloguelist&gt; string at
+the end is optional and specifies a plus-separated list of catalogues
+that may be requested.  For example:
+</para>
+<literallayout class="monospaced">
+     tcp/expo.lcs.mit.edu:8012/available+special
+     tcp/18.30.0.212:7890
+</literallayout>
+</sect2>
+
+<sect2 id="decnet_names">
+<title>DECnet Names</title>
+<!-- .XS -->
+<!-- (SN DECnet Names -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The following syntax should be used for DECnet names:
+</para>
+<literallayout class="monospaced">
+    &lt;DECnet name&gt;  ::=  "decnet/" &lt;nodename&gt; "::font$" &lt;objname&gt;
+               ["/" &lt;cataloguelist&gt;]
+</literallayout>
+<para>
+where &lt;nodename&gt; is either symbolic (such as SRVNOD) or the
+numeric decimal
+form of the DECnet address (such as 44.70).  The &lt;objname&gt; is normal,
+case-insensitive DECnet object name.  The &lt;cataloguelist&gt; string
+at the end is
+optional and specifies a plus-separated list of catalogues that may be
+requested.  For example:
+</para>
+
+<literallayout class="monospaced">
+     DECNET/SRVNOD::FONT$DEFAULT/AVAILABLE
+     decnet/44.70::font$other
+</literallayout>
+</sect2>
+</sect1>
+
+<sect1 id="protocol">
+<title>Protocol</title>
+<!-- .XS -->
+<!-- (SN Protocol -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The protocol described below uses the request/reply/error model and is
+specified using the same conventions outlined in Section 2 of the core X Window
+System protocol [1]:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<!-- .IP \(bu 5 -->
+Data type names are spelled in upper case with no word separators,
+as in:  FONTID
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<!-- .IP \(bu 5 -->
+Alternate values are capitalized with no word separators,
+as in:  MaxWidth
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<!-- .IP \(bu 5 -->
+Structure element declarations are in lower case with hyphens
+as word separators, as in:  byte-order-msb
+    </para>
+    <note>
+      <para>
+Structure element names are referred to in
+upper case (e.g. BYTE-ORDER-MSB) when used in
+descriptions to set them off from the surrounding
+text.  When this document is typeset they will be
+printed in lower case in a distinct font.
+      </para>
+    </note>
+  </listitem>
+  <listitem>
+    <para>
+Type declarations have the form "name: type",
+as in:  CARD8: 8-bit byte
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Comma-separated lists of alternate values are enclosed in
+braces, as in:  { Min, MaxWidth, Max }
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Comma-separated lists of structure elements are enclosed in
+brackets, as in:  [ byte1: CARD8, byte2: CARD8 ]
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+<!-- .LP -->
+A type with a prefix "LISTof" represents a counted list of
+elements of that type, as in:  LISTofCARD8
+</para>
+
+<sect2 id="data_types">
+<title>Data Types</title>
+<!-- .XS -->
+<!-- (SN Data Types -->
+<!-- .XE -->
+<para>
+The following data types are used in the core X Font Server protocol:
+</para>
+
+<literallayout class="monospaced">
+ACCESSCONTEXT:     ID
+</literallayout>
+<blockquote>
+<para>
+This value is specified in the CreateAC request as the identifier
+to be used when referring to a particular AccessContext resource
+within the server.  These resources are used by the server to
+store client-specified authorization information.  This
+information may be used by the server to determine whether or not
+the client should be granted access to particular font data.
+</para>
+<para>
+<!-- .sp -->
+In order to preserve the integrity of font licensing being performed by
+the font server, care must be taken by a client to properly represent the
+identity of the true user of the font.  Some font clients will in fact
+be servers (for example, X servers) requesting fonts for their own clients.
+Other font clients may be doing work on behalf of a number of different
+users over time (for example, print spoolers).
+</para>
+<para>
+<!-- .sp -->
+<function>AccessContexts </function>
+must be created (with
+<function>CreateAC ) </function>
+and switched among (with
+<function>SetAuthorization )</function>
+to represent all of these "font users" properly.
+    </para>
+</blockquote>
+
+<literallayout class="monospaced">
+ALTERNATESERVER:  [ name:  STRING8,
+                    subset:  BOOL ]
+</literallayout>
+
+<blockquote>
+    <para>
+This structure specifies the NAME, encoded in ISO 8859-1 according
+to Section 3, of another font server that may be useful as a
+substitute for this font server.  The SUBSET field indicates
+whether or not the alternate server is likely to only contain a
+subset of the fonts available from this font server.  This
+information is returned during the initial connection setup and
+may be used by the client to find a backup server in case of
+failure.
+    </para>
+</blockquote>
+
+<literallayout class="monospaced">
+AUTH:  [ name:  STRING8,
+         data:  LISTofBYTE ]
+</literallayout>
+
+<blockquote>
+<para>
+This structure specifies the name of an authorization protocol and
+initial data for that protocol.  It is used in the authorization
+negotiation in the initial connection setup and in the CreateAC
+request.
+</para>
+</blockquote>
+
+<literallayout class="monospaced">
+BITMAPFORMAT:
+</literallayout>
+
+<literallayout class="monospaced">
+   CARD32 containing the following fields defined by the
+   sets of values given further below
+   [
+     byte-order-msb:      1 bit,
+     bit-order-msb:       1 bit,
+     image-rect:          2 bits { Min,
+                          MaxWidth,
+                          Max },
+     zero-pad:            4 bits,
+     scanline-pad:        2 bits { ScanlinePad8,
+                          ScanlinePad16,
+                          ScanlinePad32,
+                          ScanlinePad64 },
+     zero-pad:            2 bits,
+     scanline-unit:       2 bits { ScanlineUnit8,
+                          ScanlineUnit16,
+                          ScanlineUnit32,
+                          ScanlineUnit64 },
+     zero-pad:            2 bits,
+     zero-pad:            16 bits,
+   ]
+</literallayout>
+
+<blockquote>
+<para>
+This structure specifies how glyph images are transmitted in
+response to
+<function>QueryXBitmaps8 </function>
+and
+<function>QueryXBitmaps16 </function>
+requests.
+</para>
+<para>
+<!-- .sp -->
+If the BYTE-ORDER-MSB bit (1 &lt;&lt; 0) is set, the Most Significant
+Byte of each scanline unit is returned first.  Otherwise, the
+Least Significant Byte is returned first.
+</para>
+<para>
+<!-- .sp -->
+If the BIT-ORDER-MSB bit (1 &lt;&lt; 1) is set, the left-most bit in
+each glyph scanline unit is stored in the Most Significant Bit of
+each transmitted scanline unit.  Otherwise, the left-most bit is
+stored in the Least Significant Bit.
+</para>
+<para>
+<!-- .sp -->
+The IMAGE-RECT field specifies a rectangle of pixels within the
+glyph image.  It contains one of the following alternate values:
+</para>
+
+<literallayout class="monospaced">
+     ImageRectMin          (0 &lt;&lt; 2)
+     ImageRectMaxWidth     (1 &lt;&lt; 2)
+     ImageRectMax          (2 &lt;&lt; 2)
+</literallayout>
+<para>
+For a glyph with extents XCHARINFO in a font with header information
+XFONTINFO, the IMAGE-RECT values have the following meanings:
+</para>
+<para>
+<function>ImageRectMin -</function>
+This refers to the minimal bounding rectangle
+surrounding the inked pixels in the glyph.  This is the
+most compact representation.  The edges of the rectangle
+are:
+</para>
+<literallayout class="monospaced">
+         left:     XCHARINFO.LBEARING
+         right:    XCHARINFO.RBEARING
+         top:      XCHARINFO.ASCENT
+         bottom:   XCHARINFO.DESCENT
+</literallayout>
+<para>
+
+<function>ImageRectMaxWidth - </function>
+This refers to the scanlines between the
+glyph's ascent and descent, padded on the left to the minimum
+left-bearing (or 0, whichever is less) and on the right to
+the maximum right-bearing (or logical-width, whichever is
+greater).  All glyph images share a common horizontal
+origin.  This is a combination of ImageRectMax in the
+horizontal direction and ImageRectMin in the vertical
+direction.  The edges of the rectangle are:
+</para>
+
+<literallayout class="monospaced">
+left:         min (XFONTINFO.MIN-BOUNDS.LBEARING, 0)
+right:        max (XFONTINFO.MAX-BOUNDS.RBEARING,
+                   XFONTINFO.MAX-BOUNDS.WIDTH)
+top:               XCHARINFO.ASCENT
+bottom:            XCHARINFO.DESCENT
+</literallayout>
+
+<para>
+ImageRectMax - This refers to all scanlines, from the maximum
+ascent (or the font ascent, whichever is greater) to the
+maximum descent (or the font descent, whichever is greater),
+padded to the same horizontal extents as MaxWidth.
+All glyph images have the same sized bitmap and share a
+common origin.  This is the least compact representation,
+but may be the easiest or most efficient (particularly for
+character cell fonts) for some clients to use.  The edges of
+the rectangle are:
+</para>
+
+<literallayout class="monospaced">
+left:         min (XFONTINFO.MIN-BOUNDS.LBEARING, 0)
+right:        max (XFONTINFO.MAX-BOUNDS.RBEARING,
+                   XFONTINFO.MAX-BOUNDS.WIDTH)
+top:          max (XFONTINFO.FONT-ASCENT,
+                   XFONTINFO.MAX-BOUNDS.ASCENT)
+bottom:       max (XFONTINFO.FONT-DESCENT,
+                   XFONTINFO.MAX-BOUNDS.DESCENT)
+</literallayout>
+<para>
+The SCANLINE-PAD field specifies the number of bits (8, 16, 32,
+or 64) to which each glyph scanline is padded before transmitting.
+It contains one of the following alternate values:
+</para>
+<literallayout class="monospaced">
+     ScanlinePad8          (0 &lt;&lt; 8)
+     ScanlinePad16         (1 &lt;&lt; 8)
+     ScanlinePad32         (2 &lt;&lt; 8)
+     ScanlinePad64         (3 &lt;&lt; 8)
+</literallayout>
+<para>
+The SCANLINE-UNIT field specifies the number of bits (8, 16, 32,
+or 64) that should be treated as a unit for swapping.  This value
+must be less than or equal to the number of bits specified by the
+SCANLINE-PAD.  It contains one of the following alternate values:
+</para>
+
+<literallayout class="monospaced">
+     ScanlineUnit8          (0 &lt;&lt; 12)
+     ScanlineUnit16         (1 &lt;&lt; 12)
+     ScanlineUnit32         (2 &lt;&lt; 12)
+     ScanlineUnit64         (3 &lt;&lt; 12)
+</literallayout>
+<para>
+BITMAPFORMATs are byte-swapped as CARD32s.  All unspecified bits
+must be zero.
+</para>
+<para>
+Use of an invalid BITMAPFORMAT causes a Format error to
+be returned.
+</para>
+</blockquote>
+<para>
+BITMAPFORMATMASK:     CARD32 mask
+</para>
+<blockquote>
+<para>
+This is a mask of bits representing the fields in a BITMAPFORMAT:
+</para>
+</blockquote>
+<literallayout class="monospaced">
+     ByteOrderMask          (1 &lt;&lt; 0)
+     BitOrderMask           (1 &lt;&lt; 1)
+     ImageRectMask          (1 &lt;&lt; 2)
+     ScanlinePadMask        (1 &lt;&lt; 3)
+     ScanlineUnitMask       (1 &lt;&lt; 4)
+</literallayout>
+<para>
+Unspecified bits are required to be zero or else a Format error
+is returned.
+</para>
+<para>
+BOOL:  CARD8
+</para>
+<blockquote>
+<para>
+This is a boolean value containing one of the following alternate
+values:
+</para>
+
+<literallayout class="monospaced">
+     False              0
+     True               1
+</literallayout>
+</blockquote>
+
+<para>
+BYTE:  8-bit value
+</para>
+
+<blockquote>
+<para>
+This is an unsigned byte of data whose encoding
+is determined by the context in which it is used.
+</para>
+</blockquote>
+
+<para>
+CARD8:  8-bit unsigned integer
+</para>
+
+<para>
+CARD16:  16-bit unsigned integer
+</para>
+
+<para>
+CARD32:  32-bit unsigned integer
+</para>
+
+<blockquote>
+<para>
+These are unsigned numbers.  The latter two are byte-swapped when
+the server and client have different byte orders.
+</para>
+</blockquote>
+
+<para>
+CHAR2B:  [ byte1, byte2:  CARD8 ]
+</para>
+<blockquote>
+<para>
+This structure specifies an individual character code within
+either a 2-dimensional matrix (using BYTE1 and BYTE2 as the row
+and column indices, respectively) or a vector (using BYTE1 and
+BYTE2 as most- and least-significant bytes, respectively).  This
+data type is treated as a pair of 8-bit values and is never
+byte-swapped.  Therefore, the client should always transmit BYTE1
+first.
+</para>
+</blockquote>
+
+<para>
+EVENTMASK:  CARD32 mask
+</para>
+
+<blockquote>
+<para>
+This is a mask of bits indicating which of an extension's (or the
+core's) maskable events the client would like to receive.  Each
+bit indicates one or more events, and a bit value of one indicates
+interest in a corresponding set of events.  The following bits are
+defined for event masks specified for the core protocol (i.e. an
+EXTENSION-OPCODE of zero in
+<function>SetEventMask </function>
+and
+<function>GetEventMask </function>
+requests):
+</para>
+
+<literallayout class="monospaced">
+     CatalogueListChangeMask          (1 &lt;&lt; 0)
+     FontListChangeMask               (1 &lt;&lt; 1)
+</literallayout>
+
+<para>
+If
+<function>CatalogueListChangeMask </function>
+is set, client is interested in
+receiving
+<function>CatalogueListNotify </function>
+events.  If
+<function>FontListChangeMask </function>
+is set, the client is interested in
+receiving
+<function>FontListNotify </function>
+events.
+</para>
+<para>
+<!-- .sp -->
+Extensions that provide additional events may define their own
+event masks.  These event masks have their own scope and may use
+the same bit values as the core or other extensions.
+<!-- .sp -->
+All unused bits must be set to zero.  In
+<function>SetEventMask </function>
+requests, if
+any bits are set that are not defined for the extension (or core)
+for which this EVENTMASK is intended (according to the EXTENSION-
+OPCODE given in the
+<function>SetEventMask </function>
+request), an
+<function>EventMask </function>
+error is generated.
+<!-- .sp -->
+This value is swapped as a CARD32.
+    </para>
+</blockquote>
+
+<para>
+FONTID:     ID
+</para>
+
+<blockquote>
+<para>
+This is specified by the client in the request
+<function>OpenBitmapFont </function>
+as the identifier to be used when referring to a particular open
+font.
+</para>
+</blockquote>
+
+<para>
+ID:  CARD32
+</para>
+
+<blockquote>
+<para>
+This is a 32-bit value in which the top 3 bits must be clear, and
+at least 1 other bit must be set (yielding a range of 1 through
+2^29-1).  It is specified by the client to represent objects in
+the server.  Identifiers are scoped according to their type are
+private to the client; thus, the same identifier may be used for
+both a FONTID and an ACCESSCONTEXT as well as by multiple clients.
+</para>
+<para>
+An ID of zero is referred to as None.
+</para>
+</blockquote>
+
+<para>
+INT8:  8-bit signed integer
+</para>
+
+<para>
+INT16:  16-bit signed integer
+</para>
+
+<para>
+INT32:  32-bit signed integer
+</para>
+
+<blockquote>
+<para>
+These are signed numbers.  The latter two are byte-swapped when
+the client and server have different byte orders.
+</para>
+</blockquote>
+
+<literallayout class="monospaced">
+OFFSET32:      [  position:     CARD32,
+                  length:       CARD32 ]
+</literallayout>
+
+<blockquote>
+    <para>
+This structure indicates a position and length within a block of
+data.
+    </para>
+</blockquote>
+
+<literallayout class="monospaced">
+PROPINFO:     [ offsets:          LISTofPROPOFFSET,
+                data:             LISTofBYTE ]
+</literallayout>
+
+<blockquote>
+    <para>
+This structure describes the list of properties provided by a
+font.  Strings for all of the properties names and values are
+stored within the data block and are located using a table of
+offsets and lengths.
+    </para>
+    <para>
+This structure is padded to 32-bit alignment.
+    </para>
+</blockquote>
+
+<literallayout class="monospaced">
+PROPOFFSET:     [ name:          OFFSET32,
+                 value:          OFFSET32,
+                 type:           CARD8,
+                 zero-pad3:      BYTE, BYTE, BYTE ]
+</literallayout>
+
+<blockquote>
+    <para>
+This structure specifies the position, length, and type of
+of data for a property.
+    </para>
+    <para>
+The NAME field specifies the position and length (which must be
+greater than zero) of the property name relative to the beginning
+of the PROPINFO.DATA block for this font.  The interpretation of
+the position and length of the VALUE field is determined by the
+TYPE field, which contains one of the following alternate values:
+    </para>
+</blockquote>
+
+<literallayout class="monospaced">
+     String          0
+     Unsigned        1
+     Signed          2
+</literallayout>
+
+<blockquote>
+    <para>
+which have the following meanings:
+    </para>
+    <blockquote>
+      <para>
+This property contains a counted string of bytes.  The
+data is stored in the PROPINFO.DATA block beginning at
+relative byte VALUE.POSITION (beginning with zero), extending
+for VALUE.LENGTH (at least zero) bytes.
+      </para>
+    </blockquote>
+    <para>
+This property contains a unsigned, 32-bit number stored
+as a CARD32 in VALUE.POSITION (VALUE.LENGTH is zero).
+    </para>
+    <blockquote>
+      <para>
+This property contains a signed, 32-bit number stored as
+an INT32 in VALUE.POSITION (VALUE.LENGTH is zero).
+This structure is zero-padded to 32-bit alignment.
+      </para>
+    </blockquote>
+</blockquote>
+
+<para>
+RANGE:     [ min-char, max-char:     CHAR2B ]
+</para>
+
+<blockquote>
+  <para>
+This structure specifies a range of character codes.  A single
+character is represented by MIN-CHAR equals MAX-CHAR.  If the
+linear interpretation of MAX-CHAR is less than that of MIN-CHAR,
+or if MIN-CHAR is less than the font's
+XFONTINFO.CHAR-RANGE.MIN-CHAR, or if MAX-CHAR is greater than the
+font's XFONTINFO.CHAR-RANGE.MAX-CHAR, the range is invalid.
+  </para>
+</blockquote>
+
+<literallayout class="monospaced">
+RESOLUTION:     [ x-resolution:          CARD16,
+                  y-resolution:          CARD16,
+                  decipoint-size:        CARD16 ]
+</literallayout>
+
+<blockquote>
+  <para>
+This structure specifies resolution and point size to be used in
+resolving partially-specified scaled font names.  The X-RESOLUTION
+and Y-RESOLUTION are measured in pixels-per-inch and must be
+greater than zero.  The DECIPOINT-SIZE is the preferred font
+size, measured in tenths of a point, and must be greater than zero.
+  </para>
+</blockquote>
+
+<para>
+STRING8:          LISTofCARD8
+</para>
+
+<blockquote>
+  <para>
+This is a counted list of 1-byte character codes, typically
+encoded in ISO 8859-1.  A character code "c" is equivalent to a
+CHAR2B structure whose BYTE1 is zero and whose BYTE2 is "c".
+  </para>
+</blockquote>
+
+<para>
+TIMESTAMP:     CARD32
+</para>
+
+<blockquote>
+  <para>
+This is the number of milliseconds that have passed since a server-
+dependent origin.  It is provided in errors and events and is
+permitted to wrap.
+  </para>
+</blockquote>
+
+<para>
+XCHARINFO:     [ lbearing, rbearing:     INT16,
+                 width:                  INT16,
+                 ascent, descent:        INT16,
+                 attributes:             CARD16 ]
+</para>
+
+<blockquote>
+  <para>
+This structure specifies the ink extents and horizontal escapement
+(also known as the set- or logical width) of an individual
+character.  The first five values represent directed distances in
+a coordinate system whose origin is aligned with the lower-left
+edge of the left-most pixel of the glyph baseline (i.e. the
+baseline falls between two pixels as shown in Figure 3-1 of the
+"Bitmap Distribution Format 2.1" Consortium standard [2]).
+  </para>
+<!-- .sp -->
+  <para>
+The LBEARING field specifies the directed distance measured to the
+right from the origin to the left edge of the left-most inked
+pixel in the glyph.
+<!-- .sp -->
+  </para>
+  <para>
+The RBEARING field specifies the directed distance (measured to
+the right) from the origin to the right edge of the right-most
+inked pixel in the glyph.
+<!-- .sp -->
+  </para>
+  <para>
+The WIDTH field specifies the directed distance (measured to the
+right) from the origin to the position where the next character
+should appear (called the "escapement point").  This distance
+includes any whitespace used for intercharacter padding and is
+also referred to as the "logical width" or "horizontal
+escapement."
+<!-- .sp -->
+  </para>
+  <para>
+The ASCENT field specifies the directed distance (measured up)
+from the baseline to the top edge of the top-most inked pixel
+in the glyph.
+<!-- .sp -->
+  </para>
+  <para>
+The DESCENT field specifies the directed distance (measured
+down) from the baseline to the bottom edge of the bottom-most
+inked pixel.
+<!-- .sp -->
+  </para>
+  <para>
+The ATTRIBUTES field specifies glyph-specific information that
+is passed through the application.  If this value is not being
+used, it should be zero.
+  </para>
+  <para>
+The ink bounding box of a glyph is defined to be the smallest
+rectangle that encloses all of the inked pixels.  This box has
+a width of RBEARING - LBEARING pixels and a height of
+ASCENT + DESCENT pixels.
+  </para>
+</blockquote>
+
+<literallayout class="monospaced">
+XFONTINFO:     [ flags:               CARD32,
+                 drawing-direction:   { LeftToRight, RightToLeft }
+                 char-range:          RANGE,
+                 default-char:        CHAR2B,
+                 min-bounds:          XCHARINFO,
+                 max-bounds:          XCHARINFO,
+                 font-ascent:         INT16,
+                 font-descent:        INT16,
+                 properties:          PROPINFO ]
+</literallayout>
+
+<blockquote>
+  <para>
+This structure specifies attributes related to the font as a
+whole.
+  </para>
+  <para>
+The FLAGS field is a bit mask containing zero or more of the
+following boolean values (unspecified bits must be zero):
+  </para>
+
+<literallayout class="monospaced">
+     AllCharactersExist     (1 &lt;&lt; 0)
+     InkInside              (1 &lt;&lt; 1)
+     HorizontalOverlap      (1 &lt;&lt; 2)
+</literallayout>
+
+    <para>
+which have the following meanings:
+    </para>
+    <para>
+AllCharactersExist
+    </para>
+
+<blockquote>
+    <para>
+If this bit is set, all of the characters
+in the range given by CHAR-RANGE have glyphs encoded in
+the font.  If this bit is clear, some of the characters
+may not have encoded glyphs.
+    </para>
+</blockquote>
+
+<para>
+InkInside
+</para>
+<blockquote>
+    <para>
+If this bit is set, the inked pixels of each glyph
+fall within the rectangle described by the font's ascent,
+descent, origin, and the glyph's escapement point.  If
+this bit is clear, there may be glyphs whose ink extends
+outside this rectangle.
+    </para>
+</blockquote>
+<para>
+HorizontalOverlap
+</para>
+<blockquote>
+    <para>
+If this bit is set, the two ink bounding
+boxes (smallest rectangle enclosing the inked pixels) of
+some pairs of glyphs in the font may overlap when displayed
+side-by-side (i.e. the second character is imaged at the
+escapement point of the first) on a common baseline.  If
+this bit is clear, there are no pairs of glyphs whose ink
+bounding boxes overlap.
+    </para>
+</blockquote>
+<para>
+The DRAWING-DIRECTION field contains a hint indicating whether
+most of the character metrics have a positive (or "LeftToRight")
+logical width or a negative ("RightToLeft") logical width.  It
+contains the following alternate values:
+</para>
+<literallayout class="monospaced">
+         LeftToRight          0
+         RightToLeft          1
+</literallayout>
+<para>
+The CHAR-RANGE.MIN-CHAR and CHAR-RANGE.MAX-CHAR fields specify the
+first and last character codes that have glyphs encoded in this font.
+All fonts must have at least one encoded glyph (in which case the
+MIN-CHAR and MAX-CHAR are equal), but are not required to have glyphs
+encoded at all positions between the first and last characters.
+</para>
+<para>
+The DEFAULT-CHAR field specifies the character code of the glyph
+that the client should substitute for unencoded characters.  Requests
+for extents or bitmaps for an unencoded character generate zero-filled
+metrics and a zero-length glyph bitmap, respectively.
+</para>
+<para>
+The MIN-BOUNDS and MAX-BOUNDS fields contain the minimum and maximum
+values of each of the extents field of all encoded characters in the
+font (i.e. non-existent characters are ignored).
+</para>
+<para>
+The FONT-ASCENT and FONT-DESCENT fields specify the font designer's
+logical height of the font, above and below the baseline,
+respectively.  The sum of the two values is often used as the
+vertical line spacing of the font.  Individual glyphs are permitted
+to have ascents and descents that are greater than these values.
+</para>
+<para>
+The PROPERTIES field contains the property data associated with
+this font.
+</para>
+<para>
+This structure is padded to 32-bit alignment.
+</para>
+</blockquote>
+</sect2>
+
+<sect2 id="requests">
+<title>Requests</title>
+<!-- .XS -->
+<!-- (SN Requests -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This section describes the requests that may be sent by the client and the
+replies or errors that are generated in response.  Versions of the protocol
+with the same major version are required to be upward-compatible.
+</para>
+<para>
+<!-- .LP -->
+Every request on a given connection is implicitly assigned a sequence number,
+starting with 1, that is used in replies, error, and events.  Servers are
+required to generate replies and errors in the order in which the corresponding
+requests are received.  Servers are permitted to add or remove fonts to the
+list visible to the client between any two requests, but requests must be
+processed atomically.  Each request packet is at least 4 bytes long and
+contains the following fields:
+</para>
+<!-- .RS -->
+<literallayout class="monospaced">
+     major-opcode:               CARD8
+     minor-opcode:               CARD8
+     length:                    CARD16
+</literallayout>
+<para>
+<!-- .RE -->
+The MAJOR-OPCODE specifies which core request or extension package this packet
+represents.  If the MAJOR-OPCODE corresponds to a core request, the
+MINOR-OPCODE contains 8 bits of request-specific data.  Otherwise, the
+MINOR-OPCODE specifies which extension request this packet represents.  The
+LENGTH field specifies the number of 4-byte units contained within the packet
+and must be at least one.  If this field contains a value greater than one it
+is followed by (LENGTH - 1) * 4 bytes of request-specific data.  Unless
+otherwise specified, unused bytes are not required to be zero.
+</para>
+<para>
+<!-- .LP -->
+If a request packet contains too little or too much data, the server returns
+a Length error.  If the server runs out of internal resources (such as
+memory) while processing a request, it returns an Alloc error.  If a server is
+deficient (and therefore non-compliant) and is unable to process a request, it
+may return an Implementation error.  If a client uses an extension request
+without previously having issued a
+<function>QueryExtension </function>
+request for that extension, the server responds with a
+<function>Request </function>
+error.  If the server encounters a request
+with an unknown MAJOR-OPCODE or MINOR-OPCODE, it responds with a
+<function>Request </function>
+error.
+At most one error is generated per request.  If more than one error condition
+is encountered in processing a requests, the choice of which error is returned
+is server-dependent.
+</para>
+<para>
+<!-- .LP -->
+Core requests have MAJOR-OPCODE values between 0 and 127, inclusive.  Extension
+requests have MAJOR-OPCODE values between 128 and 255, inclusive, that are
+assigned by by the server.  All MINOR-OPCODE values in extension requests are
+between 0 and 255, inclusive.
+</para>
+<para>
+<!-- .LP -->
+Each reply is at least 8 bytes long and contains the following fields:
+</para>
+<!-- .RS -->
+<literallayout class="monospaced">
+     type:                 CARD8 value of 0
+     data-or-unused:       CARD8
+     sequence-number:      CARD16
+     length:               CARD32
+</literallayout>
+<para>
+<!-- .RE -->
+The TYPE field has a value of zero.  The DATA-OR-UNUSED field may be used to
+encode one byte of reply-specific data (see Section 5.2 on request encoding).
+The least-significant 16 bits of the sequence number of the request that
+generated the reply are stored in the SEQUENCE-NUMBER field.  The LENGTH field
+specifies the number of 4-byte units in this reply packet, including the fields
+described above, and must be at least two.  If LENGTH is greater than two, the
+fields described above are followed by (LENGTH - 2) * 4 bytes of additional
+data.
+</para>
+<para>
+<!-- .LP -->
+Requests that have replies are described using the following syntax:
+</para>
+<!-- .RS -->
+<literallayout class="monospaced">
+     RequestName
+         <emphasis remap='I'>arg1</emphasis>:  type1
+         <emphasis remap='I'>arg2</emphasis>:  type2
+         ...
+         <emphasis remap='I'>argN</emphasis>:  typeN
+           =&gt;
+        <emphasis remap='I'>result1</emphasis>:  type1
+         <emphasis remap='I'>result2</emphasis>:  type2
+         ...
+         <emphasis remap='I'>resultM</emphasis>:  typeM
+
+     Errors:  <emphasis remap='I'>kind1</emphasis>, <emphasis remap='I'>kind2</emphasis> ..., <emphasis remap='I'>kindK</emphasis>
+
+     Description
+</literallayout>
+<para>
+<!-- .RE -->
+If a request does not generate a reply, the"=&gt;" and result lines are
+omitted.  If a request may generate multiple replies, the "=&gt;" is replaced by
+a "=&gt;+".  In the authorization data exchanges in the initial connection setup
+and the CreateAC request, "-&gt;" indicates data sent by the client in response
+to data sent by the server.
+</para>
+<para>
+<!-- .LP -->
+The protocol begins with the establishment of a connection over a
+mutually-understood virtual stream:
+</para>
+
+<literallayout class="monospaced">
+
+  open connection
+     byte-order:                         BYTE
+     client-major-protocol-version:      CARD16
+     client-minor-protocol-version:      CARD16
+     authorization-protocols:            LISTofAUTH
+</literallayout>
+<para>
+The initial byte of the connection specifies the BYTE-ORDER in
+which subsequent 16-bit and 32-bit numeric values are to be
+transmitted.  The octal value 102 (ASCII uppercase `B')
+indicates that the most-significant byte is to be transmitted
+first; the octal value 154 (ASCII lowercase `l') indicates
+that the least-significant byte is to be transmitted first.
+If any other value is encountered the server closes the
+connection without any response.
+</para>
+
+<blockquote>
+  <para>
+The CLIENT-MAJOR-PROTOCOL-VERSION and
+CLIENT-MINOR-PROTOCOL-VERSION specify which version of the
+font service protocol the client would like to use.  If the
+client can support multiple versions, the highest version
+should be given.  This version of the protocol has a
+major version of 2 and a minor version of 0.
+  </para>
+  <para>
+The AUTHORIZATION-PROTOCOLS contains a list of protocol names and
+optional initial data for which the client can provide
+information.  The server may use this to determine which
+protocol to use or as part of the initial exchange of
+authorization data.
+  </para>
+<literallayout class="monospaced">
+=&gt;
+status:                         { Success, Continue,
+                                  Busy, Denied }
+server-major-protocol-version:  CARD16
+server-minor-protocol-version:  CARD16
+alternate-servers-hint:         LISTofALTERNATESERVER
+authorization-index:            CARD8
+authorization-data:             LISTofBYTE
+</literallayout>
+  <para>
+<!-- .RE -->
+The SERVER-MAJOR-PROTOCOL-VERSION and
+SERVER-MINOR-PROTOCOL-VERSION specify the version of the font
+service protocol that the server expects from the client.  If
+the server supports the version specified by the client, this
+version number should be returned.  If the client has
+requested a higher version than is supported by the server,
+the server's highest version should be returned.  Otherwise,
+if the client has requested a lower version than is supported
+by the server, the server's lowest version should be returned.
+It is the client's responsibility to decide whether or not it
+can match this version of the protocol.
+  </para>
+  <para>
+The ALTERNATE-SERVERS-HINT is a list of other font servers
+that may have related sets of fonts (determined by means
+outside this protocol, typically by the system administrator).
+Clients may choose to contact these font servers if the
+connection is rejected or lost.
+  </para>
+  <para>
+The STATUS field indicates whether the server accepted,
+rejected, or would like more information about the connection.
+It has one of the following alternate values:
+  </para>
+<literallayout class="monospaced">
+
+          Success          0
+          Continue         1
+          Busy             2
+          Denied           3
+</literallayout>
+  <para>
+<!-- .RE -->
+If STATUS is Denied, the server has rejected the client's
+authorization information.  If STATUS is Busy, the server has
+simply decided that it cannot provide fonts to this client at
+this time (it may be able to at a later time).  In both cases,
+AUTHORIZATION-INDEX is set to zero, no authorization-data is
+returned, and the server closes the connection after sending
+the data described so far.
+  </para>
+  <para>
+Otherwise the AUTHORIZATION-INDEX is set to the index
+(beginning with 1) into the AUTHORIZATION-PROTOCOLS list of
+the protocol that the server will use for this connection.  If
+the server does not want to use any of the given protocols,
+this value is set to zero.  The AUTHORIZATION-DATA field is
+used to send back authorization protocol-dependent data to the
+client (such as a challenge, authentication of the server,
+etc.).
+  </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+If STATUS is Success, the following section of protocol is
+omitted.  Otherwise, if STATUS is Continue, the server expects
+more authorization data from the client (i.e. the connection
+setup is not finished, so no requests or events may be sent):
+</para>
+
+<literallayout class="monospaced">
+-&gt;
+more-authorization-data:   STRING8
+=&gt;
+status:                    { Success, Continue,
+                           Busy, Denied }
+more-authorization-data:   LISTofBYTE
+</literallayout>
+
+<!-- .RE -->
+<para>
+The values in STATUS have the same meanings as described
+above.  This section of protocol is repeated until the server
+either accepts (sets STATUS to Success) or rejects (sets
+STATUS to Denied or Busy) the connection.
+</para>
+<para>
+<!-- .LP -->
+Once the connection has been accepted and STATUS is Success,
+an implicit AccessContext is created for the authorization
+data and the protocol continues with the following data sent
+from the server:
+</para>
+<!-- .RS -->
+<literallayout class="monospaced">
+=&gt;
+remaining-length:           CARD32
+maximum-request-length:     CARD16
+release-number:             CARD32
+vendor:                     STRING8
+</literallayout>
+<para>
+The REMAINING-LENGTH specifies the length in 4-byte units of
+the remaining data to be transmitted to the client.  The
+MAXIMUM-REQUEST-LENGTH specifies the largest request size in
+4-byte units that is accepted by the server and must have a
+value of at least 4096.  Requests with a length field larger
+than this value are ignored and a Length error is returned.
+The VENDOR string specifies the name of the manufacturer of
+the font server.  The RELEASE-NUMBER specifies the particular
+release of the server in a manufacturer-dependent manner.
+</para>
+<para>
+<!-- .LP -->
+After the connection is established and the setup information has been
+exchanged, the client may issue any of requests described below:
+</para>
+<blockquote>
+<para>
+<!-- .LP -->
+<!-- .IN "NoOp" "" "@DEF@" -->
+<function>NoOp</function>
+</para>
+    <para>
+Errors:  Alloc
+    </para>
+    <para>
+This request does nothing.  It is typically used in response
+to a
+<function>KeepAlive </function>
+event.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "ListExtensions" "" "@DEF@" -->
+<function>ListExtensions</function>
+</para>
+<para>
+=&gt;
+</para>
+
+<blockquote>
+  <para>
+<emphasis remap='I'>names</emphasis>:  LISTofSTRING8
+  </para>
+  <para>
+Errors:  Alloc
+  </para>
+  <para>
+This request returns the names of the extension packages
+that are supported by the server.  Extension names are
+case-sensitive and are encoded in ISO 8859-1.
+  </para>
+</blockquote>
+
+<para>
+<!-- .IN "QueryExtension" "" "@DEF@" -->
+<function>QueryExtension</function>
+</para>
+
+<blockquote>
+<para>
+<emphasis remap='I'>name</emphasis>:  STRING8
+</para>
+</blockquote>
+<para>
+=&gt;
+</para>
+
+<blockquote>
+  <para>
+<emphasis remap='I'>present</emphasis>:  BOOL
+    </para>
+    <para>
+<emphasis remap='I'>major-version</emphasis>:  CARD16
+    </para>
+    <para>
+<emphasis remap='I'>minor-version</emphasis>:  CARD16
+    </para>
+    <para>
+<emphasis remap='I'>major-opcode</emphasis>:  CARD8
+    </para>
+    <para>
+<emphasis remap='I'>first-event</emphasis>:  CARD8
+    </para>
+    <para>
+<emphasis remap='I'>number-events</emphasis>:  CARD8
+    </para>
+    <para>
+<emphasis remap='I'>first-error</emphasis>:  CARD8
+    </para>
+    <para>
+<emphasis remap='I'>number-errors</emphasis>:  CARD8
+  </para>
+  <para>
+Errors:
+<function>Alloc</function>
+  </para>
+  <para>
+This request determines whether or not the extension package
+specified by NAME (encoded in ISO 8859-1) is supported by the
+server and that there is sufficient number of major opcode,
+event, and error codes available.  If so, then PRESENT is set
+to True, MAJOR-VERSION and MINOR-VERSION are set to the
+respective major and minor version numbers of the protocol
+that the server would prefer; MAJOR-OPCODE is set to the value
+to use in extension requests; FIRST-EVENT is set to the value
+of the first extension-specific event code or zero if the
+extension does not have any events; NUMBER-EVENTS is set to
+the number of new events that the event defines; FIRST-ERROR
+is set to the value of the first extension-specific error code
+or zero if the extension does not define any new errors; and
+NUMBER-ERRORS is set to the number of new errors the extension
+defines.
+  </para>
+  <para>
+<!-- .sp -->
+Otherwise, PRESENT is set to False and the remaining fields are
+set to zero.
+  </para>
+  <para>
+<!-- .sp -->
+The server is free to return different values to different
+clients.  Therefore, clients must use this request before
+issuing any of the requests in the named extension package or
+using the
+<function>SetEventMask request to express interest in any of</function>
+this extension's events.  Otherwise, a
+<function>Request </function>
+error is returned.
+  </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "ListCatalogues" "" "@DEF@" -->
+<function>ListCatalogues</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>pattern</emphasis>:  STRING8
+    </para>
+    <para>
+<emphasis remap='I'>max-names</emphasis>:  CARD32
+    </para>
+</blockquote>
+<para>
+<!-- .LP -->
+=&gt;+
+</para>
+<blockquote>
+    <para>
+<emphasis remap='I'>replies-following-hint</emphasis>:  CARD32
+    </para>
+    <para>
+<emphasis remap='I'>names</emphasis>:      LISTofSTRING8
+    </para>
+    <para>
+Errors:
+<function>Alloc</function>
+    </para>
+    <para>
+This request returns a list of at most MAX-NAMES names
+of collections (called catalogues) of fonts that match
+the specified PATTERN.  In the pattern (which is encoded
+in ISO 8859-1), the `?' character (octal 77) matches any
+single character; the `*' character (octal 52) matches
+any series of zero or more characters; and alphabetic
+characters match either upper- or lowercase.  The
+returned NAMES are encoded in ISO 8859-1 and may contain
+mixed character cases.
+    </para>
+    <para>
+If PATTERN is of zero length or MAX-NAMES is equal to zero,
+one reply containing a zero-length list of names is returned.
+This may be used to synchronize the client with the server.
+    </para>
+    <para>
+Servers are free to add or remove catalogues to the set returned by
+<function>ListCatalogues</function>
+between any two requests.  This request is not
+cumulative; repeated uses are processed in isolation and do
+result in an iteration through the list.
+    </para>
+    <para>
+To reduce the amount of buffering needed by the server, the
+list of names may be split across several reply packets, so
+long as the names arrive in the same order that they would
+have appeared had they been in a single packet.  The
+REPLIES-FOLLOWING-HINT field in all but the last reply
+contains a positive value that specifies the number of
+replies that are likely, but not required, to follow.  In the
+last reply, which may contain zero or more names, this field
+is set to zero.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "SetCatalogues" "" "@DEF@" -->
+<function>SetCatalogues</function>
+</para>
+<blockquote>
+    <para>
+<emphasis remap='I'>names</emphasis>:  LISTofSTRING8
+    </para>
+    <para>
+Errors:
+<function>Alloc , </function>
+<function>Name</function>
+    </para>
+    <para>
+This request sets the list of catalogues whose fonts should be
+visible to the client.  The union of the fonts provided by
+each of the named catalogues forms the set of fonts whose
+names match patterns in
+<function>ListFonts , </function>
+<function>ListFontsWithXInfo , </function>
+and
+<function>OpenBitmapFont </function>
+requests.  The catalogue names are
+case-insensitive and are encoded in ISO 8859-1.  A zero-length
+list resets the client's catalogue list to the
+server-dependent default.
+<!-- .sp -->
+    </para>
+    <para>
+If any of the catalogue names are invalid, a
+<function>Name </function>
+error is returned and the request is ignored.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "GetCatalogues" "" "@DEF@" -->
+<function>GetCatalogues</function>
+</para>
+
+<para>
+=&gt;
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>names</emphasis>:  LISTofSTRING8
+    </para>
+    <para>
+Errors:
+<function>Alloc</function>
+    </para>
+    <para>
+This request returns the current list of catalogue names
+(encoded in ISO 8859-1) associated with the client.  These
+catalogues determine the set of fonts that are visible
+to
+<function>ListFonts</function>,
+<function>ListFontsWithXInfo</function>,
+and
+<function>OpenBitmapFont</function>.
+A zero-length list indicates the server's default set of
+fonts.  Catalogue names are case-insensitive and may be
+returned in mixed case.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "SetEventMask" "" "@DEF@" -->
+<function>SetEventMask</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>extension-opcode</emphasis>:  CARD8
+    </para>
+    <para>
+<emphasis remap='I'>event-mask</emphasis>:  EVENTMASK
+    </para>
+    <para>
+Errors:
+<function>EventMask ,</function>
+<function>Request</function>
+    </para>
+    <para>
+This request specifies the set of maskable events that the
+extension indicated by EXTENSION-OPCODE (or zero for the core)
+should generate for the client.  Event masks are limited in
+scope to the extension (or core) for which they are defined,
+so expressing interest in events from one or more extensions
+requires multiple uses of this request.
+<!-- .sp -->
+    </para>
+    <para>
+The default event mask if
+<function>SetEventMask </function>
+has not been called
+is zero, indicating no interest in any maskable events.
+Some events are not maskable and cannot be blocked.
+<!-- .sp -->
+    </para>
+    <para>
+If EXTENSION-OPCODE is not a valid extension opcode previously
+returned by
+<function>QueryExtension </function>
+or zero, a
+<function>Request </function>
+error is
+returned.  If EVENT-MASK contains any bits that do not
+correspond to valid events for the specified extension (or
+core), an
+<function>EventMask</function>
+error is returned and the request is
+ignored.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "GetEventMask" "" "@DEF@" -->
+<function>GetEventMask</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>extension-opcode</emphasis>:  CARD8
+    </para>
+</blockquote>
+<para>
+=&gt;
+</para>
+<blockquote>
+    <para>
+<emphasis remap='I'>event-mask</emphasis>:  EVENTMASK
+    </para>
+    <para>
+Errors:
+<function>Request</function>
+    </para>
+    <para>
+This request returns the set of maskable core events the
+extension indicated by EXTENSION-OPCODE (or the core if zero)
+should generate for the client.  Non-maskable events are
+always sent to the client.
+    </para>
+    <para>
+If EXTENSION-OPCODE is not a valid extension opcode
+previously returned by
+<function>QueryExtension </function>
+or zero, a
+<function>Request</function>
+error is returned.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "CreateAC" "" "@DEF@" -->
+<function>CreateAC</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>ac</emphasis>:  ACCESSCONTEXT
+    </para>
+    <para>
+<emphasis remap='I'>authorization-protocols</emphasis>:  LISTofAUTH
+    </para>
+</blockquote>
+<para>
+=&gt;
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>status</emphasis>:       { Success, Continue, Denied }
+    </para>
+    <para>
+<emphasis remap='I'>authorization-index</emphasis>:          CARD8
+    </para>
+    <para>
+<emphasis remap='I'>authorization-data</emphasis>:          LISTofBYTE
+    </para>
+    <para>
+Errors:
+<function>IDChoice</function>
+    </para>
+    <para>
+This request creates a new
+<function>AccessContext </function>
+object within the
+server containing the specified authorization data.  When
+this
+<function>AccessContext</function>
+is selected by the client using the
+<function>SetAuthorization </function>
+request, the data may be used by the server
+to determine whether or not the client should be granted
+access to particular font information.
+    </para>
+    <para>
+<!-- .sp -->
+If STATUS is Denied, the server rejects the client's
+authorization information and does not associate AC with any
+valid
+<function>AccessContext .  </function>
+In this case, AUTHORIZATION-INDEX is set
+to zero, and zero bytes of AUTHORIZATION-DATA is returned.
+    </para>
+    <para>
+<!-- .sp -->
+Otherwise, AUTHORIZATION-INDEX is set to the index (beginning
+with 1) into the AUTHORIZATION-PROTOCOLS list of the protocol
+that the server will use for this connection.  If the server
+does not want to use any of the given protocols, this value is
+set to zero.  The AUTHORIZATION-DATA field is used to send
+back authorization protocol-dependent data to the client (such
+as a challenge, authentication of the server, etc.).
+    </para>
+    <para>
+<!-- .sp -->
+If STATUS is Continue, the client is expected to continue
+the request by sending the following protocol and receiving
+the indicated response from the server.  This continues
+until STATUS is set to either Success or Denied.
+    </para>
+<literallayout class="monospaced">
+     -&gt;
+     more-authorization-data:          STRING8
+     =&gt;
+     status:                           { Success, Continue, Denied }
+     more-authorization-data:          LISTofBYTE
+</literallayout>
+    <para>
+Once the connection has been accepted and STATUS is Success,
+the request is complete.
+    </para>
+    <para>
+If AC is not in the range [1..2^29-1] or is already associated
+with an access context, an IDChoice error is returned.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "FreeAC" "" "@DEF@" -->
+<function>FreeAC</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>ac</emphasis>:  ACCESSCONTEXT
+    </para>
+    <para>
+Errors:
+<function>AccessContext , </function>
+<function>Alloc</function>
+    </para>
+    <para>
+This request indicates that the specified AC should no longer
+be associated with a valid access context.  If AC is also the
+current
+<function>AccessContext</function>
+(as set by the
+<function>SetAuthorization</function>
+request), an implicit
+<function>SetAuthorization</function>
+of None is done to
+restore the
+<function>AccessContext</function>
+established for the initial
+connection setup.  Operations on fonts that were opened under
+AC are not affected.  The client may reuse the value of AC in
+a subsequent
+<function>CreateAC </function>
+request.
+    </para>
+    <para>
+If AC isn't associated with any valid authorization previously
+created by
+<function>CreateAC , an </function>
+<function>AccessContext </function>
+error is returned.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "SetAuthorization" "" "@DEF@" -->
+<function>SetAuthorization</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>ac</emphasis>:  ACCESSCONTEXT
+    </para>
+    <para>
+Errors:
+<function>AccessContext</function>
+    </para>
+    <para>
+This request sets the
+<function>AccessContext </function>
+to be used for subsequent
+requests (except for
+<function>QueryXInfo</function>,
+<function>QueryXExtents8</function>,
+<function>QueryXExtents16</function>,
+<function>QueryXBitmaps8</function>,
+<function>QueryXBitmaps16</function>
+and
+<function>CloseFont </function>
+which are done under the
+<function>AccessContext </function>
+of the
+corresponding
+<function>OpenBitmapFont</function>
+")."
+An AC of None restores the
+<function>AccessContext</function>
+established for the initial connection setup.
+    </para>
+    <para>
+<!-- .sp -->
+If AC is neither None nor a value associated with a valid
+<function>AccessContext</function>
+previously created by
+<function>CreateAC</function>,
+an
+<function>AccessContext</function>
+error is returned.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "SetResolution" "" "@DEF@" -->
+<function>SetResolution</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>resolutions</emphasis>:  LISTofRESOLUTION
+    </para>
+    <para>
+Errors:
+<function>Resolution</function>,
+<function>Alloc</function>
+    </para>
+    <para>
+This request provides a hint as to the resolution and
+preferred point size of the drawing surfaces for which the
+client will be requesting fonts.  The server may use this
+information to set the RESOLUTION_X and RESOLUTION_Y fields
+of scalable XLFD font names, to order sets of names based on
+their resolutions, and to choose the server-dependent
+instance that is used when a partially-specified scalable
+fontname is opened.
+    </para>
+    <para>
+If a zero-length list of RESOLUTIONS is given, the
+server-dependent default value is restored.  Otherwise, if
+elements of all of the specified RESOLUTIONS are non-zero, the
+default resolutions for this client are changed.
+    </para>
+    <para>
+If a RESOLUTION entry contains a zero, a Resolution error is
+returned and the default resolutions are not changed.
+    </para>
+</blockquote>
+<para>
+<!-- .LP -->
+<!-- .IN "GetResolution" "" "@DEF@" -->
+<function>GetResolution</function>
+</para>
+<para>
+=&gt;
+</para>
+<blockquote>
+    <para>
+<emphasis remap='I'>resolutions</emphasis>:  LISTofRESOLUTION
+    </para>
+    <para>
+Errors:
+<function>Alloc</function>
+    </para>
+    <para>
+This request returns the current list of default resolutions.
+If a client has not performed a
+<function>SetResolution</function>,
+a server-dependent default value is returned.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "ListFonts" "" "@DEF@" -->
+<function>ListFonts</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>pattern</emphasis>:  STRING8
+    </para>
+    <para>
+<emphasis remap='I'>max-names</emphasis>:  CARD32
+    </para>
+</blockquote>
+<para>
+=&gt;+
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>replies-following-hint</emphasis>:  CARD32
+    </para>
+    <para>
+<emphasis remap='I'>names</emphasis>:  LISTofSTRING8
+    </para>
+    <para>
+Errors:
+<function>Alloc</function>
+    </para>
+    <para>
+This request returns a list of at most MAX-NAMES font names
+that match the specified PATTERN, according to matching rules
+of the X Logical Font Description Conventions [3].  In the
+pattern (which is encoded in ISO 8859-1) the `?' character
+(octal 77) matches any single character; the `*' character
+(octal 52) matches any series of zero or more characters; and
+alphabetic characters match either upper- or lowercase.  The
+returned NAMES are encoded in ISO 8859-1 and may contain mixed
+character cases.  Font names are not required to be in XLFD
+format.
+    </para>
+    <para>
+If PATTERN is of zero length or MAX-NAMES is equal to zero,
+one reply containing a zero-length list of names is returned.
+This may be used to synchronize the client with the server.
+    </para>
+    <para>
+Servers are free to add or remove fonts to the set returned by
+<function>ListFonts </function>
+between any two requests.  This request is not
+cumulative; repeated uses are processed in isolation and do
+result in an iteration through the list.
+    </para>
+    <para>
+To reduce the amount of buffering needed by the server, the
+list of names may be split across several reply packets, so
+long as the names arrive in the same order that they would
+have appeared had they been in a single packet.  The
+REPLIES-FOLLOWING-HINT field in all but the last reply
+contains a positive value that specifies the number of
+replies that are likely, but not required, to follow.  In the
+last reply, which may contain zero or more names, this field
+is set to zero.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "ListFontsWithXInfo" "" "@DEF@" -->
+<function>ListFontsWithXInfo</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>pattern</emphasis>:  STRING8
+    </para>
+    <para>
+<emphasis remap='I'>pattern</emphasis>:  STRING8
+    </para>
+    <para>
+<emphasis remap='I'>pattern</emphasis>:  STRING8
+    </para>
+    <para>
+<emphasis remap='I'>max-names</emphasis>:  CARD32
+    </para>
+</blockquote>
+
+<para>
+=&gt;+
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>replies-following-hint</emphasis>:  CARD32
+    </para>
+    <para>
+<emphasis remap='I'>info</emphasis>:  XFONTINFO
+    </para>
+    <para>
+<emphasis remap='I'>name</emphasis>:  STRING8
+    </para>
+    <para>
+Errors:
+<function>Alloc</function>
+    </para>
+    <para>
+This request is similar to
+<function>ListFonts </function>
+except that a separate
+reply containing the name, header, and property data is
+generated for each matching font name.  Following these
+replies, if any, a final reply containing a zero-length NAME
+and no INFO is sent.
+    </para>
+    <para>
+<!-- .sp -->
+The REPLIES-FOLLOWING-HINT field in all but the last reply
+contains a positive value that specifies the number of replies
+that are likely, but not required, to follow.  In the last
+reply, this field is set to zero.
+    </para>
+    <para>
+<!-- .sp -->
+If PATTERN is of zero length or if MAX-NAMES is equal to
+zero, only the final reply containing a zero-length NAME and
+no INFO is returned.  This may be used to synchronize the
+client with the server.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "OpenBitmapFont" "" "@DEF@" -->
+<function>OpenBitmapFont</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>fontid</emphasis>:  FONTID
+    </para>
+    <para>
+<emphasis remap='I'>pattern</emphasis>:  STRING8
+    </para>
+    <para>
+<emphasis remap='I'>format-mask</emphasis>:  BITMAPFORMATMASK
+    </para>
+    <para>
+<emphasis remap='I'>format-hint</emphasis>:  BITMAPFORMAT
+    </para>
+</blockquote>
+
+<para>
+=&gt;
+</para>
+<blockquote>
+    <para>
+<emphasis remap='I'>otherid</emphasis>:  FONTID or None
+    </para>
+    <para>
+<emphasis remap='I'>otherid-valid</emphasis>:  BOOL
+    </para>
+    <para>
+<emphasis remap='I'>cachable</emphasis>:  BOOL
+    </para>
+    <para>
+Errors:
+<function>IDChoice</function>,
+<function>Name</function>,
+<function>Format</function>,
+<function>AccessContext</function>,
+<function>Alloc</function>
+    </para>
+    <para>
+This request looks for a server-dependent choice of the
+font names that match the specified PATTERN according to the
+rules described for
+<function>ListFonts .  </function>
+If no matches are found, a
+<function>Name </function>
+error is returned.  Otherwise, the server attempts to
+open the font associated with the chosen name.
+    </para>
+    <para>
+Permission to access the font is determined by the server
+according the licensing policy used for this font.  The server
+may use the client's current
+<function>AccessContext</function>
+(as set by the most
+recent
+<function>SetAuthorization </function>
+request or the original connection
+setup) to determine any client-specific sets of permissions.
+After the font has been opened, the client is allowed to
+specify a new
+<function>AccessContext</function>
+with
+<function>SetAuthorization</function>
+or release
+the
+<function>AccessContext</function>
+using
+<function>FreeAC</function>
+.  Subsequent
+<function>QueryXInfo</function>,
+<function>QueryXExtents8</function>,
+<function>QueryXExtents16</function>,
+<function>QueryXBitmaps8</function>,
+<function>QueryXBitmaps16</function>
+and
+<function>CloseFont</function>
+requests on this FONTID are
+performed according to permissions granted at the time of the
+<function>OpenBitmapFont</function>
+request.
+    </para>
+    <para>
+If the server is willing and able to detect that the client
+has already opened the font successfully (possibly under a
+different name), the OTHERID field may be set to one of the
+identifiers previously used to open the font.  The
+OTHERID-VALID field indicates whether or not OTHERID is
+still associated with an open font: if it is True, the
+client may use OTHERID as an alternative to FONTID.
+Otherwise, if OTHERID-VALID is False, OTHERID is no longer
+open but has not been reused by a subsequent
+<function>OpenBitmapFont</function>
+request.
+<!-- .sp -->
+    </para>
+    <para>
+If OTHERID is set to None, then OTHERID-VALID should be set
+to False.
+<!-- .sp -->
+    </para>
+    <para>
+The FORMAT-MASK indicates which fields in FORMAT-HINT
+the client is likely to use in subsequent
+<function>GetXBitmaps8</function>
+and
+<function>GetXBitmaps16 </function>
+requests.  Servers may wish to use
+this information to precompute certain values.
+<!-- .sp -->
+    </para>
+    <para>
+If CACHABLE is set to True, the client may cache the font
+(so that redundant opens of the same font may be avoided)
+and use it with all
+<function>AccessContexts </function>
+during the life of the
+client without violating the font's licensing policy.  This
+flag is typically set whenever a font is unlicensed or is
+licensed on a per-display basis.  If CACHABLE is False, the
+client should reopen the font for each
+<function>AccessContext .</function>
+<!-- .sp -->
+    </para>
+    <para>
+The server is permitted to add to or remove from the set of
+fonts returned by
+<function>ListFonts </function>
+between any two requests, though
+mechanisms outside the protocol.  Therefore, it is possible
+for this request (which is atomic) to return a different font
+than would result from separate a
+<function> ListFonts </function>
+followed by an
+<function>OpenBitmapFont </function>
+with a non-wildcarded font name.
+<!-- .sp -->
+    </para>
+    <para>
+If FONTID is not in the range [1..2^29-1] or if it is already
+associated with an open font, an
+<function>IDChoice </function>
+error is returned.
+If no font is available that matches the specified PATTERN, a
+<function>Name </function>
+error is returned.  If the font is present but the client
+is not permitted access, an
+<function>AccessContext </function>
+error is returned.
+If FORMAT-MASK has any unspecified bits set or if any of the
+fields in FORMAT-HINT indicated by FORMAT-MASK are invalid, a
+<function>Format </function>
+error is returned.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "QueryXInfo" "" "@DEF@" -->
+<function>QueryXInfo</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>fontid</emphasis>:  FONTID
+    </para>
+</blockquote>
+<para>
+=&gt;
+</para>
+<blockquote>
+    <para>
+<emphasis remap='I'>info</emphasis>:  XFONTINFO
+    </para>
+    <para>
+Errors:
+<function>Font</function>,
+<function>Alloc</function>
+    </para>
+    <para>
+This request returns the font header and property information
+for the open font associated with FONTID.
+    </para>
+    <para>
+<!-- .sp -->
+If FONTID is not associated with any open fonts, a
+<function> Font </function>
+error
+is returned.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "QueryXExtents8" "" "@DEF@" -->
+<function>QueryXExtents8</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>fontid</emphasis>:  FONTID
+    </para>
+    <para>
+<emphasis remap='I'>range</emphasis>:  BOOL
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>chars</emphasis>:  STRING8
+    </para>
+</blockquote>
+<para>
+=&gt;
+</para>
+<blockquote>
+    <para>
+<emphasis remap='I'>extents</emphasis>:  LISTofXCHARINFO
+    </para>
+    <para>
+Errors:
+<function>Font</function>,
+<function>Range</function>,
+<function>Alloc</function>
+    </para>
+    <para>
+This request is equivalent to
+<function>QueryXExtents16 </function>
+except that it
+uses 1-byte character codes.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "QueryXExtents16" "" "@DEF@" -->
+<function>QueryXExtents16</function>
+</para>
+<blockquote>
+    <para>
+<emphasis remap='I'>fontid</emphasis>:  FONTID
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>range</emphasis>:  BOOL
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>chars</emphasis>:  LISTofCHAR2B
+    </para>
+</blockquote>
+<para>
+=&gt;
+</para>
+<blockquote>
+    <para>
+<emphasis remap='I'>extents</emphasis>:  LISTofXCHARINFO
+    </para>
+    <para>
+Errors:
+<function>Font</function>,
+<function>Range</function>,
+<function>Alloc</function>
+    </para>
+    <para>
+This request returns a list of glyph extents from the open
+font associated with FONTID for the series of characters
+specified by RANGE and CHARS.
+    </para>
+    <para>
+<!-- .sp -->
+If RANGE is True, each succeeding pair of elements in CHARS is
+treated as a range of characters for which extents should be
+returned.  If CHARS contains an odd number of elements, the
+font's XFONTINFO.CHAR-RANGE.MAX-CHAR is implicitly appended to
+the list.  If CHARS contains no elements, the list is
+implicitly replaced with the font's XFONTINFO.CHAR-RANGE.  If
+any of the resulting character ranges are invalid, a Range
+error is returned.  Otherwise, the character ranges are
+concatenated in the order given by CHARS to produce a set of
+character codes for which extents are returned.
+    </para>
+    <para>
+<!-- .sp -->
+If RANGE is False, then CHARS specifies the set of character
+codes for which extents are returned.  If CHARS is of
+zero length, then a zero-length list of extents is returned.
+    </para>
+    <para>
+<!-- .sp -->
+The extents for each character code in the resulting set (which
+may contain duplicates) are returned in the order in
+which the character codes appear in the set.
+At least one metric for each character shall be non-zero
+unless the character is not encoded in the font, in which case
+all-zero metrics are returned.
+A blank, zero-width character can be encoded
+with non-zero but equal left and right bearings.
+    </para>
+    <para>
+<!-- .sp -->
+If FONTID is not associated with any open fonts, a
+<function>Font</function>
+error is
+returned.  If RANGE is True and CHARS contains any invalid
+ranges, a
+<function>Range</function>
+error is returned.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "QueryXBitmaps8" "" "@DEF@" -->
+<function>QueryXBitmaps8</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>fontid</emphasis>:  FONTID
+    </para>
+    <para>
+<emphasis remap='I'>range</emphasis>:  BOOL
+    </para>
+    <para>
+<emphasis remap='I'>chars</emphasis>:  STRING8
+    </para>
+    <para>
+<emphasis remap='I'>format</emphasis>:  BITMAPFORMAT
+    </para>
+</blockquote>
+<para>
+=&gt;+
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>replies-following-hint</emphasis>:  CARD32
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>offsets</emphasis>:  LISTofOFFSET32
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>bitmaps</emphasis>:  LISTofBYTE
+    </para>
+    <para>
+Errors:
+<function>Font</function>,
+<function>Range</function>,
+<function>Format</function>,
+<function>Alloc</function>
+    </para>
+    <para>
+This request is equivalent to
+<function>QueryXBitmaps16 </function>
+except that it
+uses 1-byte character codes.
+    </para>
+</blockquote>
+<para>
+<!-- .LP -->
+<!-- .IN "QueryXBitmaps16" "" "@DEF@" -->
+<function>QueryXBitmaps16</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>fontid</emphasis>:  FONTID
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>range</emphasis>:  BOOL
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>chars</emphasis>:  LISTofCHAR2B
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>format</emphasis>:  BITMAPFORMAT
+    </para>
+</blockquote>
+<para>
+=&gt;+
+</para>
+<blockquote>
+    <para>
+<emphasis remap='I'>replies-following-hint</emphasis>:  CARD32
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>offsets</emphasis>:  LISTofOFFSET32
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>bitmaps</emphasis>:  LISTofBYTE
+    </para>
+    <para>
+Errors:
+<function>Font</function>,
+<function>Range</function>,
+<function>Format</function>,
+<function>Alloc</function>
+    </para>
+    <para>
+This request returns a list of glyph bitmaps from the open
+font associated with FONTID for the series of characters
+specified by RANGE and CHARS.
+    </para>
+    <para>
+<!-- .sp -->
+If RANGE is True, each succeeding pair of elements in CHARS is
+treated as a range of characters for which bitmaps should be
+returned.  If CHARS contains an odd number of elements, the
+font's XFONTINFO.CHAR-RANGE.MAX-CHAR is implicitly appended to
+the list.  If CHARS contains no elements, the list is
+implicitly replaced with the font's XFONTINFO.CHAR-RANGE.  If
+any of the resulting character ranges are invalid, a Range
+error is returned.  Otherwise, the character ranges are
+concatenated in the order given by CHARS to produce a set of
+character codes for which bitmaps are returned.
+    </para>
+    <para>
+<!-- .sp -->
+If RANGE is False, then CHARS specifies the set of character
+codes for which bitmaps are returned.  If CHARS is of zero
+length, then a single reply containing a zero-length list of
+offsets and bitmaps is returned.
+    </para>
+    <para>
+<!-- .sp -->
+If any of the resulting character ranges are invalid, a Range
+error is returned.  Otherwise, the resulting character ranges
+are concatenated in the order given by CHARS to produce a set
+of character codes for which bitmaps are returned.
+    </para>
+    <para>
+<!-- .sp -->
+The server is free to return the glyph bitmaps in multiple
+replies to reduce the amount of buffering that is necessary.
+In this situation, the set of characters obtained above is
+partitioned into an implementation-dependent number of
+ordered, non-overlapping subsets containing runs of one or
+more consecutive characters.  The global ordering of
+characters must be maintained such that concatenating the
+subsets in order that they were produced yields the original
+set.  A reply is generated for each subset, in the order that
+it was produced.
+    </para>
+    <para>
+<!-- .sp -->
+For each character in a subset, an image of that character's
+glyph is described by a rectangle of bits corresponding to the
+pixels specified by FORMAT.IMAGE-RECT.  Within the image, set
+and clear bits represent inked and non-inked pixels,
+respectively.
+    </para>
+    <para>
+<!-- .sp -->
+Each scanline of a glyph image, from top to bottom, is zero-padded
+on the right to a multiple of the number of bits specified by
+FORMAT.SCANLINE-PAD.  The scanline is then divided from left
+to right into a sequence of FORMAT.SCANLINE-UNIT bits.  The
+bits of each unit are then arranged such that the left-most
+pixel is stored in the most- or least-significant bit,
+according to FORMAT.BIT-ORDER-MSB.  The bytes of each unit are
+then arranged such that the most- or least-significant byte,
+according to FORMAT.BYTE-ORDER-MSB, is transmitted first.
+Finally, the units are arranged such that the left-most is
+transmitted first and the right-most is transmitted last.
+    </para>
+    <para>
+<!-- .sp -->
+The individual images within a subset are then concatenated in
+a server-dependent order to form the BITMAPS data of the
+reply.  If a glyph image is duplicated within a reply, the
+server is free to return fewer (but at least one) copies of
+the image.  If a character is not encoded within the font, a
+zero-length bitmap is substituted for this character.  Each
+glyph image must begin at a bit position that is a multiple of
+the FORMAT.SCANLINE-UNIT.
+    </para>
+    <para>
+<!-- .sp -->
+The OFFSETS array in a reply contains one entry for each
+character in the subset being returned, in the order that the
+characters appear in the subset.  Each entry specifies the
+starting location in bytes and size in bytes of the
+corresponding glyph image in the BITMAPS data of that reply
+(i.e. an offset may not refer to data in another reply).
+    </para>
+    <para>
+<!-- .sp -->
+The REPLIES-FOLLOWING-HINT field in all but the last reply
+contains a positive value that specifies the number of replies
+that are likely, but not required, to follow.  In the last
+reply, which may contain data for zero or more characters,
+this field is set to zero.
+    </para>
+    <para>
+<!-- .sp -->
+If FONTID is not associated with any open fonts, a Font error
+is returned.  If RANGE is True and CHARS contains any invalid
+ranges, a Range error is returned.  If FORMAT is invalid, a
+Format error is returned.
+    </para>
+</blockquote>
+<para>
+<!-- .LP -->
+<!-- .IN "CloseFont" "" "@DEF@" -->
+<function>CloseFont</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>fontid</emphasis>:  FONTID
+    </para>
+    <para>
+Errors:
+<function>Font</function>,
+<function>Alloc</function>
+    </para>
+    <para>
+This request indicates that the specified FONTID should no
+longer be associated with an open font.  The server is free to
+release any client-specific storage or licenses allocated for
+the font.  The client may reuse the value of FONTID in a
+subsequent
+<function>OpenBitmapFont </function>
+request.
+    </para>
+    <para>
+<!-- .sp -->
+If FONTID is not associated with any open fonts, a
+<function> Font </function>
+error is returned.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<function>"close connection"</function>
+<!-- .IN "close connection" "" "@DEF@" -->
+</para>
+
+<blockquote>
+    <para>
+When a connection is closed, a
+<function>CloseFont </function>
+is done on all fonts
+that are open on the connection.  In addition, the server is
+free to release any storage or licenses allocated on behalf of
+the client that made the connection.
+    </para>
+</blockquote>
+</sect2>
+
+<sect2 id="errors">
+<title>Errors</title>
+<!-- .XS -->
+<!-- (SN Errors -->
+<!-- .XE -->
+<para>
+All errors are at least 16 bytes long and contain the following fields:
+</para>
+<blockquote>
+    <para>
+<emphasis remap='I'>type</emphasis>:  CARD8  value of 1
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>error-code</emphasis>:  CARD8
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>sequence-number</emphasis>:  CARD16
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>length</emphasis>:  CARD32
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>timestamp</emphasis>:  TIMESTAMP
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>major-opcode</emphasis>:  CARD8
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>minor-opcode</emphasis>:  CARD8
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>data-or-unused</emphasis>:  CARD16
+    </para>
+</blockquote>
+<para>
+<!-- .LP -->
+The TYPE field has a value of one.  The ERROR-CODE field specifies which error
+occurred.  Core errors codes are in the range 0 through 127, extension error
+codes are in the range 128 through 255.  The SEQUENCE-NUMBER field contains the
+least significant 16 bits of the sequence number of the request that caused the
+error.  The LENGTH field specifies the length of the error packet in 4-byte
+units and must have a value of at least 4.  The TIMESTAMP specifies the server
+time when the error occurred.  The MAJOR-OPCODE and MINOR-OPCODE (zero for core
+requests) fields specify the type of request that generated the error.  The
+DATA-OR-UNUSED field may be used for 16 bits of error-specific information.  If
+LENGTH is greater than four, these fields are followed by (LENGTH - 4) * 4
+bytes of extra data.
+</para>
+<para>
+<!-- .LP -->
+The following errors are defined for the core protocol:
+</para>
+<para>
+<!-- .LP -->
+<!-- .IN "Error Codes" "Request" "@DEF@" -->
+<function>Request</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>data-or-unused</emphasis>:  CARD16     unused
+    </para>
+    <para>
+This error is generated by any request that has an unknown
+combination of major and minor request numbers, or by any
+extension request that is issued before a
+<function>QueryExtension </function>
+of that extension.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "Error Codes" "Format" "@DEF@" -->
+<function>Format</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>data-or-unused</emphasis>:  CARD16     unused
+    </para>
+    <para>
+<emphasis remap='I'>format</emphasis>:  BITMAPFORMAT     bad format value
+    </para>
+    <para>
+This error is generated by the use of an invalid BITMAPFORMAT
+in the
+<function>OpenBitmapFont</function>,
+<function>QueryXBitmaps8</function>, and
+<function>QueryXBitmaps16</function>
+requests.
+The value that caused the error is included as extra data.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "Error Codes" "Font" "@DEF@" -->
+<function>Font</function>
+</para>
+<blockquote>
+    <para>
+<emphasis remap='I'>data-or-unused</emphasis>:  CARD16     unused
+    </para>
+    <para>
+<emphasis remap='I'>fontid</emphasis>:  FONTID     bad font identifier
+    </para>
+    <para>
+This error is generated by an invalid FONTID in the
+<function>QueryXInfo</function>,
+<function>QueryXExtents8</function>,
+<function>QueryXExtents16</function>,
+<function>QueryXBitmaps8</function>,
+<function>QueryXBitmaps16</function>
+and
+<function>CloseFont </function>
+requests.  The value that caused
+the error is included as extra data.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "Error Codes" "Range" "@DEF@" -->
+<function>Range</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>data-or-unused</emphasis>:  CARD16     unused
+    </para>
+    <para>
+<emphasis remap='I'>range</emphasis>:  RANGE     bad range
+    </para>
+    <para>
+This error is generated by an invalid RANGE in the
+<function> QueryXExtents8</function>,
+<function>QueryXExtents16</function>,
+<function>QueryXBitmaps8</function>
+and
+<function>QueryXBitmaps16 </function>
+requests.  The
+value that caused the error is included as extra data.
+    </para>
+</blockquote>
+<para>
+<!-- .LP -->
+<!-- .IN "Error Codes" "EventMask" "@DEF@" -->
+<function>EventMask</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>data-or-unused</emphasis>:  CARD16     unused
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>event-mask</emphasis>:  EVENTMASK     bad event mask
+    </para>
+    <para>
+This error is generated by an invalid EVENTMASK in the
+<function>SetEventMask </function>
+request.  The value that caused the error is
+included as extra data.
+    </para>
+</blockquote>
+<para>
+<!-- .LP -->
+<!-- .IN "Error Codes" "AccessContext" "@DEF@" -->
+<function>AccessContext</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>data-or-unused</emphasis>:  CARD16     unused
+    </para>
+    <para>
+<emphasis remap='I'>ac</emphasis>:  ACCESSCONTEXT     unaccepted
+<function>AccessContext</function>
+    </para>
+    <para>
+This error is generated by an invalid ACCESSCONTEXT in the
+<function>FreeAC </function>
+or
+<function>SetAuthorization </function>
+request or by an
+<function>OpenBitmapFont</function>
+request performed without sufficient authorization.  In the
+first two cases, the ACCESSCONTEXT of the errant request is
+returned as extra data.  In the third case, the current
+ACCESSCONTEXT is returned as extra data.
+    </para>
+</blockquote>
+<para>
+<!-- .LP -->
+<!-- .IN "Error Codes" "IDChoice" "@DEF@" -->
+<function>IDChoice</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>data-or-unused</emphasis>:  CARD16     unused
+    </para>
+    <para>
+<emphasis remap='I'>id</emphasis>:  ID     bad identifier
+    </para>
+    <para>
+This error is generated by an invalid or already associated
+ACCESSCONTEXT identifier in a
+<function>CreateAC </function>
+request or FONTID identifier
+in an
+<function>OpenBitmapFont </function>
+request.  The value that caused the error
+is included as extra data.
+    </para>
+</blockquote>
+<para>
+<!-- .LP -->
+<!-- .IN "Error Codes" "Name" "@DEF@" -->
+<function>Name</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>data-or-unused</emphasis>:  CARD16     unused
+    </para>
+    <para>
+This error is generated by a font name pattern that matches
+no fonts in an
+<function>OpenBitmapFont </function>
+request or no catalogue names in a
+<function>SetCatalogues </function>
+request.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "Error Codes" "Resolution" "@DEF@" -->
+<function>Resolution</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>data-or-unused</emphasis>:  CARD16     X value of errant resolution
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>y-resolution</emphasis>:  CARD16          Y value of errant resolution
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>point-size</emphasis>:  CARD16          point size of errant resolution
+    </para>
+    <para>
+This error is generated in response to an invalid RESOLUTION
+structure in a
+<function>SetResolution </function>
+request.  The value that caused the
+error is included in the DATA-OR-UNUSED field and as extra data.
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP      -->
+<!-- .IN "Error Codes" "Alloc" "@DEF@" -->
+<function>Alloc</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>data-or-unused</emphasis>:  CARD16     unused
+    </para>
+    <para>
+This error is generated by any request for which the server
+lacks sufficient resources (especially memory).
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "Error Codes" "Length" "@DEF@" -->
+<function>Length</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>data-or-unused</emphasis>:  CARD16     unused
+    </para>
+    <para>
+<emphasis remap='I'>length</emphasis>:  CARD32     bad length value
+    </para>
+    <para>
+This error is generated by any request that has a length field
+greater than (MAXIMUM-REQUEST-LENGTH * 4) bytes.  The value that
+caused the error is included as extra data.
+    </para>
+</blockquote>
+<para>
+<!-- .LP -->
+<!-- .IN "Error Codes" "Implementation" "@DEF@" -->
+<function>Implementation</function>
+</para>
+
+<blockquote>
+    <para>
+<emphasis remap='I'>data-or-unused</emphasis>:  CARD16     unused
+    </para>
+    <para>
+This error may be generated in response to any request that
+the server is unable to process because it is deficient.  Use
+of this error is highly discouraged and indicates lack of
+conformance to the protocol.
+<!-- .sp -->
+Additional errors may be defined by extensions.
+    </para>
+</blockquote>
+</sect2>
+
+<sect2 id="events">
+<title>Events</title>
+<!-- .XS -->
+<!-- (SN Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Events may be generated in response to requests or at the server's discretion
+after the initial connection setup information has been exchanged.  Each event
+is at least 12 bytes long and contains the following fields:
+</para>
+<blockquote>
+    <para>
+<!-- .TA .75i .75i .75i .75i -->
+<emphasis remap='I'>type</emphasis>:  CARD8     value of 2
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>event-code</emphasis>:  CARD8
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>sequence-number</emphasis>:  CARD16
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>length</emphasis>:  CARD32
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>timestamp</emphasis>:  TIMESTAMP
+    </para>
+</blockquote>
+<para>
+<!-- .LP -->
+The TYPE field contains the value 2.  The EVENT-CODE field specifies the number
+of the event and is in the range 0-127 for core events or the range 128-255 for
+extensions.  The SEQUENCE-NUMBER field specifies the least significant 16 bits
+of the sequence number of the last request to have been processed by the
+server.  The LENGTH field specifies the number of 4-byte units in this event
+packet and must always have a value of at least 3.  The TIMESTAMP field
+specifies the server time when the event occurred.  If LENGTH is greater than
+three, these fields are followed by (LENGTH - 3) * 4 bytes of additional data.
+</para>
+<para>
+<!-- .LP -->
+Events are described using the following syntax:
+</para>
+<literallayout class="monospaced">
+<function>EventName</function>
+         <emphasis remap='I'>arg1</emphasis>: type1
+         ...
+         <emphasis remap='I'>argN</emphasis>: typeN
+
+          Description
+</literallayout>
+
+<para>
+If an event does not provide any extra arguments, the
+<emphasis remap='I'>arg1</emphasis>...<emphasis remap='I'>argN</emphasis>
+lines are omitted from the description.
+</para>
+<para>
+<!-- .LP -->
+The core X Font Service protocol defines the following events:
+</para>
+<para>
+<!-- .LP -->
+<!-- .IN "KeepAlive" "" "@DEF@" -->
+<function>KeepAlive</function>
+</para>
+<blockquote>
+    <para>
+This unsolicited, nonmaskable event may be sent by the
+server to verify that the connection has not been broken
+(for transports that do not provide this information).
+Clients should acknowledge receipt of this request
+by sending any request (such as
+<function>NoOp</function>
+ ")."
+    </para>
+</blockquote>
+
+<para>
+<!-- .LP -->
+<!-- .IN "CatalogueListNotify" "" "@DEF@" -->
+<function>CatalogueListNotify</function>
+</para>
+<blockquote>
+    <para>
+<emphasis remap='I'>added</emphasis>:  BOOL
+    </para>
+    <para>
+<emphasis remap='I'>deleted</emphasis>:  BOOL
+    </para>
+    <para>
+This event is sent to clients that have included
+<function>CatalogueListChangeMask </function>
+in their core event mask
+whenever the list of catalogues that are available has
+changed.  The ADDED field is True if new catalogues have
+been added to the server, otherwise it is False.  The
+DELETED field is True if any existing catalogues have
+been removed from the server, otherwise it is False.
+    </para>
+</blockquote>
+<para>
+<!-- .LP      -->
+<!-- .IN "FontListNotify" "" "@DEF@" -->
+<function>FontListNotify</function>
+</para>
+<blockquote>
+    <para>
+<emphasis remap='I'>added</emphasis>:  BOOL
+    </para>
+    <para>
+<!-- .br -->
+<emphasis remap='I'>deleted</emphasis>:  BOOL
+    </para>
+    <para>
+This event is sent to clients that have included
+<function>FontListChangeMask </function>
+in their event mask whenever the
+list of fonts that are provided by the currently selected
+catalogues has changed.  The ADDED field is True if new
+fonts have been added to any of the catalogues currently
+used by the client, otherwise it is False.  The DELETED
+field is True if any existing fonts have been removed
+from any of catalogues used by the client, otherwise it
+is False.
+    </para>
+    <para>
+<!-- .sp -->
+Additional events may be defined by extensions.
+    </para>
+</blockquote>
+</sect2>
+</sect1>
+
+<sect1 id="protocol_encoding">
+<title>Protocol Encoding</title>
+<!-- .XS -->
+<!-- (SN Protocol Encoding -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Numbers that are prefixed with "#x" are in hexadecimal (base 16).  All other
+numbers are in decimal.  Requests, replies, errors, events, and compound types
+are described using the syntax:
+</para>
+<!-- .RS -->
+<literallayout class="monospaced">
+
+    Name
+     <emphasis remap='I'>count</emphasis>          <emphasis remap='I'>contents</emphasis>     <emphasis remap='I'>name</emphasis>
+     ...
+     <emphasis remap='I'>count</emphasis>          <emphasis remap='I'>contents</emphasis>     <emphasis remap='I'>name</emphasis>
+</literallayout>
+
+<!-- .RE -->
+<para>
+where COUNT is the number of bytes in the data stream occupied by this
+field, CONTENTS is the name of the type as given in Section 4 or the value if
+this field contains a constant, and NAME is a description of this field.
+</para>
+<para>
+<!-- .LP -->
+Objects containing counted lists use a lowercase single-letter variable (whose
+scope is limited to the request, reply, event, or error in which it is found)
+to represent the number of objects in the list.  These variables, and any
+expressions in which they are used, should be treated as unsigned integers.
+Multiple copies of an object are indicated by CONTENTS prefix "LISTof".
+</para>
+<para>
+<!-- .LP -->
+Unused bytes (whose value is undefined) will have a blank CONTENTS field and a
+NAME field of "unused".  Zeroed bytes (whose value must be zero) will have a
+blank CONTENTS field and a NAME field of "zero".  The expression pad(e)
+refers to the number of bytes needed to round a value "e" up to the closed
+multiple of four:
+</para>
+<!-- .RS -->
+<literallayout class="monospaced">
+
+     pad(e) = (4 - (e mod 4)) mod 4
+</literallayout>
+
+<sect2 id="data_types_2">
+<title>Data Types</title>
+<!-- .XS -->
+<!-- (SN Data Types -->
+<!-- .XE -->
+<!-- .sp 6p -->
+<literallayout class="monospaced">
+ACCESSCONTEXT
+
+4 CARD32 access context with at least one of the following bits set:
+
+#x1fffffff
+
+but none of the following bits set:
+
+#xe0000000               zero
+
+
+ALTERNATESERVER
+1     BOOL               subset
+1     n                  length of name
+n     STRING8            name
+p                        unused, p=pad(n+2)
+
+AUTH
+
+2     n                  length of name
+2     d                  length of data
+n     STRING8            name
+p                        unused, p=pad(n)
+d     STRING8            data
+q                        unused, q=pad(d)
+
+
+BITMAPFORMAT
+
+4 CARD32 value, union of the following bits:
+     #x00000001           ByteOrderMSB
+     #x00000002           BitOrderMSB
+     #x00000000           ImageRectMin
+     #x00000004           ImageRectMaxWidth
+     #x00000008           ImageRectMax
+     #x00000000           ScanlinePad8
+     #x00000100           ScanlinePad16
+     #x00000200           ScanlinePad32
+     #x00000300           ScanlinePad64
+     #x00000000           ScanlineUnit8
+     #x00001000           ScanlineUnit16
+     #x00002000           ScanlineUnit32
+     #x00003000           ScanlineUnit64
+
+except for the following bits which must be zero:
+
+     #xffffccf0           zero
+
+and the following of which at most one bit may be set:
+
+     #x0000000c at most one bit can be set
+
+
+BITMAPFORMATMASK
+
+4 CARD32 value, mask of the following bits:
+
+     #x00000001           ByteOrderMask
+     #x00000002           BitOrderMask
+     #x00000004           ImageRectMask
+     #x00000008           ScanlinePadMask
+     #x00000010           ScanlineUnitMask
+
+except for the following bits which must be zero:
+
+     #xffffffe0           zero
+
+BOOL
+
+1    BOOL       boolean, one of the following values:
+0    False
+1    True
+
+BYTE
+1    BYTE       unsigned byte of data
+
+CARD8
+1    CARD8       8-bit unsigned integer
+
+CARD16
+2    CARD16      16-bit unsigned integer
+
+CARD32
+4    CARD32      32-bit unsigned integer
+
+CHAR2B
+1    CARD8       byte1
+1    CARD8       byte2
+
+EVENTMASK
+4    CARD32 event mask
+     for core events, this is union of the following bits:
+
+     #00000001   CatalogueListChangeMask
+     #00000002   FontListChangeMask
+
+but none of the following bits set:
+
+     #fffffffc
+
+extensions define their own sets of bits
+
+FONTID
+
+4 CARD32 font identifier with at least one of
+the following bits set:
+
+     #x1fffffff
+
+but none of the following bits set:
+
+     #xe0000000   zero
+
+INT8
+1    INT8         8-bit signed integer
+
+INT16
+2    INT16         16-bit signed integer
+
+INT32
+4    INT32         32-bit signed integer
+
+OFFSET32
+4    CARD32         position (or integer value)
+4    CARD32         length
+
+PROPINFO
+4    n                 number of PROPOFFSET components
+4    m                 number of bytes of property data
+20*n PROPOFFSET         property offsets into data block
+m    LISTofBYTE         property data block
+
+PROPOFFSET
+8    OFFSET32         name in data block
+8    OFFSET32         value in data block
+
+1 CARD8 type, one of the following values:
+0    String
+1    Unsigned
+2    Signed
+3    zero
+
+RANGE
+2    CHAR2B                 minimum character code
+2    CHAR2B         maximum character code
+
+RESOLUTION
+2    CARD16 x resolution in pixels per inch
+2    CARD16 y resolution in pixels per inch
+2    CARD16 point size in decipoints
+
+STRNAME
+1    n length of name
+n    STRING8 name
+
+STRING8
+n    LISTofBYTE         array of 8-bit character values
+
+TIMESTAMP
+4    CARD32         milliseconds since server time origin
+
+XCHARINFO
+2    INT16         left bearing
+2    INT16         right bearing
+2    INT16         width
+2    INT16         ascent
+2    INT16         descent
+2    CARD16         attributes
+
+XFONTINFO
+4 CARD32 flags, union of the following bits:
+     #x00000001         AllCharactersExist
+     #x00000002         InkInside
+     #x00000004         HorizontalOverlap
+
+but none of the following bits set:
+
+     #xfffffff8         zero
+4    RANGE              range of characters in font
+1    CARD8              drawing direction
+     0             LeftToRight
+     1             RightToLeft
+1                       unused
+2    CHAR2B             default character
+12   XCHARINFO          minimum bounds
+12   XCHARINFO          maximum bounds
+2    INT16              font ascent
+2    INT16              font descent
+n    PROPINFO           property data
+</literallayout>
+</sect2>
+
+<sect2 id="requests_2">
+<title>Requests</title>
+<para><emphasis role="bold">open connection</emphasis></para>
+<literallayout class="monospaced">
+1     BYTE                   byteorder, one of the values:
+      #x42                   MostSignificant Byte first
+      #x6c                   LeastSignificant Byte first
+1     CARD8                  numberof auth in auth-data
+2     2                      client-major-protocol-version
+2     0                      client-minor-protocol-version
+2     a/4 lengthof           auth-data
+a     LISTofAUTH             auth-data
+=>
+2     CARD16                 status
+0                            Success
+1                            Continue
+2                            Busy
+3                            Denied
+2     2                      major version
+2     0                      version
+1     CARD8                  numberof alternate-servers-hint
+1     CARD8                  authorization-index
+2     a/4                    lengthof alternate-servers-hint
+2     (d+q)/4                lengthof authorization-data
+a     LISTofALTERNATESERVER  alternate-servers-hint
+d     LISTofBYTE             authorization-data
+q                            unused, q=pad(d)
+</literallayout>
+
+<para>
+If STATUS is Busy or Denied, the protocol stops and the connection is
+closed. If STATUS is Continue, the client is expected to respond with
+additional data, to which the server responds with
+a new status value and more data. This dialog continues until the status
+is set to Success, or until the server sets STATUS to Busy or Denied
+and closes the connection:
+</para>
+
+<literallayout class="monospaced">
+->
+4     1+(d+q)/4              length
+d     LISTofBYTE             more-authorization-data
+q                            unused, q=pad(d)
+=>
+4     2+(d+q)/4              length
+2     CARD16                 status
+        0                    Success
+      1                      Continue
+      2                      Busy
+      3                      Denied
+      2                      unused
+d     LISTofBYTE             more-authorization-data
+q                            unused, q=pad(d)
+</literallayout>
+<para>
+When STATUS is Success, the protocol resumes with the following
+sent by the server:
+</para>
+
+<literallayout class="monospaced">
+4     3+(v+w)/4              length of rest of data
+2     CARD16                 maximum-request-length
+2     v                      length of vendor string
+4     CARD32                 release-number
+v     STRING8                vendor-string
+w                            unused, w=pad(v)
+</literallayout>
+<para>
+Once the connection has been established, the client may send the
+following requests:
+</para>
+
+<literallayout class="monospaced">
+<emphasis role="bold">NoOp</emphasis>
+1   0                        major-opcode
+1                            unused
+2   1                        length
+
+<emphasis role="bold">ListExtensions</emphasis>
+1   1                        major-opcode
+1                            unused
+2   1                        length
+=>
+1   0                        type reply
+1   CARD8                    numberof names
+2   CARD16                   sequence-number
+4   2+(n+p)/4                length
+n   LISTofSTRNAME            names
+p                            unused, p=pad(n)
+
+<emphasis role="bold">QueryExtension</emphasis>
+1   2                        major-opcode
+1   n                        length of name
+2   1+(n+p)/4                length
+n   STRING8                  name
+p                            unused, p=pad(n)
+=>
+1   0                        type reply
+1   BOOL                     present
+2   CARD16                   sequence-number
+4   5                        length
+2   CARD16                   major-version
+2   CARD16                   minor-version
+1   CARD8                    major-opcode
+1   CARD8                    first-event
+1   CARD8                    number-events
+1   CARD8                    first-error
+1   CARD8                    number-errors
+3                            unused
+
+<emphasis role="bold">ListCatalogues</emphasis>
+1   3                        major-opcode
+1                            unused
+2   3+(n+p)/4                length
+4   CARD32                   max-names
+2   n                        length of pattern
+2                            unused
+n   STRING8                  pattern
+p                            unused, p=pad(n)
+=>+
+1   0                        type reply
+1                            unused
+2   CARD16                   sequence-number
+4   4+(n+p)/4                length
+4   CARD32                   replies-following-hint
+4   CARD32                   numberof catalogue-names
+n   LISTofSTRNAME            catalogue-names
+p                            unused, p=pad(n)
+
+<emphasis role="bold">SetCatalogues</emphasis>
+1   4                        major-opcode
+1   CARD8                    numberof catalogue-names
+2   1+(n+p)/4                length
+n   LISTofSTRNAME            catalogue-names
+p                            unused, p=pad(n)
+
+<emphasis role="bold">GetCatalogues</emphasis>
+1   5                        major-opcode
+1                            unused
+2   1                        length
+=>
+1   0                        type reply
+1   CARD8                    numberof catalogue-names
+2   CARD16                   sequence-number
+4   2+(n+p)/4                length
+n   LISTofSTRNAME            catalogue-names
+p                            unused, p=pad(n)
+
+<emphasis role="bold">SetEventMask</emphasis>
+1   6                        major-opcode
+1   CARD8                    extension-opcode
+2   2                        length
+4   EVENTMASK                event-mask
+
+<emphasis role="bold">GetEventMask</emphasis>
+1   7                        major-opcode
+1   CARD8                    extension-opcode
+2   1                        length
+=>
+1   0                        type reply
+1                            unused
+2   CARD16                   sequence-number
+4   3                        length
+4   EVENTMASK                event-mask
+
+<emphasis role="bold">CreateAC</emphasis>
+1   8                        major-opcode
+1   CARD8                    numberof authorization-protocols
+2   2+a/4                    length
+4   ACCESSCONTEXT            ac
+a   LISTofAUTH               authorization-protocols
+=>
+1   0                        type reply
+1   CARD8                    authorization-index
+2   CARD16                   sequence-number
+4   3+(d+q)/4                length
+2   CARD16                   status
+    0 Success
+    1 Continue
+    2 Busy
+    3 Denied
+2                            unused
+d   LISTofBYTE               authorization-data
+q                            unused, q=pad(d)
+</literallayout>
+
+<para>
+If STATUS is Continue, the client is expected to respond with additional
+data, to which the server
+responds with a new status value and more data. This dialog continues
+until the status is set to
+Success, Busy, or Denied at which point the request is finished.
+</para>
+
+<literallayout class="monospaced">
+->
+4   1+(d+q)/4                length
+d   LISTofBYTE               more-authorization-data
+q                            unused, q=pad(d)
+=>
+4   2+(d+q)/4                length
+2   CARD16                   status
+    0 Success
+    1 Continue
+    2 Busy
+    3 Denied
+2                            unused
+d   LISTofBYTE               authorization-data
+q                            unused, q=pad(d)
+
+<emphasis role="bold">FreeAC</emphasis>
+1   9                        major-opcode
+1                            unused
+2   2                        length
+4   ACCESSCONTEXT            ac
+
+<emphasis role="bold">SetAuthorization</emphasis>
+1   10                       major-opcode
+1                            unused
+2   2                        length
+4   ACCESSCONTEXT            ac
+
+<emphasis role="bold">SetResolution</emphasis>
+1   11                       major-opcode
+1   n                        number of resolutions
+2   1+(6*n+p)/4              length
+6*n LISTofRESOLUTION         resolutions
+p   p=pad(6*n)
+
+<emphasis role="bold">GetResolution</emphasis>
+1   12                       major-opcode
+1                            unused
+2   1                        length
+=>
+1   0                        type reply
+1   n                        number of resolutions
+2   CARD16                   sequence-number
+4   2+(6*n+p)/4              length
+6*n LISTofRESOLUTION         resolutions
+p   p=pad(6*n)
+
+<emphasis role="bold">ListFonts</emphasis>
+1   13                       major-opcode
+1                            unused
+2   3+(n+p)/4                length
+4   CARD32                   max-names
+2   n                        length of pattern
+2                            unused
+n   STRING8                  pattern
+p                            unused, p=pad(n)
+=>+
+1   0                        type reply
+1                            unused
+2   CARD16                   sequence-number
+4   4+(n+p)/4                length
+4   CARD32                   replies-following-hint
+4   CARD32                   numberof font-names
+n   LISTofSTRNAME            font-names
+p                            unused, p=pad(n)
+
+<emphasis role="bold">ListFontsWithXInfo</emphasis>
+1   14                       major-opcode
+1                            unused
+2   3+(n+p)/4                length
+4   CARD32                   max-names
+2   n                        length of pattern
+2                            unused
+n   STRING8                  pattern
+p                            unused, p=pad(n)
+=>+(except for last in series)
+1   0                        type reply
+1   n                        length of name
+2   CARD16                   sequence-number
+4   3+(n+p+f)/4              length
+4   CARD32                   replies-hint
+f   XFONTINFO                fontinfo
+n   STRING8                  name
+p                            unused, p=pad(n)
+=>(last in series)
+1   0                        type reply
+1   0                        last-reply indicator
+2   CARD16                   sequence-number
+4   2                        reply length
+
+<emphasis role="bold">OpenBitmapFont</emphasis>
+1   15                       major-opcode
+1                            unused
+2   4+(n+p)/4                length
+4   FONTID                   fontid
+4   BITMAPFORMATMASK         format-mask
+4   BITMAPFORMAT             format
+n   STRNAME                  pattern
+p                            unused, p=pad(n)
+=>
+1   0                        type reply
+1   BOOL                     otherid-valid
+2   CARD16                   sequence-number
+4   4                        length
+4   FONTID                   otherid
+1   BOOL                     cachable
+3                            unused
+
+<emphasis role="bold">QueryXInfo</emphasis>
+1   16                       major-opcode
+1                            unused
+2   2                        length
+4   FONTID                   fontid
+=>
+1   0                        type reply
+1                            unused
+2   CARD16                   sequence-number
+4   2+f/4                    length
+f   XFONTINFO                fontinfo
+p                            unused, p=pad(f)
+
+<emphasis role="bold">QueryXExtents8</emphasis>
+1   17                       major-opcode
+1   BOOL                     range
+2   3+(n+p)/4                length
+4   FONTID                   fontid
+4   n                        number chars entries
+n   STRING8                  chars
+p                            unused, p=pad(n)
+=>
+1   0                        type reply
+1                            unused
+2   CARD16                   sequence-number
+4   3+3*n                    length
+4   n                        number of extents
+12*n LISTofXCHARINFO         extents
+
+<emphasis role="bold">QueryXExtents16</emphasis>
+1   18                       major-opcode
+1   BOOL                     range
+2   3+(2*n+p)/4              length
+4   FONTID                   fontid
+4   n                        number chars entries
+2*n                          LISTofCHAR2B chars
+p                            unused, p=pad(2*n)
+=>
+1   0                        type reply
+1                            unused
+2   CARD16                   sequence-number
+4   3+3*n                    length
+4   n                        number of extents
+12*n LISTofXCHARINFO         extents
+
+<emphasis role="bold">QueryXBitmaps8</emphasis>
+1   19                       major-opcode
+1   BOOL                     range
+2   4+(n+p)/4                length
+4   FONTID                   fontid
+4   BITMAPFORMAT             format
+4   n                        number of chars entries
+n   STRING8                  chars
+p                            unused, p=pad(n)
+=>+
+1   0                        type reply
+1                            unused
+2   CARD16                   sequence-number
+4   5+2*n+(m+p)/4            length
+4   CARD32                   replies-following-hint
+4   n                        number of offsets
+4   m                        number of bytes of glyph images
+8*n LISTofOFFSET32           offsets
+m   LISTofBYTE               glyphimages
+p                            unused, p=pad(m)
+
+<emphasis role="bold">QueryXBitmaps16</emphasis>
+1   20                       major-opcode
+1   BOOL                     range
+2   4+(2*n+p)/4              length
+4   FONTID                   fontid
+4   BITMAPFORMAT             format
+4   n                        number of chars entries
+2*n LISTofCHAR2B             chars
+p                            unused, p=pad(2*n)
+=>
+1   0                        type reply
+1                            unused
+2   CARD16                   sequence-number
+4   5+2*n+(m+p)/4            length
+4   CARD32                   replies-following-hint
+4   n                        number of offsets
+4   m                        number of bytes of glyph images
+8*n LISTofOFFSET32           offsets
+m   LISTofBYTE               glyphimages
+p                            unused, p=pad(m)
+
+<emphasis role="bold">CloseFont</emphasis>
+1   21                       major-opcode
+1                            unused
+2   2                        length
+4   FONTID                   fontid
+</literallayout>
+</sect2>
+
+<sect2 id="errors_2">
+<title>Errors</title>
+<literallayout class="monospaced">
+
+<emphasis role="bold">Request</emphasis>
+1   1                        type error
+1   0                        Request
+2   CARD16                   sequence-number
+4   4                        length
+4   TIMESTAMP                timestamp
+1   CARD8                    major-opcode
+1   CARD8                    minor-opcode
+2                            unused
+
+<emphasis role="bold">Format</emphasis>
+1   1                        type error
+1   1                        Format
+2   CARD16                   sequence-number
+4   5                        length
+4   TIMESTAMP                timestamp
+1   CARD8                    major-opcode
+1   CARD8                    minor-opcode
+2                            unused
+4   BITMAPFORMAT             bad-format
+
+<emphasis role="bold">Font</emphasis>
+1   1                        type error
+1   2                        Font
+2   CARD16                   sequence-number
+4   5                        length
+4   TIMESTAMP                timestamp
+1   CARD8                    major-opcode
+1   CARD8                    minor-opcode
+2                            unused
+4   FONTID bad-fontid
+
+<emphasis role="bold">Range</emphasis>
+1   1                        type error
+1   3                        Range
+2   CARD16                   sequence-number
+4   5                        length
+4   TIMESTAMP                timestamp
+1   CARD8                    major-opcode
+1   CARD8                    minor-opcode
+2                            unused
+4   RANGE                    bad-range
+
+<emphasis role="bold">EventMask</emphasis>
+1   1                        type error
+1   4                        EventMask
+2   CARD16                   sequence-number
+4   5                        length
+4   TIMESTAMP                timestamp
+1   CARD8                    major-opcode
+1   CARD8                    minor-opcode
+2                            unused
+4   EVENTMASK                event-mask
+
+<emphasis role="bold">AccessContext</emphasis>
+1   1                        type error
+1   5                        AccessContext
+2   CARD16                   sequence-number
+4   5                        length
+4   TIMESTAMP                timestamp
+1   CARD8                    major-opcode
+1   CARD8                    minor-opcode
+2                            unused
+4   ACCESSCONTEXT            access context
+
+<emphasis role="bold">IDChoice</emphasis>
+1   1                        type error
+1   6                        IDChoice
+2   CARD16                   sequence-number
+4   5                        length
+4   TIMESTAMP                timestamp
+1   CARD8                    major-opcode
+1   CARD8                    minor-opcode
+2                            unused
+4   FONTID                   bad-fontid
+
+<emphasis role="bold">Name</emphasis>
+1   1                        type error
+1   7                        Name
+2   CARD16                   sequence-number
+4   4                        length
+4   TIMESTAMP                timestamp
+1   CARD8                    major-opcode
+1   CARD8                    minor-opcode
+2                            unused
+
+<emphasis role="bold">Resolution</emphasis>
+1   1                        type error
+1   8                        Resolution
+2   CARD16                   sequence-number
+4   5                        length
+4   TIMESTAMP                timestamp
+1   CARD8                    major-opcode
+1   CARD8                    minor-opcode
+6   RESOLUTION               resolution
+
+<emphasis role="bold">Alloc</emphasis>
+1   1                        type error
+1   9                        Alloc
+2   CARD16                   sequence-number
+4   4                        length
+4   TIMESTAMP                timestamp
+1   CARD8                    major-opcode
+1   CARD8                    minor-opcode
+2                            unused
+
+<emphasis role="bold">Length</emphasis>
+1   1                        type error
+1   10                       Length
+2   CARD16                   sequence-number
+4   5                        length
+4   TIMESTAMP                timestamp
+1   CARD8                    major-opcode
+1   CARD8                    minor-opcode
+2                            unused
+4   CARD32                   bad-length
+
+<emphasis role="bold">Implementation</emphasis>
+1   1                        type error
+1   11                       Implementation
+2   CARD16                   sequence-number
+4   4                        length
+4   TIMESTAMP                timestamp
+1   CARD8                    major-opcode
+1   CARD8                    minor-opcode
+2                            unused
+
+</literallayout>
+</sect2>
+
+<sect2 id="events_2">
+<title>Events</title>
+<literallayout class="monospaced">
+<emphasis role="bold">KeepAlive</emphasis>
+1   2                        type event
+1   0                        event KeepAlive
+2   CARD16                   sequence-number
+4   3                        length
+4   TIMESTAMP                timestamp
+
+<emphasis role="bold">CatalogueListNotify</emphasis>
+1   2                        type event
+1   1                        event CatalogueListNotify
+2   CARD16                   sequence-number
+4   4                        length
+4   TIMESTAMP                timestamp
+1   BOOL                     added
+1   BOOL                     deleted
+2                            unused
+
+<emphasis role="bold">FontListNotify</emphasis>
+1   2                        type event
+1   2                        event FontListNotify
+2   CARD16                   sequence-number
+4   4                        length
+4   TIMESTAMP                timestamp
+1   BOOL                     added
+1   BOOL                     deleted
+2                            unused
+
+</literallayout>
+</sect2>
+</sect1>
+
+<sect1 id="acknowledgements">
+<title>Acknowledgements</title>
+<!-- .XS -->
+<!-- (SN Acknowledgements -->
+<!-- .XE -->
+<para>
+This document represents the culmination of several years of debate and
+experiments done under the auspices of the MIT X Consortium font working group.
+Although this was a group effort, the author remains responsible for any errors
+or omissions.  The protocol presented here was primarily designed by Jim
+Fulton, Keith Packard, and Bob Scheifler.  Special thanks goes to Ned
+Batchelder, Jim Flowers, and Axel Deininger for their invigorating comments
+which never failed to make this a better document.
+Stephen Gildea edited version 2 of this document.
+Finally, David Lemke
+deserves great credit for designing and coding the sample implementation.
+</para>
+</sect1>
+
+<bibliography>
+<title>References</title>
+<para>
+All of the following documents are X Consortium standards available from
+the X Consortium.
+</para>
+<biblioentry>
+  <title>X Window System Protocol Version 11</title>
+  <author><firstname>Robert W.</firstname><surname>Scheifler</surname></author>
+</biblioentry>
+
+<biblioentry>
+  <title>Adobe System - Bitmap Distribution Format 2.1</title>
+</biblioentry>
+
+<biblioentry>
+  <title>X Consortium.  X Logical Font Description Conventions, Version 1.5</title>
+</biblioentry>
+
+</bibliography>
+</chapter>
+
+<appendix id="suggested_licensing_policies">
+<title>Suggested Licensing Policies</title>
+<para>
+The authorization data passed by the client in the initial connection
+setup information may be used by the font server to implement restrictions
+on which fonts may be accessed.  Furthermore, the font server is free to
+refuse new connections at any time.
+</para>
+<para>
+Configuration or management of the license restrictions is outside the scope of
+the font service protocol and is done in a server-dependent manner.  Possible
+policies might include, but are not limited to, combinations of the following:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+No restrictions - anyone may access any fonts.  The server neither
+refuses any connections nor generates AccessContext errors on any
+fonts.  For environments without specially-licensed fonts, this is
+sufficient.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Per-machine - only those clients connecting from a known set of
+machines are permitted access.  The server could get the address
+of the connection and look in a list of allowed machines.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Per-user - only a known set of users may access the fonts.  The
+server can use the authorization data (such as a Kerberos ticket
+or a Secure RPC credential) to verify the identity of the user
+and then look in a list of allowed users.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Simultaneous Use - only a certain number of clients may use a given
+font at any one time.  Additional clients would receive AccessContext
+errors if they attempt to open the font.  This is only effective if
+the initial clients keep the font open for the entire time that it
+is being used (even if all of the data has been transmitted and is
+being cached).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Postage Meter - a particular font may only be accessed a limited
+number of times before its license must be renewed.  Each time
+the font is opened, the server decrements a counter.  When the
+counter reaches zero, all further attempts to open the font
+return an AccessContext error.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+It should be noted that chaining of font servers (obtaining font data from
+other font servers) may conflict with certain license policies.
+</para>
+</appendix>
+
+<appendix id="implementation_suggestions">
+<title>Implementation Suggestions</title>
+<para>
+<!-- .LP -->
+Font server implementations will probably wish to use techniques such as the
+following to avoid limits on the number of simultaneous connections:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The initial connection information returned by the font
+server contains the names of other font servers that
+may be used as substitutes.  A font server may refuse to
+accept a connection, indicating that the client should
+try one of the alternatives instead.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+On operating systems that support processing forking, font
+servers might choose to fork so that the child can continue
+processing the existing connections and the parent can accept
+new connections.  Such implementations are encouraged to use
+shared memory so that in-memory font databases can be shared.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+On operating systems that support passing stream file descriptors
+between processes, cooperating font servers could collect
+connections in a single process when there are few connections
+and spread them among several processes as the load increases.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If a font client is unable to connect to a server (as opposed
+to having the connection terminated), it should retry for an
+implementation-dependent length of time (see Xlib's
+handling of ECONNREFUSED in XConnDis.c).
+    </para>
+  </listitem>
+</itemizedlist>
+</appendix>
+</book>