1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
5 <!ENTITY % defs SYSTEM "defs.ent"> %defs;
12 <title>The X Font Service Protocol</title>
13 <subtitle>X Consortium Standard</subtitle>
14 <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
15 <releaseinfo>Version 2.0</releaseinfo>
18 <firstname>Jim</firstname><surname>Fulton</surname>
19 <affiliation><orgname>Network Computing Devices, Inc.</orgname></affiliation>
22 <edition>Revised May 2, 1994</edition>
23 <copyright><year>1991</year><holder>Network Computing Devices, Inc.</holder></copyright>
27 Permission to use, copy, modify, distribute, and sell this
28 documentation for any purpose is hereby granted without fee,
29 provided that the above copyright notice and this permission
30 notice appear in all copies. Network Computing Devices, Inc.
31 makes no representations about the suitability for any purpose
32 of the information in this document. This documentation is
33 provided “as is” without express or implied warranty.
38 <para role="multiLicensing">Copyright © 1994 X Consortium</para>
40 Permission is hereby granted, free of charge, to any person obtaining a copy
41 of this software and associated documentation files (the “Software”), to deal
42 in the Software without restriction, including without limitation the rights
43 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
44 copies of the Software, and to permit persons to whom the Software is
45 furnished to do so, subject to the following conditions:
48 The above copyright notice and this permission notice shall be included in
49 all copies or substantial portions of the Software.
52 THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
53 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
54 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
55 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
56 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
57 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
60 Except as contained in this notice, the name of the X Consortium shall not be
61 used in advertising or otherwise to promote the sale, use or other dealings
62 in this Software without prior written authorization from the X Consortium.
67 <chapter id='Introduction'>
68 <title>Introduction</title>
70 The management of fonts in large, heterogeneous environments is one of the
71 hardest aspects of using the X Window System
72 <footnote id='footnote1'><para>
73 <firstterm><trademark>X Window System</trademark></firstterm>
74 is a trademark of The Open Group.
76 . Multiple formats and the lack of
77 a consistent mechanism for exporting font data to all displays on a network
78 prevent the transparent use of applications across different display platforms.
79 The X Font Service protocol is designed to address this and other issues, with
80 specific emphasis on the needs of the core X protocol. Upward-compatible
81 changes (typically in the form of new requests) are expected as consensus is
82 reached on new features (particularly outline font support).
85 Currently, most X displays use network file protocols such as
86 <acronym>NFS</acronym> and <acronym>TFTP</acronym> to
87 obtain raw font data which they parse directly. Since a common binary format
88 for this data doesn't exist, displays must be able to interpret a variety of
89 formats if they are to be used with different application hosts. This leads to
90 wasted code and data space and a loss of interoperability as displays are used
91 in unforeseen environments.
94 By moving the interpretation of font data out of the X server into a separate
95 service on the network, these problems can be greatly reduced. In addition,
96 new technologies, such as dynamically generating bitmaps from scaled or outline
97 fonts, can be provided to all displays transparently. For horizontal text,
98 caching techniques and increased processor power can potentially make
99 rasterization more efficient on large, centralized hosts than on individual
103 Each font server provides sets of fonts that may be listed and queried for
104 header, property, glyph extents, and bitmap information. This data is
105 transmitted over the network using a binary format (with variations to support
106 different bit- and byte-orders) designed to minimize the amount of processing
107 required by the display. Since the font server, rather than the display, is
108 responsible for parsing the raw font data, new formats can be used by all
109 displays by modifying a single font server.
112 From the user's point of view, font servers are simply a new type of name in
113 the X font path. Network name services allow descriptive names (such as
114 DEPARTMENT-FONTS or APPLICATION-FONTS) to be translated into proper network
115 addresses. X displays send requests to and read replies from the font server
116 rather than reading directly from files. Since the X Font Service protocol is
117 designed to allow subsets of the font data to be requested, displays may easily
118 implement a variety of strategies for fine-grained demand-loading of glyphs.
122 <chapter id='Architectural_Model'>
123 <title>Architectural Model</title>
125 <!-- (SN Architectural Model -->
128 In this document, the words <firstterm>client</firstterm> and
129 <firstterm>server</firstterm> refer to the consumer and
130 provider of a font, respectively, unless otherwise indicated. It is important
131 to note that in this context, the X server is also a font client.
134 The X Font Service protocol does not require any changes to the core X protocol
135 or to any applications. To the user, font servers are simply additional types
136 of font path elements. As such, X servers may connect to multiple font
137 servers, as shown in Figure 2.1. Although the font protocol is geared towards
138 the X Window System, it may be also used by other consumers of font data (such
142 <figure id="figure2.1" label="2.1"><title>Connecting to a Font Server</title>
143 <literallayout class="monospaced">
144 ┌────────┐ ┌───────────────┐
145 │ X1 ├──────────────┤ │
146 │ Server │ │ Font Server │
147 └────────┘ ┌───────┤ 1 │
150 │ X2 ├──────┘ ┌───────────────┐
151 │ Server ├──────────────┤ │
152 └────────┘ │ Font Server │
154 ┌─────────┐ │ └───────────────┘
162 Clients communicate with the font server using the request/reply/event model
163 over any mutually-understood virtual stream connection (such as
164 <acronym>TCP/IP</acronym>, DECnet,
165 <footnote id='footnote2'><para>
166 <firstterm><trademark>DECnet</trademark></firstterm> is a trademark
167 of Digital Equipment Corporation.
169 etc.). Font servers are responsible for providing data in the bit and byte
170 orders requested by the client. The set of requests and events provided in the
171 first version of the X Font Service protocol is limited to supporting the needs
172 of the bitmap-oriented core X Window System protocol. Extensions are expected
176 A font server reads raw font data from a variety of sources (possibly
177 including other font servers) and converts it into a common format that is
178 transmitted to the client using the protocol described in
179 <link linkend='Protocol'>Section 4</link>. New font
180 formats are handled by adding new converters to a font server, as shown in
184 <figure id="figure2.2" label="2.2"><title>Where Font Data Comes From</title>
185 <literallayout class="monospaced">
193 ┌─────────────────────┴──────────────────────┐
197 ├─────┬─────┬─────┬─────┬────┬─────┬───┬─────┤
198 │ bdf │ snf │ pcf │ atm │ f3 │ dwf │ │ │ ... │
199 └─────┴─────┴─────┴─────┴────┴─────┴─│─┴─────┘
211 The server may choose to provide named sets of fonts called
212 <firstterm>catalogues</firstterm>.
213 Clients may specify which of the sets should be used in listing or opening a
218 An event mechanism similar to that used in the X protocol is provided for
219 asynchronous notification of clients by the server.
223 Clients may provide authorization data for the server to be used in determining
224 (according to the server's licensing policy) whether or not access should be
225 granted to particular fonts. This is particularly useful for clients whose
226 authorization changes over time (such as an X server that can verify the
227 identity of the user).
230 Implementations that wish to provide additional requests or events may use the
231 extension mechanism. Adding to the core font service protocol (with the
232 accompanying change in the major or minor version numbers) is reserved to the X
237 <chapter id='Font_Server_Naming'>
238 <title>Font Server Naming</title>
240 <!-- (SN Font Server Naming -->
243 Font clients that expose font server names to the user are encouraged to
244 provide ways of naming font servers symbolically (e.g. DEPARTMENT-FONTS).
245 However, for environments that lack appropriate name services
246 transport-specific names are necessary. Since these names do occur in the
247 protocol, clients and servers should support at least the applicable formats
248 described below. Formats for additional transports may be registered with the
252 <section id='TCPIP_Names'>
253 <title>TCP/IP Names</title>
255 <!-- (SN TCP/IP Names -->
258 The following syntax should be used for TCP/IP names:
260 <literallayout class="monospaced">
261 <replaceable>TCP name</replaceable> ::= <literal>tcp/</literal> <replaceable>hostname</replaceable> <literal>:</literal> <replaceable>ipportnumber</replaceable> <optional><literal>/</literal> <replaceable>cataloguelist</replaceable></optional>
264 where <replaceable>hostname</replaceable> is either symbolic (such as
265 <systemitem class="systemname">expo.lcs.mit.edu</systemitem>) or numeric
266 decimal (such as <systemitem class="ipaddress">18.30.0.212</systemitem>).
267 The <replaceable>ipportnumber</replaceable> is the port on which the
268 font server is listening for connections.
269 The <replaceable>cataloguelist</replaceable> string at
270 the end is optional and specifies a plus-separated list of catalogues
271 that may be requested. For example:
272 <literallayout class="monospaced">
273 tcp/expo.lcs.mit.edu:8012/available+special
279 <section id='DECnet_Names'>
280 <title>DECnet Names</title>
282 <!-- (SN DECnet Names -->
285 The following syntax should be used for DECnet names:
287 <literallayout class="monospaced">
288 <replaceable>DECnet name</replaceable> ::= <literal>decnet/</literal> <replaceable>nodename</replaceable> <literal>::font$</literal> <replaceable>objname</replaceable> <optional><literal>/</literal> <replaceable>cataloguelist</replaceable></optional>
291 where <replaceable>nodename</replaceable> is either symbolic (such as
292 <systemitem class="systemname">SRVNOD</systemitem>) or the
293 numeric decimal form of the DECnet address (such as
294 <systemitem class="ipaddress">44.70</systemitem>).
295 The <replaceable>objname</replaceable> is normal, case-insensitive DECnet
296 object name. The <replaceable>cataloguelist</replaceable> string
298 optional and specifies a plus-separated list of catalogues that may be
299 requested. For example:
301 <literallayout class="monospaced">
302 DECNET/SRVNOD::FONT$DEFAULT/AVAILABLE
303 decnet/44.70::font$other
309 <chapter id='Protocol'>
310 <title>Protocol</title>
312 <!-- (SN Protocol -->
315 The protocol described below uses the request/reply/error model and is
316 specified using the same conventions outlined in
317 <olink targetdoc='x11protocol' targetptr='Syntactic_Conventions'>Section 2
318 of the core X Window System protocol</olink>
319 <xref linkend="References:x11proto"/>:
325 Data type names are spelled in upper case with no word separators,
326 as in: <link linkend="Data_Types:FONTID"><type>FONTID</type></link>
332 Alternate values are capitalized with no word separators,
333 as in: <constant>MaxWidth</constant>
339 Structure element declarations are in lower case with hyphens
340 as word separators, as in: <structfield>byte-order-msb</structfield>
344 Structure element names are referred to in
345 upper case (e.g. <structfield>BYTE-ORDER-MSB</structfield>) when used in
346 descriptions to set them off from the surrounding
347 text. When this document is typeset they will be
348 printed in lower case in a distinct font.
354 Type declarations have the form <quote><type>name</type>: type</quote>,
355 as in: <type>CARD8</type>: 8-bit byte
360 Comma-separated lists of alternate values are enclosed in
361 braces, as in: { <constant>Min</constant>, <constant>MaxWidth</constant>,
362 <constant>Max</constant> }
367 Comma-separated lists of structure elements are enclosed in
368 brackets, as in: [ <structfield>byte1</structfield>: <type>CARD8</type>,
369 <structfield>byte2</structfield>: <type>CARD8</type> ]
375 A type with a prefix <quote>LISTof</quote> represents a counted list of
376 elements of that type, as in: <type>LISTofCARD8</type>
379 <section id='Data_Types'>
380 <title>Data Types</title>
382 <!-- (SN Data Types -->
385 The following data types are used in the core X Font Server protocol:
388 <section id="Data_Types:ACCESSCONTEXT">
389 <title><type>ACCESSCONTEXT</type></title>
390 <indexterm zone="Data_Types:ACCESSCONTEXT" significance="preferred"><primary>ACCESSCONTEXT</primary></indexterm>
391 <informaltable frame='none'>
392 <?dbfo keep-together="always" ?>
393 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
394 <colspec colname='c1' colwidth='1.0*'/>
395 <colspec colname='c2' colwidth='1.0*'/>
396 <colspec colname='c3' colwidth='1.0*'/>
398 <row><entry><type>ACCESSCONTEXT</type>:</entry><entry><link linkend="Data_Types:ID"><type>ID</type></link></entry></row>
403 This value is specified in the CreateAC request as the identifier
404 to be used when referring to a particular AccessContext resource
405 within the server. These resources are used by the server to
406 store client-specified authorization information. This
407 information may be used by the server to determine whether or not
408 the client should be granted access to particular font data.
411 In order to preserve the integrity of font licensing being performed by
412 the font server, care must be taken by a client to properly represent the
413 identity of the true user of the font. Some font clients will in fact
414 be servers (for example, X servers) requesting fonts for their own clients.
415 Other font clients may be doing work on behalf of a number of different
416 users over time (for example, print spoolers).
419 <type>AccessContext</type>s
420 must be created (with
421 <link linkend="Requests:CreateAC"><function>CreateAC</function></link>)
422 and switched among (with
423 <link linkend="Requests:SetAuthorization"><function>SetAuthorization</function></link>)
424 to represent all of these <quote>font users</quote> properly.
428 <section id="Data_Types:ALTERNATESERVER">
429 <title><type>ALTERNATESERVER</type></title>
430 <indexterm zone="Data_Types:ALTERNATESERVER" significance="preferred"><primary>ALTERNATESERVER</primary></indexterm>
431 <informaltable frame='none'>
432 <?dbfo keep-together="always" ?>
433 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
434 <colspec colname='c1' colwidth='1.0*'/>
435 <colspec colname='c2' colwidth='1.0*'/>
436 <colspec colname='c3' colwidth='1.0*'/>
438 <row><entry morerows="1"><type>ALTERNATESERVER</type>:</entry>
439 <entry> [ <structfield>name</structfield>:</entry><entry> <link linkend="Data_Types:STRING8"><type>STRING8</type></link>,</entry></row>
440 <row><entry> <structfield>subset</structfield>:</entry><entry> <link linkend="Data_Types:BOOL"><type>BOOL</type></link> ]</entry></row>
446 This structure specifies the <structfield>NAME</structfield>,
447 encoded in <acronym>ISO</acronym> 8859-1 according
448 to <link linkend='Font_Server_Naming'>Section 3</link>,
449 of another font server that may be useful as a
450 substitute for this font server.
451 The <structfield>SUBSET</structfield> field indicates
452 whether or not the alternate server is likely to only contain a
453 subset of the fonts available from this font server. This
454 information is returned during the initial connection setup and
455 may be used by the client to find a backup server in case of
460 <section id="Data_Types:AUTH">
461 <title><type>AUTH</type></title>
462 <indexterm zone="Data_Types:AUTH" significance="preferred"><primary>AUTH</primary></indexterm>
463 <informaltable frame='none'>
464 <?dbfo keep-together="always" ?>
465 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
466 <colspec colname='c1' colwidth='1.0*'/>
467 <colspec colname='c2' colwidth='1.0*'/>
468 <colspec colname='c3' colwidth='1.0*'/>
470 <row><entry morerows="1"><type>AUTH</type>:</entry><entry>[ <structfield>name</structfield>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link>,</entry></row>
471 <row><entry> <structfield>data</structfield>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link> ]</entry></row>
477 This structure specifies the name of an authorization protocol and
478 initial data for that protocol. It is used in the authorization
479 negotiation in the initial connection setup and in the CreateAC
484 <section id="Data_Types:BITMAPFORMAT">
485 <title><type>BITMAPFORMAT</type></title>
486 <indexterm zone="Data_Types:BITMAPFORMAT" significance="preferred"><primary>BITMAPFORMAT</primary></indexterm>
487 <informaltable frame='none'>
488 <?dbfo keep-together="always" ?>
489 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
490 <colspec colname='c1' colwidth='1.0*'/>
491 <colspec colname='c2' colwidth='1.0*'/>
492 <colspec colname='c3' colwidth='1.0*'/>
494 <row><entry><type>BITMAPFORMAT</type>:</entry><entry><type>CARD32</type></entry></row>
500 <type>CARD32</type> containing the following fields defined by the
501 sets of values given further below
503 <informaltable frame='none'>
504 <?dbfo keep-together="always" ?>
505 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
506 <colspec colname='c1' colwidth='1.0*'/>
507 <colspec colname='c2' colwidth='1.0*'/>
508 <colspec colname='c3' colwidth='1.0*'/>
510 <row><entry>[</entry></row>
511 <row><entry> <structfield>byte-order-msb</structfield>:</entry><entry> 1 bit,</entry></row>
512 <row><entry> <structfield>bit-order-msb</structfield>:</entry><entry> 1 bit,</entry></row>
513 <row><entry> <structfield>image-rect</structfield>:</entry><entry> 2 bits</entry><entry>{ <constant>Min</constant>,
514 <constant>MaxWidth</constant>,
515 <constant>Max</constant> },</entry></row>
516 <row><entry> <structfield>zero-pad</structfield>:</entry><entry> 4 bits,</entry></row>
517 <row><entry> <structfield>scanline-pad</structfield>:</entry><entry> 2 bits</entry><entry>{ <constant>ScanlinePad8</constant>,
518 <constant>ScanlinePad16</constant>,
519 <constant>ScanlinePad32</constant>,
520 <constant>ScanlinePad64</constant> },</entry></row>
521 <row><entry> <structfield>zero-pad</structfield>:</entry><entry> 2 bits,</entry></row>
522 <row><entry> <structfield>scanline-unit</structfield>:</entry><entry> 2 bits</entry><entry>{ <constant>ScanlineUnit8</constant>,
523 <constant>ScanlineUnit16</constant>,
524 <constant>ScanlineUnit32</constant>,
525 <constant>ScanlineUnit64</constant> },</entry></row>
526 <row><entry> <structfield>zero-pad</structfield>:</entry><entry> 2 bits,</entry></row>
527 <row><entry> <structfield>zero-pad</structfield>:</entry><entry> 16 bits,</entry></row>
528 <row><entry>]</entry></row>
534 This structure specifies how glyph images are transmitted in
536 <link linkend="Requests:QueryXBitmaps8"><function>QueryXBitmaps8</function></link>
538 <link linkend="Requests:QueryXBitmaps16"><function>QueryXBitmaps16</function></link>
542 If the <structfield>BYTE-ORDER-MSB</structfield> bit
543 <literal>(1 << 0)</literal> is set, the Most Significant
544 Byte of each scanline unit is returned first. Otherwise, the
545 Least Significant Byte is returned first.
548 If the <structfield>BIT-ORDER-MSB</structfield> bit
549 <literal>(1 << 1)</literal> is set, the left-most bit in
550 each glyph scanline unit is stored in the Most Significant Bit of
551 each transmitted scanline unit. Otherwise, the left-most bit is
552 stored in the Least Significant Bit.
555 The <structfield>IMAGE-RECT</structfield> field specifies a rectangle of
557 glyph image. It contains one of the following alternate values:
559 <informaltable frame='none'>
560 <?dbfo keep-together="always" ?>
561 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
562 <colspec colname='c1' colwidth='1.0*'/>
563 <colspec colname='c2' colwidth='1.0*'/>
565 <row><entry><constant>ImageRectMin</constant></entry><entry><literal>(0 << 2)</literal></entry></row>
566 <row><entry><constant>ImageRectMaxWidth</constant></entry><entry><literal>(1 << 2)</literal></entry></row>
567 <row><entry><constant>ImageRectMax</constant></entry><entry><literal>(2 << 2)</literal></entry></row>
573 For a glyph with extents <link linkend="Data_Types:XCHARINFO"><type>XCHARINFO</type></link> in a font with header
574 information <link linkend="Data_Types:XFONTINFO"><type>XFONTINFO</type></link>, the <structfield>IMAGE-RECT</structfield>
575 values have the following meanings:
577 <varlistentry id="Constant:ImageRectMin">
578 <term><constant>ImageRectMin</constant></term>
580 <indexterm zone="Constant:ImageRectMin" significance="preferred"><primary>ImageRectMin</primary></indexterm>
582 This refers to the minimal bounding rectangle
583 surrounding the inked pixels in the glyph. This is the
584 most compact representation. The edges of the rectangle
586 <literallayout class="monospaced">
587 left: <structfield>XCHARINFO.LBEARING</structfield>
588 right: <structfield>XCHARINFO.RBEARING</structfield>
589 top: <structfield>XCHARINFO.ASCENT</structfield>
590 bottom: <structfield>XCHARINFO.DESCENT</structfield>
595 <varlistentry id="Constant:ImageRectMaxWidth">
596 <term><constant>ImageRectMaxWidth</constant></term>
598 <indexterm zone="Constant:ImageRectMaxWidth" significance="preferred"><primary>ImageRectMaxWidth</primary></indexterm>
600 This refers to the scanlines between the
601 glyph's ascent and descent, padded on the left to the minimum
602 left-bearing (or 0, whichever is less) and on the right to
603 the maximum right-bearing (or logical-width, whichever is
604 greater). All glyph images share a common horizontal
605 origin. This is a combination of <constant>ImageRectMax</constant> in the
606 horizontal direction and <constant>ImageRectMin</constant> in the vertical
607 direction. The edges of the rectangle are:
609 <literallayout class="monospaced">
610 left: min (<structfield>XFONTINFO.MIN-BOUNDS.LBEARING</structfield>, 0)
611 right: max (<structfield>XFONTINFO.MAX-BOUNDS.RBEARING</structfield>,
612 <structfield>XFONTINFO.MAX-BOUNDS.WIDTH</structfield>)
613 top: <structfield>XCHARINFO.ASCENT</structfield>
614 bottom: <structfield>XCHARINFO.DESCENT</structfield>
619 <varlistentry id="Constant:ImageRectMax">
620 <term><constant>ImageRectMax</constant></term>
622 <indexterm zone="Constant:ImageRectMax" significance="preferred"><primary>ImageRectMax</primary></indexterm>
624 This refers to all scanlines, from the maximum
625 ascent (or the font ascent, whichever is greater) to the
626 maximum descent (or the font descent, whichever is greater),
627 padded to the same horizontal extents as <constant>MaxWidth</constant>.
628 All glyph images have the same sized bitmap and share a
629 common origin. This is the least compact representation,
630 but may be the easiest or most efficient (particularly for
631 character cell fonts) for some clients to use. The edges of
634 <literallayout class="monospaced">
635 left: min (<structfield>XFONTINFO.MIN-BOUNDS.LBEARING</structfield>, 0)
636 right: max (<structfield>XFONTINFO.MAX-BOUNDS.RBEARING</structfield>,
637 <structfield>XFONTINFO.MAX-BOUNDS.WIDTH</structfield>)
638 top: max (<structfield>XFONTINFO.FONT-ASCENT</structfield>,
639 <structfield>XFONTINFO.MAX-BOUNDS.ASCENT</structfield>)
640 bottom: max (<structfield>XFONTINFO.FONT-DESCENT</structfield>,
641 <structfield>XFONTINFO.MAX-BOUNDS.DESCENT</structfield>)
649 The <structfield>SCANLINE-PAD</structfield> field specifies the number of
651 or 64) to which each glyph scanline is padded before transmitting.
652 It contains one of the following alternate values:
653 <informaltable frame='none'>
654 <?dbfo keep-together="always" ?>
655 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
656 <colspec colname='c1' colwidth='1.0*'/>
657 <colspec colname='c2' colwidth='1.0*'/>
659 <row><entry><constant>ScanlinePad8</constant></entry><entry><literal>(0 << 8)</literal></entry></row>
660 <row><entry><constant>ScanlinePad16</constant></entry><entry><literal>(1 << 8)</literal></entry></row>
661 <row><entry><constant>ScanlinePad32</constant></entry><entry><literal>(2 << 8)</literal></entry></row>
662 <row><entry><constant>ScanlinePad64</constant></entry><entry><literal>(3 << 8)</literal></entry></row>
668 The <structfield>SCANLINE-UNIT</structfield> field specifies the number of
669 bits (8, 16, 32, or 64) that should be treated as a unit for swapping.
670 This value must be less than or equal to the number of bits specified by the
671 <structfield>SCANLINE-PAD</structfield>. It contains one of the following
674 <informaltable frame='none'>
675 <?dbfo keep-together="always" ?>
676 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
677 <colspec colname='c1' colwidth='1.0*'/>
678 <colspec colname='c2' colwidth='1.0*'/>
680 <row><entry><constant>ScanlineUnit8</constant></entry><entry><literal>(0 << 12)</literal></entry></row>
681 <row><entry><constant>ScanlineUnit16</constant></entry><entry><literal>(1 << 12)</literal></entry></row>
682 <row><entry><constant>ScanlineUnit32</constant></entry><entry><literal>(2 << 12)</literal></entry></row>
683 <row><entry><constant>ScanlineUnit64</constant></entry><entry><literal>(3 << 12)</literal></entry></row>
689 <link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link>s are byte-swapped as <type>CARD32</type>s.
690 All unspecified bits must be zero.
693 Use of an invalid <link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link> causes a
694 <link linkend="Errors:Format"><errorname>Format</errorname></link> error to be returned.
698 <section id="Data_Types:BITMAPFORMATMASK">
699 <title><type>BITMAPFORMATMASK</type></title>
700 <indexterm zone="Data_Types:BITMAPFORMATMASK" significance="preferred"><primary>BITMAPFORMATMASK</primary></indexterm>
701 <informaltable frame='none'>
702 <?dbfo keep-together="always" ?>
703 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
704 <colspec colname='c1' colwidth='1.0*'/>
705 <colspec colname='c2' colwidth='1.0*'/>
706 <colspec colname='c3' colwidth='1.0*'/>
708 <row><entry><type>BITMAPFORMATMASK</type>:</entry><entry> <type>CARD32</type> mask</entry></row>
713 This is a mask of bits representing the fields in a <link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link>:
714 <informaltable frame='none'>
715 <?dbfo keep-together="always" ?>
716 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
717 <colspec colname='c1' colwidth='1.0*'/>
718 <colspec colname='c2' colwidth='1.0*'/>
720 <row><entry><constant>ByteOrderMask</constant></entry><entry><literal>(1 << 0)</literal></entry></row>
721 <row><entry><constant>BitOrderMask</constant></entry><entry><literal>(1 << 1)</literal></entry></row>
722 <row><entry><constant>ImageRectMask</constant></entry><entry><literal>(1 << 2)</literal></entry></row>
723 <row><entry><constant>ScanlinePadMask</constant></entry><entry><literal>(1 << 3)</literal></entry></row>
724 <row><entry><constant>ScanlineUnitMask</constant></entry><entry><literal>(1 << 4)</literal></entry></row>
730 Unspecified bits are required to be zero or else a
731 <link linkend="Errors:Format"><errorname>Format</errorname></link> error is returned.
735 <section id="Data_Types:BOOL">
736 <title><type>BOOL</type></title>
737 <indexterm zone="Data_Types:BOOL" significance="preferred"><primary>BOOL</primary></indexterm>
738 <informaltable frame='none'>
739 <?dbfo keep-together="always" ?>
740 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
741 <colspec colname='c1' colwidth='1.0*'/>
742 <colspec colname='c2' colwidth='1.0*'/>
743 <colspec colname='c3' colwidth='1.0*'/>
745 <row><entry><type>BOOL</type>:</entry><entry> <type>CARD8</type></entry></row>
750 This is a boolean value containing one of the following alternate
752 <informaltable frame='none'>
753 <?dbfo keep-together="always" ?>
754 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
755 <colspec colname='c1' colwidth='1.0*'/>
756 <colspec colname='c2' colwidth='1.0*'/>
758 <row><entry><constant>False</constant></entry><entry><literal>0</literal></entry></row>
759 <row><entry><constant>True</constant></entry><entry><literal>1</literal></entry></row>
766 <section id="Data_Types:BYTE">
767 <title><type>BYTE</type></title>
768 <indexterm zone="Data_Types:BYTE" significance="preferred"><primary>BYTE</primary></indexterm>
769 <informaltable frame='none'>
770 <?dbfo keep-together="always" ?>
771 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
772 <colspec colname='c1' colwidth='1.0*'/>
773 <colspec colname='c2' colwidth='1.0*'/>
774 <colspec colname='c3' colwidth='1.0*'/>
776 <row><entry><type>BYTE</type>:</entry><entry> 8-bit value</entry></row>
782 This is an unsigned byte of data whose encoding
783 is determined by the context in which it is used.
788 <section id="Data_Types:CARDn">
789 <title><type>CARD8</type>, <type>CARD16</type>, <type>CARD32</type></title>
790 <indexterm zone="Data_Types:CARDn" significance="preferred"><primary>CARD8</primary></indexterm>
791 <indexterm zone="Data_Types:CARDn" significance="preferred"><primary>CARD16</primary></indexterm>
792 <indexterm zone="Data_Types:CARDn" significance="preferred"><primary>CARD32</primary></indexterm>
793 <informaltable frame='none'>
794 <?dbfo keep-together="always" ?>
795 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
796 <colspec colname='c1' colwidth='1.0*'/>
797 <colspec colname='c2' colwidth='1.0*'/>
798 <colspec colname='c3' colwidth='1.0*'/>
800 <row><entry><type>CARD8</type>:</entry><entry> 8-bit unsigned integer</entry></row>
801 <row><entry><type>CARD16</type>:</entry><entry> 16-bit unsigned integer</entry></row>
802 <row><entry><type>CARD32</type>:</entry><entry> 32-bit unsigned integer</entry></row>
808 These are unsigned numbers. The latter two are byte-swapped when
809 the server and client have different byte orders.
814 <section id="Data_Types:CHAR2B">
815 <title><type>CHAR2B</type></title>
816 <indexterm zone="Data_Types:CHAR2B" significance="preferred"><primary>CHAR2B</primary></indexterm>
817 <informaltable frame='none'>
818 <?dbfo keep-together="always" ?>
819 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
820 <colspec colname='c1' colwidth='1.0*'/>
821 <colspec colname='c2' colwidth='1.0*'/>
822 <colspec colname='c3' colwidth='1.0*'/>
824 <row><entry><type>CHAR2B</type>:</entry><entry>[ <structfield>byte1</structfield>, <structfield>byte2</structfield>:</entry><entry><type>CARD8</type> ]</entry></row>
829 This structure specifies an individual character code within
830 either a 2-dimensional matrix (using <structfield>BYTE1</structfield>
831 and <structfield>BYTE2</structfield> as the row and column indices,
832 respectively) or a vector (using <structfield>BYTE1</structfield> and
833 <structfield>BYTE2</structfield> as most- and least-significant bytes,
834 respectively). This data type is treated as a pair of 8-bit values and
835 is never byte-swapped. Therefore, the client should always transmit
836 <structfield>BYTE1</structfield> first.
841 <section id="Data_Types:EVENTMASK">
842 <title><type>EVENTMASK</type></title>
843 <indexterm zone="Data_Types:EVENTMASK" significance="preferred"><primary>EVENTMASK</primary></indexterm>
844 <informaltable frame='none'>
845 <?dbfo keep-together="always" ?>
846 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
847 <colspec colname='c1' colwidth='1.0*'/>
848 <colspec colname='c2' colwidth='1.0*'/>
849 <colspec colname='c3' colwidth='1.0*'/>
851 <row><entry><type>EVENTMASK</type>:</entry><entry> <type>CARD32</type> mask</entry></row>
857 This is a mask of bits indicating which of an extension's (or the
858 core's) maskable events the client would like to receive. Each
859 bit indicates one or more events, and a bit value of one indicates
860 interest in a corresponding set of events. The following bits are
861 defined for event masks specified for the core protocol (i.e. an
862 <parameter>EXTENSION-OPCODE</parameter> of zero in
863 <link linkend="Requests:SetEventMask"><function>SetEventMask</function></link>
865 <link linkend="Requests:GetEventMask"><function>GetEventMask</function></link>
868 <informaltable frame='none'>
869 <?dbfo keep-together="always" ?>
870 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
871 <colspec colname='c1' colwidth='1.0*'/>
872 <colspec colname='c2' colwidth='1.0*'/>
874 <row><entry><constant>CatalogueListChangeMask</constant></entry><entry><literal>(1 << 0)</literal></entry></row>
875 <row><entry><constant>FontListChangeMask</constant></entry><entry><literal>(1 << 1)</literal></entry></row>
883 <constant>CatalogueListChangeMask</constant>
884 is set, client is interested in
886 <link linkend="Events:CatalogueListNotify"><function>CatalogueListNotify</function></link>
888 <constant>FontListChangeMask</constant>
889 is set, the client is interested in
891 <link linkend="Events:FontListNotify"><function>FontListNotify</function></link>
895 Extensions that provide additional events may define their own
896 event masks. These event masks have their own scope and may use
897 the same bit values as the core or other extensions.
900 All unused bits must be set to zero. In
901 <link linkend="Requests:SetEventMask"><function>SetEventMask</function></link>
903 any bits are set that are not defined for the extension (or core)
904 for which this <type>EVENTMASK</type> is intended (according to the
905 <parameter>EXTENSION-OPCODE</parameter> given in the
906 <link linkend="Requests:SetEventMask"><function>SetEventMask</function></link>
908 <link linkend="Errors:EventMask"><errorname>EventMask</errorname></link>
912 This value is swapped as a <type>CARD32</type>.
917 <section id="Data_Types:FONTID">
918 <title><type>FONTID</type></title>
919 <indexterm zone="Data_Types:FONTID" significance="preferred"><primary>FONTID</primary></indexterm>
920 <informaltable frame='none'>
921 <?dbfo keep-together="always" ?>
922 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
923 <colspec colname='c1' colwidth='1.0*'/>
924 <colspec colname='c2' colwidth='1.0*'/>
925 <colspec colname='c3' colwidth='1.0*'/>
927 <row><entry><type>FONTID</type>:</entry><entry> <link linkend="Data_Types:ID"><type>ID</type></link></entry></row>
933 This is specified by the client in the request
934 <link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>
935 as the identifier to be used when referring to a particular open
941 <section id="Data_Types:ID">
942 <title><type>ID</type></title>
943 <indexterm zone="Data_Types:ID" significance="preferred"><primary>ID</primary></indexterm>
944 <informaltable frame='none'>
945 <?dbfo keep-together="always" ?>
946 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
947 <colspec colname='c1' colwidth='1.0*'/>
948 <colspec colname='c2' colwidth='1.0*'/>
949 <colspec colname='c3' colwidth='1.0*'/>
951 <row><entry><type>ID</type>:</entry><entry> <type>CARD32</type></entry></row>
957 This is a 32-bit value in which the top 3 bits must be clear, and
958 at least 1 other bit must be set (yielding a range of 1 through
959 2<superscript>29</superscript>-1).
960 It is specified by the client to represent objects in
961 the server. Identifiers are scoped according to their type are
962 private to the client; thus, the same identifier may be used for
963 both a <link linkend="Data_Types:FONTID"><type>FONTID</type></link> and an <link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link>
964 as well as by multiple clients.
967 An <type>ID</type> of zero is referred to as <constant>None</constant>.
971 <section id="Data_Types:INTn">
972 <title><type>INT8</type>, <type>INT16</type>, <type>INT32</type></title>
973 <indexterm zone="Data_Types:INTn" significance="preferred"><primary>INT8</primary></indexterm>
974 <indexterm zone="Data_Types:INTn" significance="preferred"><primary>INT16</primary></indexterm>
975 <indexterm zone="Data_Types:INTn" significance="preferred"><primary>INT32</primary></indexterm>
976 <informaltable frame='none'>
977 <?dbfo keep-together="always" ?>
978 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
979 <colspec colname='c1' colwidth='1.0*'/>
980 <colspec colname='c2' colwidth='1.0*'/>
981 <colspec colname='c3' colwidth='1.0*'/>
983 <row><entry><type>INT8</type>:</entry><entry> 8-bit signed integer</entry></row>
984 <row><entry><type>INT16</type>:</entry><entry> 16-bit signed integer</entry></row>
985 <row><entry><type>INT32</type>:</entry><entry> 32-bit signed integer</entry></row>
991 These are signed numbers. The latter two are byte-swapped when
992 the client and server have different byte orders.
996 <section id="Data_Types:OFFSET32">
997 <title><type>OFFSET32</type></title>
998 <indexterm zone="Data_Types:OFFSET32" significance="preferred"><primary>OFFSET32</primary></indexterm>
999 <informaltable frame='none'>
1000 <?dbfo keep-together="always" ?>
1001 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
1002 <colspec colname='c1' colwidth='1.0*'/>
1003 <colspec colname='c2' colwidth='1.0*'/>
1004 <colspec colname='c3' colwidth='1.0*'/>
1006 <row><entry morerows='1'><type>OFFSET32</type>:</entry>
1007 <entry>[ <structfield>position</structfield>:</entry><entry><type>CARD32</type>,</entry></row>
1008 <row><entry> <structfield>length</structfield>:</entry><entry><type>CARD32</type> ]</entry></row>
1013 This structure indicates a position and length within a block of
1018 <section id="Data_Types:PROPINFO">
1019 <title><type>PROPINFO</type></title>
1020 <indexterm zone="Data_Types:PROPINFO" significance="preferred"><primary>PROPINFO</primary></indexterm>
1021 <informaltable frame='none'>
1022 <?dbfo keep-together="always" ?>
1023 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
1024 <colspec colname='c1' colwidth='1.0*'/>
1025 <colspec colname='c2' colwidth='1.0*'/>
1026 <colspec colname='c3' colwidth='1.0*'/>
1028 <row><entry morerows='1'><type>PROPINFO</type>:</entry>
1029 <entry>[ <structfield>offsets</structfield>:</entry><entry><link linkend="Data_Types:PROPOFFSET"><type>LISTofPROPOFFSET</type></link>,</entry></row>
1030 <row><entry> <structfield>data</structfield>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link> ]</entry></row>
1036 This structure describes the list of properties provided by a
1037 font. Strings for all of the properties names and values are
1038 stored within the data block and are located using a table of
1039 offsets and lengths.
1042 This structure is padded to 32-bit alignment.
1047 <section id="Data_Types:PROPOFFSET">
1048 <title><type>PROPOFFSET</type></title>
1049 <indexterm zone="Data_Types:PROPOFFSET" significance="preferred"><primary>PROPOFFSET</primary></indexterm>
1050 <informaltable frame='none'>
1051 <?dbfo keep-together="always" ?>
1052 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
1053 <colspec colname='c1' colwidth='1.0*'/>
1054 <colspec colname='c2' colwidth='1.0*'/>
1055 <colspec colname='c3' colwidth='1.0*'/>
1057 <row><entry morerows='3'><type>PROPOFFSET</type>:</entry>
1058 <entry>[ <structfield>name</structfield>:</entry><entry><link linkend="Data_Types:OFFSET32"><type>OFFSET32</type></link>,</entry></row>
1059 <row><entry> <structfield>value</structfield>:</entry><entry><link linkend="Data_Types:OFFSET32"><type>OFFSET32</type></link>,</entry></row>
1060 <row><entry> <structfield>type</structfield>:</entry><entry><type>CARD8</type>,</entry></row>
1061 <row><entry> <structfield>zero-pad3</structfield>:</entry><entry><link linkend="Data_Types:BYTE"><type>BYTE</type></link>, <link linkend="Data_Types:BYTE"><type>BYTE</type></link>, <link linkend="Data_Types:BYTE"><type>BYTE</type></link> ]</entry></row>
1067 This structure specifies the position, length, and type of
1068 of data for a property.
1071 The <structfield>NAME</structfield> field specifies the position and length
1073 greater than zero) of the property name relative to the beginning
1074 of the <structfield>PROPINFO.DATA</structfield> block for this font.
1075 The interpretation of
1076 the position and length of the <structfield>VALUE</structfield> field is
1077 determined by the <structfield>TYPE</structfield> field, which contains
1078 one of the following alternate values:
1080 <informaltable frame='none'>
1081 <?dbfo keep-together="always" ?>
1082 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
1083 <colspec colname='c1' colwidth='1.0*'/>
1084 <colspec colname='c2' colwidth='1.0*'/>
1086 <row><entry><constant>String</constant></entry><entry><literal>0</literal></entry></row>
1087 <row><entry><constant>Unsigned</constant></entry><entry><literal>1</literal></entry></row>
1088 <row><entry><constant>Signed</constant></entry><entry><literal>2</literal></entry></row>
1092 which have the following meanings:
1094 <varlistentry id="Constant:String">
1095 <term><constant>String</constant></term>
1097 <indexterm zone="Constant:String" significance="preferred"><primary>String</primary></indexterm>
1099 This property contains a counted string of bytes. The
1100 data is stored in the <structfield>PROPINFO.DATA</structfield>
1102 relative byte VALUE.POSITION (beginning with zero), extending
1103 for VALUE.LENGTH (at least zero) bytes.
1107 <varlistentry id="Constant:Unsigned">
1108 <term><constant>Unsigned</constant></term>
1110 <indexterm zone="Constant:Unsigned" significance="preferred"><primary>Unsigned</primary></indexterm>
1112 This property contains a unsigned, 32-bit number stored
1113 as a <type>CARD32</type> in VALUE.POSITION (VALUE.LENGTH is zero).
1117 <varlistentry id="Constant:Signed">
1118 <term><constant>Signed</constant></term>
1120 <indexterm zone="Constant:Signed" significance="preferred"><primary>Signed</primary></indexterm>
1122 This property contains a signed, 32-bit number stored as
1123 an <type>INT32</type> in VALUE.POSITION (VALUE.LENGTH is zero).
1128 This structure is zero-padded to 32-bit alignment.
1133 <section id="Data_Types:RANGE">
1134 <title><type>RANGE</type></title>
1135 <indexterm zone="Data_Types:RANGE" significance="preferred"><primary>RANGE</primary></indexterm>
1136 <informaltable frame='none'>
1137 <?dbfo keep-together="always" ?>
1138 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
1139 <colspec colname='c1' colwidth='1.0*'/>
1140 <colspec colname='c2' colwidth='1.0*'/>
1141 <colspec colname='c3' colwidth='1.0*'/>
1143 <row><entry><type>RANGE</type>:</entry>
1144 <entry>[ <structfield>min-char</structfield>, <structfield>max-char</structfield>:</entry><entry><link linkend="Data_Types:CHAR2B"><type>CHAR2B</type></link> ]</entry></row>
1150 This structure specifies a range of character codes. A single
1151 character is represented by <structfield>MIN-CHAR</structfield> equals
1152 <structfield>MAX-CHAR</structfield>. If the linear interpretation of
1153 <structfield>MAX-CHAR</structfield> is less than that of
1154 <structfield>MIN-CHAR</structfield>, or if
1155 <structfield>MIN-CHAR</structfield> is less than the font's
1156 <structfield>XFONTINFO.CHAR-RANGE.MIN-CHAR</structfield>, or if
1157 <structfield>MAX-CHAR</structfield> is greater than the
1158 font's <structfield>XFONTINFO.CHAR-RANGE.MAX-CHAR</structfield>,
1159 the range is invalid.
1164 <section id="Data_Types:RESOLUTION">
1165 <title><type>RESOLUTION</type></title>
1166 <indexterm zone="Data_Types:RESOLUTION" significance="preferred"><primary>RESOLUTION</primary></indexterm>
1167 <informaltable frame='none'>
1168 <?dbfo keep-together="always" ?>
1169 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
1170 <colspec colname='c1' colwidth='1.0*'/>
1171 <colspec colname='c2' colwidth='1.0*'/>
1172 <colspec colname='c3' colwidth='1.0*'/>
1174 <row><entry morerows='2'><type>RESOLUTION</type>:</entry>
1175 <entry>[ <structfield>x-resolution</structfield>:</entry><entry><type>CARD16</type>,</entry></row>
1176 <row><entry> <structfield>y-resolution</structfield>:</entry><entry><type>CARD16</type>,</entry></row>
1177 <row><entry> <structfield>decipoint-size</structfield>:</entry><entry><type>CARD16</type> ]</entry></row>
1183 This structure specifies resolution and point size to be used in
1184 resolving partially-specified scaled font names. The
1185 <structfield>X-RESOLUTION</structfield> and
1186 <structfield>Y-RESOLUTION</structfield> are measured in
1187 pixels-per-inch and must be greater than zero.
1188 The <structfield>DECIPOINT-SIZE</structfield> is the preferred font
1189 size, measured in tenths of a point, and must be greater than zero.
1194 <section id="Data_Types:STRING8">
1195 <title><type>STRING8</type></title>
1196 <indexterm zone="Data_Types:STRING8" significance="preferred"><primary>STRING8</primary></indexterm>
1197 <informaltable frame='none'>
1198 <?dbfo keep-together="always" ?>
1199 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
1200 <colspec colname='c1' colwidth='1.0*'/>
1201 <colspec colname='c2' colwidth='1.0*'/>
1202 <colspec colname='c3' colwidth='1.0*'/>
1204 <row><entry><type>STRING8</type>:</entry><entry> <type>LISTofCARD8</type></entry></row>
1210 This is a counted list of 1-byte character codes, typically
1211 encoded in <acronym>ISO</acronym> 8859-1. A character code
1212 <quote><literal>c</literal></quote> is equivalent to a
1213 <link linkend="Data_Types:CHAR2B"><type>CHAR2B</type></link> structure whose <structfield>BYTE1</structfield>
1214 is zero and whose <structfield>BYTE2</structfield> is
1215 <quote><literal>c</literal></quote>.
1220 <section id="Data_Types:TIMESTAMP">
1221 <title><type>TIMESTAMP</type></title>
1222 <indexterm zone="Data_Types:TIMESTAMP" significance="preferred"><primary>TIMESTAMP</primary></indexterm>
1223 <informaltable frame='none'>
1224 <?dbfo keep-together="always" ?>
1225 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
1226 <colspec colname='c1' colwidth='1.0*'/>
1227 <colspec colname='c2' colwidth='1.0*'/>
1228 <colspec colname='c3' colwidth='1.0*'/>
1230 <row><entry><type>TIMESTAMP</type>:</entry><entry> <type>CARD32</type></entry></row>
1236 This is the number of milliseconds that have passed since a
1237 server-dependent origin. It is provided in errors and events and is
1242 <section id="Data_Types:XCHARINFO">
1243 <title><type>XCHARINFO</type></title>
1244 <indexterm zone="Data_Types:XCHARINFO" significance="preferred"><primary>XCHARINFO</primary></indexterm>
1245 <informaltable frame='none'>
1246 <?dbfo keep-together="always" ?>
1247 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
1248 <colspec colname='c1' colwidth='1.0*'/>
1249 <colspec colname='c2' colwidth='1.0*'/>
1250 <colspec colname='c3' colwidth='1.0*'/>
1252 <row><entry morerows='3'><type>XCHARINFO</type>:</entry>
1253 <entry>[ <structfield>lbearing</structfield>, <structfield>rbearing</structfield>:</entry><entry><type>INT16</type>,</entry></row>
1254 <row><entry> <structfield>width</structfield>:</entry><entry><type>INT16</type>,</entry></row>
1255 <row><entry> <structfield>ascent</structfield>, <structfield>descent</structfield>:</entry><entry><type>INT16</type>,</entry></row>
1256 <row><entry> <structfield>attributes</structfield>:</entry><entry><type>CARD16</type> ]</entry></row>
1262 This structure specifies the ink extents and horizontal escapement
1263 (also known as the set- or logical width) of an individual
1264 character. The first five values represent directed distances in
1265 a coordinate system whose origin is aligned with the lower-left
1266 edge of the left-most pixel of the glyph baseline (i.e. the
1267 baseline falls between two pixels as shown in Figure 3-1 of the
1268 <citetitle>Bitmap Distribution Format 2.1</citetitle> Consortium standard
1269 <xref linkend="References:bdf-spec"/>).
1272 The <structfield>LBEARING</structfield> field specifies the
1273 directed distance measured to the
1274 right from the origin to the left edge of the left-most inked
1278 The <structfield>RBEARING</structfield> field specifies the
1279 directed distance (measured to
1280 the right) from the origin to the right edge of the right-most
1281 inked pixel in the glyph.
1284 The <structfield>WIDTH</structfield> field specifies the
1285 directed distance (measured to the
1286 right) from the origin to the position where the next character
1287 should appear (called the <firstterm>escapement point</firstterm>). This
1288 distance includes any whitespace used for intercharacter padding and is
1289 also referred to as the <firstterm>logical width</firstterm> or
1290 <firstterm>horizontal escapement</firstterm>.
1291 <indexterm zone="Data_Types:XCHARINFO" significance="preferred"><primary>horizontal escapement</primary></indexterm>
1294 The <structfield>ASCENT</structfield> field specifies the
1295 directed distance (measured up)
1296 from the baseline to the top edge of the top-most inked pixel
1300 The <structfield>DESCENT</structfield> field specifies the
1301 directed distance (measured
1302 down) from the baseline to the bottom edge of the bottom-most
1306 The <structfield>ATTRIBUTES</structfield> field specifies
1307 glyph-specific information that
1308 is passed through the application. If this value is not being
1309 used, it should be zero.
1312 The ink bounding box of a glyph is defined to be the smallest
1313 rectangle that encloses all of the inked pixels. This box has
1315 <structfield>RBEARING</structfield> − <structfield>LBEARING</structfield>
1316 pixels and a height of
1317 <structfield>ASCENT</structfield> + <structfield>DESCENT</structfield> pixels.
1321 <section id="Data_Types:XFONTINFO">
1322 <title><type>XFONTINFO</type></title>
1323 <indexterm zone="Data_Types:XFONTINFO" significance="preferred"><primary>XFONTINFO</primary></indexterm>
1324 <informaltable frame='none'>
1325 <?dbfo keep-together="always" ?>
1326 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
1327 <colspec colname='c1' colwidth='1.0*'/>
1328 <colspec colname='c2' colwidth='1.0*'/>
1329 <colspec colname='c3' colwidth='1.0*'/>
1331 <row><entry morerows='8'><type>XFONTINFO</type>:</entry>
1332 <entry>[ <structfield>flags</structfield>:</entry><entry><type>CARD32</type>,</entry></row>
1333 <row><entry> <structfield>drawing-direction</structfield>:</entry><entry>{ <constant>LeftToRight</constant>, <constant>RightToLeft</constant> }</entry></row>
1334 <row><entry> <structfield>char-range</structfield>:</entry><entry><link linkend="Data_Types:RANGE"><type>RANGE</type></link>,</entry></row>
1335 <row><entry> <structfield>default-char</structfield>:</entry><entry><link linkend="Data_Types:CHAR2B"><type>CHAR2B</type></link>,</entry></row>
1336 <row><entry> <structfield>min-bounds</structfield>:</entry><entry><link linkend="Data_Types:XCHARINFO"><type>XCHARINFO</type></link>,</entry></row>
1337 <row><entry> <structfield>max-bounds</structfield>:</entry><entry><link linkend="Data_Types:XCHARINFO"><type>XCHARINFO</type></link>,</entry></row>
1338 <row><entry> <structfield>font-ascent</structfield>:</entry><entry><type>INT16</type>,</entry></row>
1339 <row><entry> <structfield>font-descent</structfield>:</entry><entry><type>INT16</type>,</entry></row>
1340 <row><entry> <structfield>properties</structfield>:</entry><entry><link linkend="Data_Types:PROPINFO"><type>PROPINFO</type></link> ]</entry></row>
1345 This structure specifies attributes related to the font as a
1349 The <structfield>FLAGS</structfield> field is a bit mask containing zero
1350 or more of the following boolean values (unspecified bits must be zero):
1352 <informaltable frame='none'>
1353 <?dbfo keep-together="always" ?>
1354 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
1355 <colspec colname='c1' colwidth='1.0*'/>
1356 <colspec colname='c2' colwidth='1.0*'/>
1358 <row><entry><constant>AllCharactersExist</constant></entry><entry><literal>(1 << 0)</literal></entry></row>
1359 <row><entry><constant>InkInside</constant></entry><entry><literal>(1 << 1)</literal></entry></row>
1360 <row><entry><constant>HorizontalOverlap</constant></entry><entry><literal>(1 << 2)</literal></entry></row>
1365 which have the following meanings:
1367 <varlistentry id="Constant:AllCharactersExist">
1368 <term><constant>AllCharactersExist</constant></term>
1370 <indexterm zone="Constant:AllCharactersExist" significance="preferred"><primary>AllCharactersExist</primary></indexterm>
1372 If this bit is set, all of the characters in the range given by
1373 <structfield>CHAR-RANGE</structfield> have glyphs encoded in
1374 the font. If this bit is clear, some of the characters
1375 may not have encoded glyphs.
1379 <varlistentry id="Constant:InkInside">
1380 <term><constant>InkInside</constant></term>
1382 <indexterm zone="Constant:InkInside" significance="preferred"><primary>InkInside</primary></indexterm>
1384 If this bit is set, the inked pixels of each glyph
1385 fall within the rectangle described by the font's ascent,
1386 descent, origin, and the glyph's escapement point. If
1387 this bit is clear, there may be glyphs whose ink extends
1388 outside this rectangle.
1392 <varlistentry id="Constant:HorizontalOverlap">
1393 <term><constant>HorizontalOverlap</constant></term>
1395 <indexterm zone="Constant:HorizontalOverlap" significance="preferred"><primary>HorizontalOverlap</primary></indexterm>
1397 If this bit is set, the two ink bounding
1398 boxes (smallest rectangle enclosing the inked pixels) of
1399 some pairs of glyphs in the font may overlap when displayed
1400 side-by-side (i.e. the second character is imaged at the
1401 escapement point of the first) on a common baseline. If
1402 this bit is clear, there are no pairs of glyphs whose ink
1403 bounding boxes overlap.
1409 <para id="Data_Types:XFONTINFO.DRAWING-DIRECTION">
1410 <indexterm zone="Data_Types:XFONTINFO.DRAWING-DIRECTION" significance="preferred"><primary>LeftToRight</primary></indexterm>
1411 <indexterm zone="Data_Types:XFONTINFO.DRAWING-DIRECTION" significance="preferred"><primary>RightToLeft</primary></indexterm>
1412 The <structfield>DRAWING-DIRECTION</structfield> field contains a hint
1413 indicating whether most of the character metrics have a positive (or
1414 <quote><constant>LeftToRight</constant></quote>) logical width or a
1415 negative (<quote><constant>RightToLeft</constant></quote>) logical width. It
1416 contains the following alternate values:
1417 <informaltable frame='none'>
1418 <?dbfo keep-together="always" ?>
1419 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
1420 <colspec colname='c1' colwidth='1.0*'/>
1421 <colspec colname='c2' colwidth='1.0*'/>
1423 <row><entry><constant>LeftToRight</constant></entry><entry><literal>0</literal></entry></row>
1424 <row><entry><constant>RightToLeft</constant></entry><entry><literal>1</literal></entry></row>
1430 The <structfield>CHAR-RANGE.MIN-CHAR</structfield>
1431 and <structfield>CHAR-RANGE.MAX-CHAR</structfield> fields specify the
1432 first and last character codes that have glyphs encoded in this font.
1433 All fonts must have at least one encoded glyph (in which case the
1434 <structfield>MIN-CHAR</structfield> and <structfield>MAX-CHAR</structfield>
1435 are equal), but are not required to have glyphs
1436 encoded at all positions between the first and last characters.
1439 The <structfield>DEFAULT-CHAR</structfield> field specifies
1440 the character code of the glyph
1441 that the client should substitute for unencoded characters. Requests
1442 for extents or bitmaps for an unencoded character generate zero-filled
1443 metrics and a zero-length glyph bitmap, respectively.
1446 The <structfield>MIN-BOUNDS</structfield> and
1447 <structfield>MAX-BOUNDS</structfield> fields contain the minimum and maximum
1448 values of each of the extents field of all encoded characters in the
1449 font (i.e. non-existent characters are ignored).
1452 The <structfield>FONT-ASCENT</structfield> and
1453 <structfield>FONT-DESCENT</structfield> fields specify the font designer's
1454 logical height of the font, above and below the baseline,
1455 respectively. The sum of the two values is often used as the
1456 vertical line spacing of the font. Individual glyphs are permitted
1457 to have ascents and descents that are greater than these values.
1460 The <structfield>PROPERTIES</structfield> field contains the
1461 property data associated with this font.
1464 This structure is padded to 32-bit alignment.
1469 <section id='Requests'>
1470 <title>Requests</title>
1472 <!-- (SN Requests -->
1475 This section describes the requests that may be sent by the client and the
1476 replies or errors that are generated in response. Versions of the protocol
1477 with the same major version are required to be upward-compatible.
1480 Every request on a given connection is implicitly assigned a sequence number,
1481 starting with 1, that is used in replies, error, and events. Servers are
1482 required to generate replies and errors in the order in which the corresponding
1483 requests are received. Servers are permitted to add or remove fonts to the
1484 list visible to the client between any two requests, but requests must be
1485 processed atomically. Each request packet is at least 4 bytes long and
1486 contains the following fields:
1487 <informaltable frame='none'>
1488 <?dbfo keep-together="always" ?>
1489 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
1490 <colspec colname='c1' colwidth='1.0*'/>
1491 <colspec colname='c2' colwidth='1.0*'/>
1492 <colspec colname='c3' colwidth='1.0*'/>
1494 <row><entry><parameter>major-opcode</parameter>:</entry><entry><type>CARD8</type></entry></row>
1495 <row><entry><parameter>minor-opcode</parameter>:</entry><entry><type>CARD8</type></entry></row>
1496 <row><entry><parameter>length</parameter>:</entry><entry><type>CARD16</type></entry></row>
1503 The <parameter>MAJOR-OPCODE</parameter> specifies which core request or
1504 extension package this packet represents. If the
1505 <parameter>MAJOR-OPCODE</parameter> corresponds to a core request, the
1506 <parameter>MINOR-OPCODE</parameter> contains 8 bits of request-specific data.
1507 Otherwise, the <parameter>MINOR-OPCODE</parameter> specifies which extension
1508 request this packet represents. The <parameter>LENGTH</parameter> field
1509 specifies the number of 4-byte units contained within the packet
1510 and must be at least one. If this field contains a value greater than one it
1511 is followed by (<parameter>LENGTH</parameter> - 1) * 4 bytes
1512 of request-specific data. Unless
1513 otherwise specified, unused bytes are not required to be zero.
1516 If a request packet contains too little or too much data, the server returns
1517 a <link linkend="Errors:Length"><errorname>Length</errorname></link> error.
1518 If the server runs out of internal
1519 resources (such as memory) while processing a request, it returns an
1520 <link linkend="Errors:Alloc"><errorname>Alloc</errorname></link> error.
1521 If a server is deficient (and therefore non-compliant) and is unable to
1522 process a request, it may return an
1523 <link linkend="Errors:Implementation"><errorname>Implementation</errorname></link> error.
1524 If a client uses an extension request without previously having issued a
1525 <link linkend="Requests:QueryExtension"><function>QueryExtension</function></link>
1526 request for that extension, the server responds with a
1527 <link linkend="Errors:Request"><errorname>Request</errorname></link>
1528 error. If the server encounters a request with an unknown
1529 <parameter>MAJOR-OPCODE</parameter> or <parameter>MINOR-OPCODE</parameter>,
1531 <link linkend="Errors:Request"><errorname>Request</errorname></link>
1533 At most one error is generated per request. If more than one error condition
1534 is encountered in processing a requests, the choice of which error is returned
1535 is server-dependent.
1538 Core requests have <parameter>MAJOR-OPCODE</parameter> values between 0 and
1539 127, inclusive. Extension requests have <parameter>MAJOR-OPCODE</parameter>
1540 values between 128 and 255, inclusive, that are assigned by by the server.
1541 All <parameter>MINOR-OPCODE</parameter> values in extension requests are
1542 between 0 and 255, inclusive.
1545 Each reply is at least 8 bytes long and contains the following fields:
1546 <informaltable frame='none'>
1547 <?dbfo keep-together="always" ?>
1548 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
1549 <colspec colname='c1' colwidth='1.0*'/>
1550 <colspec colname='c2' colwidth='1.0*'/>
1551 <colspec colname='c3' colwidth='1.0*'/>
1553 <row><entry><parameter>type</parameter>:</entry><entry><type>CARD8</type></entry><entry>value of 0</entry></row>
1554 <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD8</type></entry></row>
1555 <row><entry><parameter>sequence-number</parameter>:</entry><entry><type>CARD16</type></entry></row>
1556 <row><entry><parameter>length</parameter>:</entry><entry><type>CARD32</type></entry></row>
1562 The <parameter>TYPE</parameter> field has a value of zero.
1563 The <parameter>DATA-OR-UNUSED</parameter> field may be used to
1564 encode one byte of reply-specific data (see
1565 <link linkend="Encoding::Requests">Section 5.2 on request encoding</link>).
1566 The least-significant 16 bits of the sequence number of the request that
1567 generated the reply are stored in the <parameter>SEQUENCE-NUMBER</parameter>
1568 field. The <parameter>LENGTH</parameter> field specifies the number of
1569 4-byte units in this reply packet, including the fields described above,
1570 and must be at least two. If <parameter>LENGTH</parameter> is greater
1571 than two, the fields described above are followed by
1572 (<parameter>LENGTH</parameter> - 2) * 4 bytes of additional data.
1575 Requests that have replies are described using the following syntax:
1577 <emphasis role="bold"><function>RequestName</function></emphasis>
1578 <informaltable frame='none'>
1579 <?dbfo keep-together="always" ?>
1580 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
1581 <colspec colname='c1' colwidth='1.0*'/>
1582 <colspec colname='c2' colwidth='1.0*'/>
1584 <row><entry><parameter>arg1</parameter>:</entry><entry><type>type1</type></entry></row>
1585 <row><entry><parameter>arg2</parameter>:</entry><entry><type>type2</type></entry></row>
1586 <row><entry> ...</entry></row>
1587 <row><entry><parameter>argN</parameter>:</entry><entry><type>typeN</type></entry></row>
1588 <row><entry> ▶</entry></row>
1589 <row><entry><parameter>result1</parameter>:</entry><entry><type>type1</type></entry></row>
1590 <row><entry><parameter>result2</parameter>:</entry><entry><type>type2</type></entry></row>
1591 <row><entry> ...</entry></row>
1592 <row rowsep="1"><entry><parameter>resultM</parameter>:</entry><entry><type>typeM</type></entry></row>
1593 <row><entry>Errors:</entry><entry><errorname>kind1</errorname>, <errorname>kind2</errorname> ..., <errorname>kindK</errorname></entry></row>
1598 </para></blockquote>
1601 If a request does not generate a reply, the ▶ and result lines are
1602 omitted. If a request may generate multiple replies, the ▶ is replaced by
1603 a ▶+. In the authorization data exchanges in the initial connection setup
1604 and the CreateAC request, ◀ indicates data sent by the client in response
1605 to data sent by the server.
1608 The protocol begins with the establishment of a connection over a
1609 mutually-understood virtual stream:
1612 <section id="Requests:open_connection">
1613 <title>open connection</title>
1614 <indexterm zone="Requests:open_connection" significance="preferred"><primary>open connection</primary></indexterm>
1615 <informaltable frame='none'>
1616 <?dbfo keep-together="always" ?>
1617 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
1618 <colspec colname='c1' colwidth='2.0*'/>
1619 <colspec colname='c2' colwidth='1.0*'/>
1621 <row><entry><parameter>byte-order</parameter>:</entry><entry><link linkend="Data_Types:BYTE"><type>BYTE</type></link></entry></row>
1622 <row><entry><parameter>client-major-protocol-version</parameter>:</entry><entry><type>CARD16</type></entry></row>
1623 <row><entry><parameter>client-minor-protocol-version</parameter>:</entry><entry><type>CARD16</type></entry></row>
1624 <row><entry><parameter>authorization-protocols</parameter>:</entry><entry><link linkend="Data_Types:AUTH"><type>LISTofAUTH</type></link></entry></row>
1629 The initial byte of the connection specifies the
1630 <parameter>BYTE-ORDER</parameter> in
1631 which subsequent 16-bit and 32-bit numeric values are to be
1632 transmitted. The octal value <literal>102</literal>
1633 (<acronym>ASCII</acronym> uppercase <quote><literal>B</literal></quote>)
1634 indicates that the most-significant byte is to be transmitted
1635 first; the octal value <literal>154</literal>
1636 (<acronym>ASCII</acronym> lowercase <quote><literal>l</literal></quote>)
1637 indicates that the least-significant byte is to be transmitted first.
1638 If any other value is encountered the server closes the
1639 connection without any response.
1642 The <parameter>CLIENT-MAJOR-PROTOCOL-VERSION</parameter> and
1643 <parameter>CLIENT-MINOR-PROTOCOL-VERSION</parameter> specify
1644 which version of the
1645 font service protocol the client would like to use. If the
1646 client can support multiple versions, the highest version
1647 should be given. This version of the protocol has a
1648 major version of 2 and a minor version of 0.
1651 The <parameter>AUTHORIZATION-PROTOCOLS</parameter>
1652 contains a list of protocol names and
1653 optional initial data for which the client can provide
1654 information. The server may use this to determine which
1655 protocol to use or as part of the initial exchange of
1658 <informaltable frame='none'>
1659 <?dbfo keep-together="always" ?>
1660 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
1661 <colspec colname='c1' colwidth='2.0*'/>
1662 <colspec colname='c2' colwidth='1.0*'/>
1664 <row><entry>▶</entry></row>
1665 <row><entry><parameter>status</parameter>:</entry><entry>{ <constant>Success</constant>, <constant>Continue</constant>,
1666 <constant>Busy</constant>, <constant>Denied</constant> }</entry></row>
1667 <row><entry><parameter>server-major-protocol-version</parameter>:</entry><entry><type>CARD16</type></entry></row>
1668 <row><entry><parameter>server-minor-protocol-version</parameter>:</entry><entry><type>CARD16</type></entry></row>
1669 <row><entry><parameter>alternate-servers-hint</parameter>:</entry><entry><link linkend="Data_Types:ALTERNATESERVER"><type>LISTofALTERNATESERVER</type></link></entry></row>
1670 <row><entry><parameter>authorization-index</parameter>:</entry><entry><type>CARD8</type></entry></row>
1671 <row><entry><parameter>authorization-data</parameter>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link></entry></row>
1676 The <parameter>SERVER-MAJOR-PROTOCOL-VERSION</parameter> and
1677 <parameter>SERVER-MINOR-PROTOCOL-VERSION</parameter> specify
1678 the version of the font
1679 service protocol that the server expects from the client. If
1680 the server supports the version specified by the client, this
1681 version number should be returned. If the client has
1682 requested a higher version than is supported by the server,
1683 the server's highest version should be returned. Otherwise,
1684 if the client has requested a lower version than is supported
1685 by the server, the server's lowest version should be returned.
1686 It is the client's responsibility to decide whether or not it
1687 can match this version of the protocol.
1690 The <parameter>ALTERNATE-SERVERS-HINT</parameter>
1691 is a list of other font servers
1692 that may have related sets of fonts (determined by means
1693 outside this protocol, typically by the system administrator).
1694 Clients may choose to contact these font servers if the
1695 connection is rejected or lost.
1698 The <parameter>STATUS</parameter> field indicates whether the server accepted,
1699 rejected, or would like more information about the connection.
1700 It has one of the following alternate values:
1701 <informaltable frame='none'>
1702 <?dbfo keep-together="always" ?>
1703 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
1704 <colspec colname='c1' colwidth='2.0*'/>
1705 <colspec colname='c2' colwidth='1.0*'/>
1707 <row><entry><constant>Success</constant></entry><entry><literal>0</literal></entry></row>
1708 <row><entry><constant>Continue</constant></entry><entry><literal>1</literal></entry></row>
1709 <row><entry><constant>Busy</constant></entry><entry><literal>2</literal></entry></row>
1710 <row><entry><constant>Denied</constant></entry><entry><literal>3</literal></entry></row>
1716 If <parameter>STATUS</parameter> is <constant>Denied</constant>,
1717 the server has rejected the client's authorization information.
1718 If <parameter>STATUS</parameter> is <constant>Busy</constant>, the server has
1719 simply decided that it cannot provide fonts to this client at
1720 this time (it may be able to at a later time). In both cases,
1721 <parameter>AUTHORIZATION-INDEX</parameter> is set to zero,
1722 no authorization-data is
1723 returned, and the server closes the connection after sending
1724 the data described so far.
1727 Otherwise the <parameter>AUTHORIZATION-INDEX</parameter> is set to the index
1728 (beginning with 1) into the <parameter>AUTHORIZATION-PROTOCOLS</parameter>
1729 list of the protocol that the server will use for this connection. If
1730 the server does not want to use any of the given protocols,
1731 this value is set to zero. The <parameter>AUTHORIZATION-DATA</parameter>
1732 field is used to send back authorization protocol-dependent data to the
1733 client (such as a challenge, authentication of the server,
1737 If <parameter>STATUS</parameter> is <constant>Success</constant>,
1738 the following section of protocol is omitted. Otherwise, if
1739 <parameter>STATUS</parameter> is <constant>Continue</constant>,
1741 more authorization data from the client (i.e. the connection
1742 setup is not finished, so no requests or events may be sent):
1743 <informaltable frame='none'>
1744 <?dbfo keep-together="always" ?>
1745 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
1746 <colspec colname='c1' colwidth='1.0*'/>
1747 <colspec colname='c2' colwidth='1.0*'/>
1749 <row><entry>◀</entry></row>
1750 <row><entry><parameter>more-authorization-data</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
1751 <row><entry>▶</entry></row>
1752 <row><entry><parameter>status</parameter>:</entry><entry>{ <constant>Success</constant>, <constant>Continue</constant>, <constant>Busy</constant>, <constant>Denied</constant> }</entry></row>
1753 <row><entry><parameter>more-authorization-data</parameter>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link></entry></row>
1759 The values in <parameter>STATUS</parameter> have the same meanings as described
1760 above. This section of protocol is repeated until the server
1761 either accepts (sets <parameter>STATUS</parameter> to
1762 <constant>Success</constant>) or rejects (sets <parameter>STATUS</parameter>
1763 to <constant>Denied</constant> or <constant>Busy</constant>) the connection.
1766 Once the connection has been accepted and <parameter>STATUS</parameter>
1767 is <constant>Success</constant>,
1768 an implicit AccessContext is created for the authorization
1769 data and the protocol continues with the following data sent
1771 <informaltable frame='none'>
1772 <?dbfo keep-together="always" ?>
1773 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
1774 <colspec colname='c1' colwidth='1.0*'/>
1775 <colspec colname='c2' colwidth='1.0*'/>
1777 <row><entry>▶</entry></row>
1778 <row><entry><parameter>remaining-length</parameter>:</entry><entry><type>CARD32</type></entry></row>
1779 <row><entry><parameter>maximum-request-length</parameter>:</entry><entry><type>CARD16</type></entry></row>
1780 <row><entry><parameter>release-number</parameter>:</entry><entry><type>CARD32</type></entry></row>
1781 <row><entry><parameter>vendor</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
1787 The <parameter>REMAINING-LENGTH</parameter> specifies the length in 4-byte
1788 units of the remaining data to be transmitted to the client. The
1789 <parameter>MAXIMUM-REQUEST-LENGTH</parameter> specifies the largest request
1790 size in 4-byte units that is accepted by the server and must have a
1791 value of at least 4096. Requests with a length field larger
1792 than this value are ignored and a
1793 <link linkend="Errors:Length"><errorname>Length</errorname></link>
1795 The <parameter>VENDOR</parameter> string specifies the name of the
1796 manufacturer of the font server. The
1797 <parameter>RELEASE-NUMBER</parameter> specifies the particular
1798 release of the server in a manufacturer-dependent manner.
1803 After the connection is established and the setup information has been
1804 exchanged, the client may issue any of requests described below:
1807 <section id="Requests:NoOp">
1808 <title><function>NoOp</function></title>
1809 <indexterm zone="Requests:NoOp" significance="preferred"><primary>NoOp</primary></indexterm>
1810 <informaltable frame='none'>
1811 <?dbfo keep-together="always" ?>
1812 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
1813 <colspec colname='c1' colwidth='1.0*'/>
1814 <colspec colname='c2' colwidth='1.0*'/>
1816 <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
1821 This request does nothing. It is typically used in response
1823 <link linkend="Events:KeepAlive"><function>KeepAlive</function></link>
1828 <section id="Requests:ListExtensions">
1829 <title><function>ListExtensions</function></title>
1830 <indexterm zone="Requests:ListExtensions" significance="preferred"><primary>ListExtensions</primary></indexterm>
1831 <informaltable frame='none'>
1832 <?dbfo keep-together="always" ?>
1833 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
1834 <colspec colname='c1' colwidth='1.0*'/>
1835 <colspec colname='c2' colwidth='1.0*'/>
1837 <row><entry>▶</entry></row>
1838 <row rowsep='1'><entry><parameter>names</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>LISTofSTRING8</type></link></entry></row>
1839 <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
1845 This request returns the names of the extension packages
1846 that are supported by the server. Extension names are
1847 case-sensitive and are encoded in <acronym>ISO</acronym> 8859-1.
1852 <section id="Requests:QueryExtension">
1853 <title><function>QueryExtension</function></title>
1854 <indexterm zone="Requests:QueryExtension" significance="preferred"><primary>QueryExtension</primary></indexterm>
1856 <informaltable frame='none'>
1857 <?dbfo keep-together="always" ?>
1858 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
1859 <colspec colname='c1' colwidth='1.0*'/>
1860 <colspec colname='c2' colwidth='1.0*'/>
1862 <row><entry><parameter>name</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
1863 <row><entry>▶</entry></row>
1864 <row><entry><parameter>present</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
1865 <row><entry><parameter>major-version</parameter>:</entry><entry><type>CARD16</type></entry></row>
1866 <row><entry><parameter>minor-version</parameter>:</entry><entry><type>CARD16</type></entry></row>
1867 <row><entry><parameter>major-opcode</parameter>:</entry><entry><type>CARD8</type></entry></row>
1868 <row><entry><parameter>first-event</parameter>:</entry><entry><type>CARD8</type></entry></row>
1869 <row><entry><parameter>number-events</parameter>:</entry><entry><type>CARD8</type></entry></row>
1870 <row><entry><parameter>first-error</parameter>:</entry><entry><type>CARD8</type></entry></row>
1871 <row rowsep='1'><entry><parameter>number-errors</parameter>:</entry><entry><type>CARD8</type></entry></row>
1872 <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
1877 This request determines whether or not the extension package specified by
1878 <parameter>NAME</parameter> (encoded in <acronym>ISO</acronym> 8859-1) is
1879 supported by the server and that there is sufficient number of major opcode,
1880 event, and error codes available. If so, then <parameter>PRESENT</parameter>
1881 is set to <constant>True</constant>, <parameter>MAJOR-VERSION</parameter>
1882 and <parameter>MINOR-VERSION</parameter> are set to the
1883 respective major and minor version numbers of the protocol
1884 that the server would prefer; <parameter>MAJOR-OPCODE</parameter> is set to
1885 the value to use in extension requests; <parameter>FIRST-EVENT</parameter>
1886 is set to the value of the first extension-specific event code or zero if the
1887 extension does not have any events; <parameter>NUMBER-EVENTS</parameter> is
1888 set to the number of new events that the event defines;
1889 <parameter>FIRST-ERROR</parameter>
1890 is set to the value of the first extension-specific error code
1891 or zero if the extension does not define any new errors; and
1892 <parameter>NUMBER-ERRORS</parameter> is set to the number of
1893 new errors the extension defines.
1896 Otherwise, <parameter>PRESENT</parameter> is set to
1897 <constant>False</constant> and the remaining fields are
1901 The server is free to return different values to different
1902 clients. Therefore, clients must use this request before
1903 issuing any of the requests in the named extension package or
1905 <link linkend="Requests:SetEventMask"><function>SetEventMask</function></link> request to express interest in any of
1906 this extension's events. Otherwise, a
1907 <link linkend="Errors:Request"><errorname>Request</errorname></link>
1912 <section id="Requests:ListCatalogues">
1913 <title><function>ListCatalogues</function></title>
1914 <indexterm zone="Requests:ListCatalogues" significance="preferred"><primary>ListCatalogues</primary></indexterm>
1916 <informaltable frame='none'>
1917 <?dbfo keep-together="always" ?>
1918 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
1919 <colspec colname='c1' colwidth='1.0*'/>
1920 <colspec colname='c2' colwidth='1.0*'/>
1922 <row><entry><parameter>pattern</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
1923 <row><entry><parameter>max-names</parameter>:</entry><entry><type>CARD32</type></entry></row>
1924 <row><entry>▶+</entry></row>
1925 <row><entry><parameter>replies-following-hint</parameter>:</entry><entry><type>CARD32</type></entry></row>
1926 <row rowsep='1'><entry><parameter>names</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>LISTofSTRING8</type></link></entry></row>
1927 <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
1932 This request returns a list of at most <parameter>MAX-NAMES</parameter> names
1933 of collections (called catalogues) of fonts that match
1934 the specified <parameter>PATTERN</parameter>. In the pattern (which is encoded
1935 in <acronym>ISO</acronym> 8859-1), the
1936 <quote><literal>?</literal></quote> character (octal <literal>77</literal>)
1937 matches any single character; the
1938 <quote><literal>*</literal></quote> character (octal <literal>52</literal>)
1939 matches any series of zero or more characters; and alphabetic
1940 characters match either upper- or lowercase. The
1941 returned <parameter>NAMES</parameter> are encoded in
1942 <acronym>ISO</acronym> 8859-1 and may contain
1943 mixed character cases.
1946 If <parameter>PATTERN</parameter> is of zero length or
1947 <parameter>MAX-NAMES</parameter> is equal to zero,
1948 one reply containing a zero-length list of names is returned.
1949 This may be used to synchronize the client with the server.
1952 Servers are free to add or remove catalogues to the set returned by
1953 <function>ListCatalogues</function>
1954 between any two requests. This request is not
1955 cumulative; repeated uses are processed in isolation and do
1956 result in an iteration through the list.
1959 To reduce the amount of buffering needed by the server, the
1960 list of names may be split across several reply packets, so
1961 long as the names arrive in the same order that they would
1962 have appeared had they been in a single packet. The
1963 <parameter>REPLIES-FOLLOWING-HINT</parameter> field in all but the last reply
1964 contains a positive value that specifies the number of
1965 replies that are likely, but not required, to follow. In the
1966 last reply, which may contain zero or more names, this field
1971 <section id="Requests:SetCatalogues">
1972 <title><function>SetCatalogues</function></title>
1973 <indexterm zone="Requests:SetCatalogues" significance="preferred"><primary>SetCatalogues</primary></indexterm>
1974 <informaltable frame='none'>
1975 <?dbfo keep-together="always" ?>
1976 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
1977 <colspec colname='c1' colwidth='1.0*'/>
1978 <colspec colname='c2' colwidth='1.0*'/>
1980 <row rowsep='1'><entry><parameter>names</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>LISTofSTRING8</type></link></entry></row>
1981 <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link>,
1982 <link linkend="Errors:Name"><errorname>Name</errorname></link></entry></row>
1987 This request sets the list of catalogues whose fonts should be
1988 visible to the client. The union of the fonts provided by
1989 each of the named catalogues forms the set of fonts whose
1990 names match patterns in
1991 <link linkend="Requests:ListFonts"><function>ListFonts</function></link>,
1992 <link linkend="Requests:ListFontsWithXInfo"><function>ListFontsWithXInfo</function></link>,
1994 <link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>
1995 requests. The catalogue names are
1996 case-insensitive and are encoded in <acronym>ISO</acronym> 8859-1. A zero-length
1997 list resets the client's catalogue list to the
1998 server-dependent default.
2001 If any of the catalogue names are invalid, a
2002 <link linkend="Errors:Name"><errorname>Name</errorname></link>
2003 error is returned and the request is ignored.
2007 <section id="Requests:GetCatalogues">
2008 <title><function>GetCatalogues</function></title>
2009 <indexterm zone="Requests:GetCatalogues" significance="preferred"><primary>GetCatalogues</primary></indexterm>
2010 <informaltable frame='none'>
2011 <?dbfo keep-together="always" ?>
2012 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2013 <colspec colname='c1' colwidth='1.0*'/>
2014 <colspec colname='c2' colwidth='1.0*'/>
2016 <row><entry>▶</entry></row>
2017 <row rowsep='1'><entry><parameter>names</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>LISTofSTRING8</type></link></entry></row>
2018 <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
2023 This request returns the current list of catalogue names
2024 (encoded in <acronym>ISO</acronym> 8859-1) associated with the client. These
2025 catalogues determine the set of fonts that are visible
2027 <link linkend="Requests:ListFonts"><function>ListFonts</function></link>,
2028 <link linkend="Requests:ListFontsWithXInfo"><function>ListFontsWithXInfo</function></link>,
2030 <link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>.
2031 A zero-length list indicates the server's default set of
2032 fonts. Catalogue names are case-insensitive and may be
2033 returned in mixed case.
2037 <section id="Requests:SetEventMask">
2038 <title><function>SetEventMask</function></title>
2039 <indexterm zone="Requests:SetEventMask" significance="preferred"><primary>SetEventMask</primary></indexterm>
2040 <informaltable frame='none'>
2041 <?dbfo keep-together="always" ?>
2042 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2043 <colspec colname='c1' colwidth='1.0*'/>
2044 <colspec colname='c2' colwidth='1.0*'/>
2046 <row><entry><parameter>extension-opcode</parameter>:</entry><entry><type>CARD8</type></entry></row>
2047 <row rowsep='1'><entry><parameter>event-mask</parameter>:</entry><entry><link linkend="Data_Types:EVENTMASK"><type>EVENTMASK</type></link></entry></row>
2048 <row><entry>Errors:</entry><entry><link linkend="Errors:EventMask"><errorname>EventMask</errorname></link>,
2049 <link linkend="Errors:Request"><errorname>Request</errorname></link></entry></row>
2054 This request specifies the set of maskable events that the
2055 extension indicated by <parameter>EXTENSION-OPCODE</parameter>
2056 (or zero for the core)
2057 should generate for the client. Event masks are limited in
2058 scope to the extension (or core) for which they are defined,
2059 so expressing interest in events from one or more extensions
2060 requires multiple uses of this request.
2063 The default event mask if
2064 <function>SetEventMask</function>
2066 is zero, indicating no interest in any maskable events.
2067 Some events are not maskable and cannot be blocked.
2070 If <parameter>EXTENSION-OPCODE</parameter> is not a valid extension
2071 opcode previously returned by
2072 <link linkend="Requests:QueryExtension"><function>QueryExtension</function></link>
2074 <link linkend="Errors:Request"><errorname>Request</errorname></link>
2076 returned. If <parameter>EVENT-MASK</parameter> contains any bits that do not
2077 correspond to valid events for the specified extension (or
2079 <link linkend="Errors:EventMask"><errorname>EventMask</errorname></link>
2080 error is returned and the request is
2085 <section id="Requests:GetEventMask">
2086 <title><function>GetEventMask</function></title>
2087 <indexterm zone="Requests:GetEventMask" significance="preferred"><primary>GetEventMask</primary></indexterm>
2088 <informaltable frame='none'>
2089 <?dbfo keep-together="always" ?>
2090 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2091 <colspec colname='c1' colwidth='1.0*'/>
2092 <colspec colname='c2' colwidth='1.0*'/>
2094 <row><entry><parameter>extension-opcode</parameter>:</entry><entry><type>CARD8</type></entry></row>
2095 <row><entry>▶</entry></row>
2096 <row rowsep='1'><entry><parameter>event-mask</parameter>:</entry><entry><link linkend="Data_Types:EVENTMASK"><type>EVENTMASK</type></link></entry></row>
2097 <row><entry>Errors:</entry><entry><link linkend="Errors:Request"><errorname>Request</errorname></link></entry></row>
2102 This request returns the set of maskable core events the
2103 extension indicated by <parameter>EXTENSION-OPCODE</parameter>
2104 (or the core if zero)
2105 should generate for the client. Non-maskable events are
2106 always sent to the client.
2109 If <parameter>EXTENSION-OPCODE</parameter> is not a valid extension opcode
2110 previously returned by
2111 <link linkend="Requests:QueryExtension"><function>QueryExtension</function></link>
2113 <link linkend="Errors:Request"><errorname>Request</errorname></link>
2118 <section id="Requests:CreateAC">
2119 <title><function>CreateAC</function></title>
2120 <indexterm zone="Requests:CreateAC" significance="preferred"><primary>CreateAC</primary></indexterm>
2121 <informaltable frame='none'>
2122 <?dbfo keep-together="always" ?>
2123 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2124 <colspec colname='c1' colwidth='1.0*'/>
2125 <colspec colname='c2' colwidth='1.0*'/>
2127 <row><entry><parameter>ac</parameter>:</entry><entry><link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link></entry></row>
2128 <row><entry><parameter>authorization-protocols</parameter>:</entry><entry><link linkend="Data_Types:AUTH"><type>LISTofAUTH</type></link></entry></row>
2129 <row><entry>▶</entry></row>
2130 <row><entry><parameter>status</parameter>:</entry><entry>{ <constant>Success</constant>, <constant>Continue</constant>, <constant>Denied</constant> }</entry></row>
2131 <row><entry><parameter>authorization-index</parameter>:</entry><entry><type>CARD8</type></entry></row>
2132 <row rowsep='1'><entry><parameter>authorization-data</parameter>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link></entry></row>
2133 <row><entry>Errors:</entry><entry><link linkend="Errors:IDChoice"><errorname>IDChoice</errorname></link></entry></row>
2138 This request creates a new
2139 <type>AccessContext</type>
2141 server containing the specified authorization data. When
2143 <type>AccessContext</type>
2144 is selected by the client using the
2145 <link linkend="Requests:SetAuthorization"><function>SetAuthorization</function></link>
2146 request, the data may be used by the server
2147 to determine whether or not the client should be granted
2148 access to particular font information.
2151 If <parameter>STATUS</parameter> is <constant>Denied</constant>, the server
2152 rejects the client's authorization information and does not associate
2153 <parameter>AC</parameter> with any valid <type>AccessContext</type>.
2154 In this case, <parameter>AUTHORIZATION-INDEX</parameter> is set
2155 to zero, and zero bytes of <parameter>AUTHORIZATION-DATA</parameter>
2159 Otherwise, <parameter>AUTHORIZATION-INDEX</parameter> is set to the index
2160 (beginning with 1) into the <parameter>AUTHORIZATION-PROTOCOLS</parameter>
2161 list of the protocol
2162 that the server will use for this connection. If the server
2163 does not want to use any of the given protocols, this value is
2164 set to zero. The <parameter>AUTHORIZATION-DATA</parameter> field is used
2165 to send back authorization protocol-dependent data to the client (such
2166 as a challenge, authentication of the server, etc.).
2169 If <parameter>STATUS</parameter> is <constant>Continue</constant>,
2170 the client is expected to continue
2171 the request by sending the following protocol and receiving
2172 the indicated response from the server. This continues
2173 until <parameter>STATUS</parameter> is set to either
2174 <constant>Success</constant> or <constant>Denied</constant>.
2176 <informaltable frame='none'>
2177 <?dbfo keep-together="always" ?>
2178 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2179 <colspec colname='c1' colwidth='1.0*'/>
2180 <colspec colname='c2' colwidth='1.0*'/>
2182 <row><entry> ◀</entry></row>
2183 <row><entry><parameter> more-authorization-data</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
2184 <row><entry> ▶</entry></row>
2185 <row><entry><parameter>status</parameter>:</entry><entry>{ <constant>Success</constant>, <constant>Continue</constant>, <constant>Denied</constant> }</entry></row>
2186 <row><entry><parameter> more-authorization-data</parameter>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link></entry></row>
2191 Once the connection has been accepted and <parameter>STATUS</parameter>
2192 is <constant>Success</constant>, the request is complete.
2195 If <parameter>AC</parameter> is not in the range
2196 [1..2<superscript>29</superscript>-1] or is already associated
2197 with an access context, an <link linkend="Errors:IDChoice"><errorname>IDChoice</errorname></link> error is returned.
2201 <section id="Requests:FreeAC">
2202 <title><function>FreeAC</function></title>
2203 <indexterm zone="Requests:FreeAC" significance="preferred"><primary>FreeAC</primary></indexterm>
2204 <informaltable frame='none'>
2205 <?dbfo keep-together="always" ?>
2206 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2207 <colspec colname='c1' colwidth='1.0*'/>
2208 <colspec colname='c2' colwidth='1.0*'/>
2210 <row><entry><parameter>ac</parameter>:</entry><entry><link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link></entry></row>
2211 <row rowsep='1'><entry>Errors:</entry><entry><link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link>,
2212 <link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
2217 This request indicates that the specified <parameter>AC</parameter> should
2218 no longer be associated with a valid access context.
2219 If <parameter>AC</parameter> is also the current
2220 <type>AccessContext</type>
2222 <link linkend="Requests:SetAuthorization"><function>SetAuthorization</function></link>
2223 request), an implicit
2224 <link linkend="Requests:SetAuthorization"><function>SetAuthorization</function></link>
2225 of <constant>None</constant> is done to
2227 <type>AccessContext</type>
2228 established for the initial
2229 connection setup. Operations on fonts that were opened under
2230 <parameter>AC</parameter> are not affected. The client may reuse the
2231 value of <parameter>AC</parameter> in a subsequent
2232 <link linkend="Requests:CreateAC"><function>CreateAC</function></link>
2236 If <parameter>AC</parameter> isn't associated with any valid authorization
2237 previously created by
2238 <link linkend="Requests:CreateAC"><function>CreateAC</function></link>, an
2239 <link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link>
2244 <section id="Requests:SetAuthorization">
2245 <title><function>SetAuthorization</function></title>
2246 <indexterm zone="Requests:SetAuthorization" significance="preferred"><primary>SetAuthorization</primary></indexterm>
2247 <informaltable frame='none'>
2248 <?dbfo keep-together="always" ?>
2249 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2250 <colspec colname='c1' colwidth='1.0*'/>
2251 <colspec colname='c2' colwidth='1.0*'/>
2253 <row><entry><parameter>ac</parameter>:</entry><entry><link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link></entry></row>
2254 <row rowsep='1'><entry>Errors:</entry><entry><link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link></entry></row>
2259 This request sets the
2260 <type>AccessContext</type>
2261 to be used for subsequent
2262 requests (except for
2263 <link linkend="Requests:QueryXInfo"><function>QueryXInfo</function></link>,
2264 <link linkend="Requests:QueryXExtents8"><function>QueryXExtents8</function></link>,
2265 <link linkend="Requests:QueryXExtents16"><function>QueryXExtents16</function></link>,
2266 <link linkend="Requests:QueryXBitmaps8"><function>QueryXBitmaps8</function></link>,
2267 <link linkend="Requests:QueryXBitmaps16"><function>QueryXBitmaps16</function></link>
2269 <link linkend="Requests:CloseFont"><function>CloseFont</function></link>
2270 which are done under the
2271 <type>AccessContext</type>
2274 <link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>
2276 An <parameter>AC</parameter> of <constant>None</constant> restores the
2277 <type>AccessContext</type>
2278 established for the initial connection setup.
2281 If <parameter>AC</parameter> is neither <constant>None</constant>
2282 nor a value associated with a valid <type>AccessContext</type>
2283 previously created by
2284 <link linkend="Requests:CreateAC"><function>CreateAC</function></link>,
2286 <link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link>
2291 <section id="Requests:SetResolution">
2292 <title><function>SetResolution</function></title>
2293 <indexterm zone="Requests:SetResolution" significance="preferred"><primary>SetResolution</primary></indexterm>
2294 <informaltable frame='none'>
2295 <?dbfo keep-together="always" ?>
2296 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2297 <colspec colname='c1' colwidth='1.0*'/>
2298 <colspec colname='c2' colwidth='1.0*'/>
2300 <row rowsep='1'><entry><parameter>resolutions</parameter>:</entry><entry><link linkend="Data_Types:RESOLUTION"><type>LISTofRESOLUTION</type></link></entry></row>
2301 <row><entry>Errors:</entry><entry><link linkend="Errors:Resolution"><errorname>Resolution</errorname></link>,
2302 <link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
2307 This request provides a hint as to the resolution and
2308 preferred point size of the drawing surfaces for which the
2309 client will be requesting fonts. The server may use this
2310 information to set the RESOLUTION_X and RESOLUTION_Y fields
2311 of scalable <acronym>XLFD</acronym> font names, to order sets of names based on
2312 their resolutions, and to choose the server-dependent
2313 instance that is used when a partially-specified scalable
2317 If a zero-length list of <link linkend="Data_Types:RESOLUTION"><type>RESOLUTION</type></link>s is given, the
2318 server-dependent default value is restored. Otherwise, if
2319 elements of all of the specified <link linkend="Data_Types:RESOLUTION"><type>RESOLUTION</type></link>s are non-zero, the
2320 default resolutions for this client are changed.
2323 If a <link linkend="Data_Types:RESOLUTION"><type>RESOLUTION</type></link> entry contains a zero,
2324 a <link linkend="Errors:Resolution"><errorname>Resolution</errorname></link> error is
2325 returned and the default resolutions are not changed.
2329 <section id="Requests:GetResolution">
2330 <title><function>GetResolution</function></title>
2331 <indexterm zone="Requests:GetResolution" significance="preferred"><primary>GetResolution</primary></indexterm>
2332 <informaltable frame='none'>
2333 <?dbfo keep-together="always" ?>
2334 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2335 <colspec colname='c1' colwidth='1.0*'/>
2336 <colspec colname='c2' colwidth='1.0*'/>
2338 <row><entry>▶</entry></row>
2339 <row rowsep='1'><entry><parameter>resolutions</parameter>:</entry><entry><link linkend="Data_Types:RESOLUTION"><type>LISTofRESOLUTION</type></link></entry></row>
2340 <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
2345 This request returns the current list of default resolutions.
2346 If a client has not performed a
2347 <link linkend="Requests:SetResolution"><function>SetResolution</function></link>,
2348 a server-dependent default value is returned.
2352 <section id="Requests:ListFonts">
2353 <title><function>ListFonts</function></title>
2354 <indexterm zone="Requests:ListFonts" significance="preferred"><primary>ListFonts</primary></indexterm>
2355 <informaltable frame='none'>
2356 <?dbfo keep-together="always" ?>
2357 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2358 <colspec colname='c1' colwidth='1.0*'/>
2359 <colspec colname='c2' colwidth='1.0*'/>
2361 <row><entry><parameter>pattern</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
2362 <row><entry><parameter>max-names</parameter>:</entry><entry><type>CARD32</type></entry></row>
2363 <row><entry>▶+</entry></row>
2364 <row><entry><parameter>replies-following-hint</parameter>:</entry><entry><type>CARD32</type></entry></row>
2365 <row rowsep='1'><entry><parameter>names</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>LISTofSTRING8</type></link></entry></row>
2366 <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
2371 This request returns a list of at most <parameter>MAX-NAMES</parameter>
2372 font names that match the specified <parameter>PATTERN</parameter>,
2373 according to matching rules
2374 of the <olink targetdoc='xlfd' targetptr='xlfd'><citetitle>X Logical
2375 Font Description Conventions</citetitle></olink>
2376 <xref linkend="References:xlfd-spec"/>.
2377 In the pattern (which is encoded in <acronym>ISO</acronym> 8859-1) the
2378 <quote><literal>?</literal></quote> character (octal <literal>77</literal>)
2379 matches any single character; the
2380 <quote><literal>*</literal></quote> character (octal <literal>52</literal>)
2381 matches any series of zero or more characters; and
2382 alphabetic characters match either upper- or lowercase. The
2383 returned <parameter>NAMES</parameter> are encoded in
2384 <acronym>ISO</acronym> 8859-1 and may contain mixed
2385 character cases. Font names are not required to be in <acronym>XLFD</acronym>
2389 If <parameter>PATTERN</parameter> is of zero length or
2390 <parameter>MAX-NAMES</parameter> is equal to zero,
2391 one reply containing a zero-length list of names is returned.
2392 This may be used to synchronize the client with the server.
2395 Servers are free to add or remove fonts to the set returned by
2396 <function>ListFonts</function>
2397 between any two requests. This request is not
2398 cumulative; repeated uses are processed in isolation and do
2399 result in an iteration through the list.
2402 To reduce the amount of buffering needed by the server, the
2403 list of names may be split across several reply packets, so
2404 long as the names arrive in the same order that they would
2405 have appeared had they been in a single packet. The
2406 <parameter>REPLIES-FOLLOWING-HINT</parameter> field in all but the last reply
2407 contains a positive value that specifies the number of
2408 replies that are likely, but not required, to follow. In the
2409 last reply, which may contain zero or more names, this field
2414 <section id="Requests:ListFontsWithXInfo">
2415 <title><function>ListFontsWithXInfo</function></title>
2416 <indexterm zone="Requests:ListFontsWithXInfo" significance="preferred"><primary>ListFontsWithXInfo</primary></indexterm>
2417 <informaltable frame='none'>
2418 <?dbfo keep-together="always" ?>
2419 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2420 <colspec colname='c1' colwidth='1.0*'/>
2421 <colspec colname='c2' colwidth='1.0*'/>
2423 <row><entry><parameter>pattern</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
2424 <row><entry><parameter>pattern</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
2425 <row><entry><parameter>pattern</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
2426 <row><entry><parameter>max-names</parameter>:</entry><entry><type>CARD32</type></entry></row>
2427 <row><entry>▶+</entry></row>
2428 <row><entry><parameter>replies-following-hint</parameter>:</entry><entry><type>CARD32</type></entry></row>
2429 <row><entry><parameter>info</parameter>:</entry><entry><link linkend="Data_Types:XFONTINFO"><type>XFONTINFO</type></link></entry></row>
2430 <row rowsep='1'><entry><parameter>name</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
2431 <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
2436 This request is similar to
2437 <link linkend="Requests:ListFonts"><function>ListFonts</function></link>
2438 except that a separate
2439 reply containing the name, header, and property data is
2440 generated for each matching font name. Following these
2441 replies, if any, a final reply containing a zero-length
2442 <parameter>NAME</parameter> and no <parameter>INFO</parameter> is sent.
2445 The <parameter>REPLIES-FOLLOWING-HINT</parameter> field in all but the
2446 last reply contains a positive value that specifies the number of replies
2447 that are likely, but not required, to follow. In the last
2448 reply, this field is set to zero.
2451 If <parameter>PATTERN</parameter> is of zero length or if
2452 <parameter>MAX-NAMES</parameter> is equal to zero, only the final reply
2453 containing a zero-length <parameter>NAME</parameter> and no
2454 <parameter>INFO</parameter> is returned. This may be used to synchronize the
2455 client with the server.
2459 <section id="Requests:OpenBitmapFont">
2460 <title><function>OpenBitmapFont</function></title>
2461 <indexterm zone="Requests:OpenBitmapFont" significance="preferred"><primary>OpenBitmapFont</primary></indexterm>
2462 <informaltable frame='none'>
2463 <?dbfo keep-together="always" ?>
2464 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2465 <colspec colname='c1' colwidth='1.0*'/>
2466 <colspec colname='c2' colwidth='1.0*'/>
2468 <row><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry></row>
2469 <row><entry><parameter>pattern</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
2470 <row><entry><parameter>format-mask</parameter>:</entry><entry><link linkend="Data_Types:BITMAPFORMATMASK"><type>BITMAPFORMATMASK</type></link></entry></row>
2471 <row><entry><parameter>format-hint</parameter>:</entry><entry><link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link></entry></row>
2472 <row><entry>▶</entry></row>
2473 <row><entry><parameter>otherid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link> or <constant>None</constant></entry></row>
2474 <row><entry><parameter>otherid-valid</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
2475 <row rowsep='1'><entry><parameter>cachable</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
2476 <row><entry>Errors:</entry><entry>
2477 <link linkend="Errors:IDChoice"><errorname>IDChoice</errorname></link>,
2478 <link linkend="Errors:Name"><errorname>Name</errorname></link>,
2479 <link linkend="Errors:Format"><errorname>Format</errorname></link>,
2480 <link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link>,
2481 <link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
2486 This request looks for a server-dependent choice of the
2487 font names that match the specified <parameter>PATTERN</parameter>
2488 according to the rules described for
2489 <link linkend="Requests:ListFonts"><function>ListFonts</function></link>.
2490 If no matches are found, a
2491 <link linkend="Errors:Name"><errorname>Name</errorname></link>
2492 error is returned. Otherwise, the server attempts to
2493 open the font associated with the chosen name.
2496 Permission to access the font is determined by the server
2497 according the licensing policy used for this font. The server
2498 may use the client's current
2499 <type>AccessContext</type>
2502 <link linkend="Requests:SetAuthorization"><function>SetAuthorization</function></link>
2503 request or the original connection
2504 setup) to determine any client-specific sets of permissions.
2505 After the font has been opened, the client is allowed to
2507 <type>AccessContext</type>
2509 <link linkend="Requests:SetAuthorization"><function>SetAuthorization</function></link>
2512 <type>AccessContext</type>
2514 <link linkend="Requests:FreeAC"><function>FreeAC</function></link>
2516 <link linkend="Requests:QueryXInfo"><function>QueryXInfo</function></link>,
2517 <link linkend="Requests:QueryXExtents8"><function>QueryXExtents8</function></link>,
2518 <link linkend="Requests:QueryXExtents16"><function>QueryXExtents16</function></link>,
2519 <link linkend="Requests:QueryXBitmaps8"><function>QueryXBitmaps8</function></link>,
2520 <link linkend="Requests:QueryXBitmaps16"><function>QueryXBitmaps16</function></link>
2522 <link linkend="Requests:CloseFont"><function>CloseFont</function></link>
2523 requests on this <link linkend="Data_Types:FONTID"><type>FONTID</type></link> are
2524 performed according to permissions granted at the time of the
2525 <function>OpenBitmapFont</function>
2529 If the server is willing and able to detect that the client
2530 has already opened the font successfully (possibly under a
2531 different name), the <parameter>OTHERID</parameter> field
2532 may be set to one of the
2533 identifiers previously used to open the font. The
2534 <parameter>OTHERID-VALID</parameter> field indicates whether or not
2535 <parameter>OTHERID</parameter> is still associated with an open font:
2536 if it is <constant>True</constant>, the client may use
2537 <parameter>OTHERID</parameter> as an alternative to
2538 <parameter>FONTID</parameter>. Otherwise, if
2539 <parameter>OTHERID-VALID</parameter> is <constant>False</constant>,
2540 <parameter>OTHERID</parameter> is no longer
2541 open but has not been reused by a subsequent
2542 <function>OpenBitmapFont</function>
2546 If <parameter>OTHERID</parameter> is set to <constant>None</constant>,
2547 then <parameter>OTHERID-VALID</parameter> should be set
2548 to <constant>False</constant>.
2551 The <parameter>FORMAT-MASK</parameter> indicates which fields in
2552 <parameter>FORMAT-HINT</parameter>
2553 the client is likely to use in subsequent
2554 <function>GetXBitmaps8</function>
2556 <function>GetXBitmaps16</function>
2557 requests. Servers may wish to use
2558 this information to precompute certain values.
2561 If <parameter>CACHABLE</parameter> is set to <constant>True</constant>,
2562 the client may cache the font
2563 (so that redundant opens of the same font may be avoided)
2565 <type>AccessContext</type>s
2566 during the life of the
2567 client without violating the font's licensing policy. This
2568 flag is typically set whenever a font is unlicensed or is
2569 licensed on a per-display basis. If <parameter>CACHABLE</parameter>
2570 is <constant>False</constant>, the
2571 client should reopen the font for each
2572 <type>AccessContext</type>.
2575 The server is permitted to add to or remove from the set of
2577 <link linkend="Requests:ListFonts"><function>ListFonts</function></link>
2578 between any two requests, though
2579 mechanisms outside the protocol. Therefore, it is possible
2580 for this request (which is atomic) to return a different font
2581 than would result from separate a
2582 <link linkend="Requests:ListFonts"><function>ListFonts</function></link>
2584 <function>OpenBitmapFont</function>
2585 with a non-wildcarded font name.
2588 If <parameter>FONTID</parameter> is not in the range
2589 [1..2<superscript>29</superscript>-1] or if it is already
2590 associated with an open font, an
2591 <link linkend="Errors:IDChoice"><errorname>IDChoice</errorname></link>
2593 If no font is available that matches the specified
2594 <parameter>PATTERN</parameter>, a
2595 <link linkend="Errors:Name"><errorname>Name</errorname></link>
2596 error is returned. If the font is present but the client
2597 is not permitted access, an
2598 <link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link>
2600 If <parameter>FORMAT-MASK</parameter> has any unspecified bits set or if any
2601 of the fields in <parameter>FORMAT-HINT</parameter> indicated by
2602 <parameter>FORMAT-MASK</parameter> are invalid, a
2603 <link linkend="Errors:Format"><errorname>Format</errorname></link>
2608 <section id="Requests:QueryXInfo">
2609 <title><function>QueryXInfo</function></title>
2610 <indexterm zone="Requests:QueryXInfo" significance="preferred"><primary>QueryXInfo</primary></indexterm>
2611 <informaltable frame='none'>
2612 <?dbfo keep-together="always" ?>
2613 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2614 <colspec colname='c1' colwidth='1.0*'/>
2615 <colspec colname='c2' colwidth='1.0*'/>
2617 <row><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry></row>
2618 <row><entry>▶</entry></row>
2619 <row rowsep='1'><entry><parameter>info</parameter>:</entry><entry><link linkend="Data_Types:XFONTINFO"><type>XFONTINFO</type></link></entry></row>
2620 <row><entry>Errors:</entry><entry><link linkend="Errors:Font"><errorname>Font</errorname></link>,
2621 <link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
2626 This request returns the font header and property information
2627 for the open font associated with <parameter>FONTID</parameter>.
2630 If <parameter>FONTID</parameter> is not associated with any open fonts, a
2631 <link linkend="Errors:Font"><errorname>Font</errorname></link>
2637 <section id="Requests:QueryXExtents8">
2638 <title><function>QueryXExtents8</function></title>
2639 <indexterm zone="Requests:QueryXExtents8" significance="preferred"><primary>QueryXExtents8</primary></indexterm>
2640 <informaltable frame='none'>
2641 <?dbfo keep-together="always" ?>
2642 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2643 <colspec colname='c1' colwidth='1.0*'/>
2644 <colspec colname='c2' colwidth='1.0*'/>
2646 <row><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry></row>
2647 <row><entry><parameter>range</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
2648 <row><entry><parameter>chars</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
2649 <row><entry>▶</entry></row>
2650 <row rowsep='1'><entry><parameter>extents</parameter>:</entry><entry><link linkend="Data_Types:XCHARINFO"><type>LISTofXCHARINFO</type></link></entry></row>
2651 <row><entry>Errors:</entry><entry><link linkend="Errors:Font"><errorname>Font</errorname></link>,
2652 <link linkend="Errors:Range"><errorname>Range</errorname></link>,
2653 <link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
2658 This request is equivalent to
2659 <link linkend="Requests:QueryXExtents16"><function>QueryXExtents16</function></link>
2661 uses 1-byte character codes.
2665 <section id="Requests:QueryXExtents16">
2666 <title><function>QueryXExtents16</function></title>
2667 <indexterm zone="Requests:QueryXExtents16" significance="preferred"><primary>QueryXExtents16</primary></indexterm>
2668 <informaltable frame='none'>
2669 <?dbfo keep-together="always" ?>
2670 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2671 <colspec colname='c1' colwidth='1.0*'/>
2672 <colspec colname='c2' colwidth='1.0*'/>
2674 <row><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry></row>
2675 <row><entry><parameter>range</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
2676 <row><entry><parameter>chars</parameter>:</entry><entry><link linkend="Data_Types:CHAR2B"><type>LISTofCHAR2B</type></link></entry></row>
2677 <row><entry>▶</entry></row>
2678 <row rowsep='1'><entry><parameter>extents</parameter>:</entry><entry><link linkend="Data_Types:XCHARINFO"><type>LISTofXCHARINFO</type></link></entry></row>
2679 <row><entry>Errors:</entry><entry><link linkend="Errors:Font"><errorname>Font</errorname></link>,
2680 <link linkend="Errors:Range"><errorname>Range</errorname></link>,
2681 <link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
2686 This request returns a list of glyph extents from the open
2687 font associated with FONTID for the series of characters
2688 specified by <parameter>RANGE</parameter> and <parameter>CHARS</parameter>.
2691 If <parameter>RANGE</parameter> is <constant>True</constant>,
2692 each succeeding pair of elements in <parameter>CHARS</parameter> is
2693 treated as a range of characters for which extents should be
2694 returned. If <parameter>CHARS</parameter> contains an odd number of elements,
2695 the font's <structfield>XFONTINFO.CHAR-RANGE.MAX-CHAR</structfield>
2696 is implicitly appended to
2697 the list. If <parameter>CHARS</parameter> contains no elements, the list is
2698 implicitly replaced with the font's
2699 <structfield>XFONTINFO.CHAR-RANGE.</structfield> If
2700 any of the resulting character ranges are invalid, a
2701 <link linkend="Errors:Range"><errorname>Range</errorname></link>
2702 error is returned. Otherwise, the character ranges are
2703 concatenated in the order given by <parameter>CHARS</parameter> to produce
2704 a set of character codes for which extents are returned.
2707 If <parameter>RANGE</parameter> is <constant>False</constant>,
2708 then <parameter>CHARS</parameter> specifies the set of character
2709 codes for which extents are returned. If <parameter>CHARS</parameter> is of
2710 zero length, then a zero-length list of extents is returned.
2713 The extents for each character code in the resulting set (which
2714 may contain duplicates) are returned in the order in
2715 which the character codes appear in the set.
2716 At least one metric for each character shall be non-zero
2717 unless the character is not encoded in the font, in which case
2718 all-zero metrics are returned.
2719 A blank, zero-width character can be encoded
2720 with non-zero but equal left and right bearings.
2723 If <parameter>FONTID</parameter> is not associated with any open fonts, a
2724 <link linkend="Errors:Font"><errorname>Font</errorname></link>
2726 returned. If <parameter>RANGE</parameter> is <constant>True</constant>
2727 and <parameter>CHARS</parameter> contains any invalid ranges, a
2728 <link linkend="Errors:Range"><errorname>Range</errorname></link>
2733 <section id="Requests:QueryXBitmaps8">
2734 <title><function>QueryXBitmaps8</function></title>
2735 <indexterm zone="Requests:QueryXBitmaps8" significance="preferred"><primary>QueryXBitmaps8</primary></indexterm>
2736 <informaltable frame='none'>
2737 <?dbfo keep-together="always" ?>
2738 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2739 <colspec colname='c1' colwidth='1.0*'/>
2740 <colspec colname='c2' colwidth='1.0*'/>
2742 <row><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry></row>
2743 <row><entry><parameter>range</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
2744 <row><entry><parameter>chars</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
2745 <row><entry><parameter>format</parameter>:</entry><entry><link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link></entry></row>
2746 <row><entry>▶+</entry></row>
2747 <row><entry><parameter>replies-following-hint</parameter>:</entry><entry><type>CARD32</type></entry></row>
2748 <row><entry><parameter>offsets</parameter>:</entry><entry><link linkend="Data_Types:OFFSET32"><type>LISTofOFFSET32</type></link></entry></row>
2749 <row><entry><parameter>bitmaps</parameter>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link></entry></row>
2750 <row rowsep='1'><entry>Errors:</entry><entry><link linkend="Errors:Font"><errorname>Font</errorname></link>,
2751 <link linkend="Errors:Range"><errorname>Range</errorname></link>,
2752 <link linkend="Errors:Format"><errorname>Format</errorname></link>,
2753 <link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
2758 This request is equivalent to
2759 <link linkend="Requests:QueryXBitmaps16"><function>QueryXBitmaps16</function></link>
2761 uses 1-byte character codes.
2765 <section id="Requests:QueryXBitmaps16">
2766 <title><function>QueryXBitmaps16</function></title>
2767 <indexterm zone="Requests:QueryXBitmaps16" significance="preferred"><primary>QueryXBitmaps16</primary></indexterm>
2768 <informaltable frame='none'>
2769 <?dbfo keep-together="always" ?>
2770 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2771 <colspec colname='c1' colwidth='1.0*'/>
2772 <colspec colname='c2' colwidth='1.0*'/>
2774 <row><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry></row>
2775 <row><entry><parameter>range</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
2776 <row><entry><parameter>chars</parameter>:</entry><entry><link linkend="Data_Types:CHAR2B"><type>LISTofCHAR2B</type></link></entry></row>
2777 <row><entry><parameter>format</parameter>:</entry><entry><link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link></entry></row>
2778 <row><entry>▶+</entry></row>
2779 <row><entry><parameter>replies-following-hint</parameter>:</entry><entry><type>CARD32</type></entry></row>
2780 <row><entry><parameter>offsets</parameter>:</entry><entry><link linkend="Data_Types:OFFSET32"><type>LISTofOFFSET32</type></link></entry></row>
2781 <row rowsep='1'><entry><parameter>bitmaps</parameter>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link></entry></row>
2782 <row><entry>Errors:</entry><entry><link linkend="Errors:Font"><errorname>Font</errorname></link>,
2783 <link linkend="Errors:Range"><errorname>Range</errorname></link>,
2784 <link linkend="Errors:Format"><errorname>Format</errorname></link>,
2785 <link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
2790 This request returns a list of glyph bitmaps from the open font associated
2791 with <parameter>FONTID</parameter> for the series of characters
2792 specified by <parameter>RANGE</parameter> and <parameter>CHARS</parameter>.
2795 If <parameter>RANGE</parameter> is <constant>True</constant>, each succeeding
2796 pair of elements in <parameter>CHARS</parameter> is
2797 treated as a range of characters for which bitmaps should be
2798 returned. If <parameter>CHARS</parameter> contains an odd number of elements,
2799 the font's <structfield>XFONTINFO.CHAR-RANGE.MAX-CHAR</structfield>
2800 is implicitly appended to
2801 the list. If <parameter>CHARS</parameter> contains no elements, the list is
2802 implicitly replaced with the font's
2803 <structfield>XFONTINFO.CHAR-RANGE.</structfield> If
2804 any of the resulting character ranges are invalid, a <link linkend="Errors:Range"><errorname>Range</errorname></link>
2805 error is returned. Otherwise, the character ranges are
2806 concatenated in the order given by <parameter>CHARS</parameter> to produce
2807 a set of character codes for which bitmaps are returned.
2810 If <parameter>RANGE</parameter> is <constant>False</constant>,
2811 then <parameter>CHARS</parameter> specifies the set of character
2812 codes for which bitmaps are returned. If <parameter>CHARS</parameter>
2813 is of zero length, then a single reply containing a zero-length list of
2814 offsets and bitmaps is returned.
2817 If any of the resulting character ranges are invalid, a
2818 <link linkend="Errors:Range"><errorname>Range</errorname></link>
2819 error is returned. Otherwise, the resulting character ranges
2820 are concatenated in the order given by <parameter>CHARS</parameter>
2821 to produce a set of character codes for which bitmaps are returned.
2824 The server is free to return the glyph bitmaps in multiple
2825 replies to reduce the amount of buffering that is necessary.
2826 In this situation, the set of characters obtained above is
2827 partitioned into an implementation-dependent number of
2828 ordered, non-overlapping subsets containing runs of one or
2829 more consecutive characters. The global ordering of
2830 characters must be maintained such that concatenating the
2831 subsets in order that they were produced yields the original
2832 set. A reply is generated for each subset, in the order that
2836 For each character in a subset, an image of that character's
2837 glyph is described by a rectangle of bits corresponding to the
2838 pixels specified by FORMAT.IMAGE-RECT. Within the image, set
2839 and clear bits represent inked and non-inked pixels,
2843 Each scanline of a glyph image, from top to bottom, is zero-padded
2844 on the right to a multiple of the number of bits specified by
2845 FORMAT.SCANLINE-PAD. The scanline is then divided from left
2846 to right into a sequence of FORMAT.SCANLINE-UNIT bits. The
2847 bits of each unit are then arranged such that the left-most
2848 pixel is stored in the most- or least-significant bit,
2849 according to FORMAT.BIT-ORDER-MSB. The bytes of each unit are
2850 then arranged such that the most- or least-significant byte,
2851 according to FORMAT.BYTE-ORDER-MSB, is transmitted first.
2852 Finally, the units are arranged such that the left-most is
2853 transmitted first and the right-most is transmitted last.
2856 The individual images within a subset are then concatenated in
2857 a server-dependent order to form the <parameter>BITMAPS</parameter> data
2858 of the reply. If a glyph image is duplicated within a reply, the
2859 server is free to return fewer (but at least one) copies of
2860 the image. If a character is not encoded within the font, a
2861 zero-length bitmap is substituted for this character. Each
2862 glyph image must begin at a bit position that is a multiple of
2863 the FORMAT.SCANLINE-UNIT.
2866 The <parameter>OFFSETS</parameter> array in a reply contains one entry
2867 for each character in the subset being returned, in the order that the
2868 characters appear in the subset. Each entry specifies the
2869 starting location in bytes and size in bytes of the
2870 corresponding glyph image in the <parameter>BITMAPS</parameter> data of that
2871 reply (i.e. an offset may not refer to data in another reply).
2874 The <parameter>REPLIES-FOLLOWING-HINT</parameter> field in all but the
2875 last reply contains a positive value that specifies the number of replies
2876 that are likely, but not required, to follow. In the last
2877 reply, which may contain data for zero or more characters,
2878 this field is set to zero.
2881 If <parameter>FONTID</parameter> is not associated with any open fonts,
2882 a <link linkend="Errors:Font"><errorname>Font</errorname></link>
2883 error is returned. If <parameter>RANGE</parameter> is
2884 <constant>True</constant> and <parameter>CHARS</parameter> contains any
2886 <link linkend="Errors:Range"><errorname>Range</errorname></link> error
2887 is returned. If <parameter>FORMAT</parameter> is invalid, a
2888 <link linkend="Errors:Format"><errorname>Format</errorname></link> error
2893 <section id="Requests:CloseFont">
2894 <title><function>CloseFont</function></title>
2895 <indexterm zone="Requests:CloseFont" significance="preferred"><primary>CloseFont</primary></indexterm>
2896 <informaltable frame='none'>
2897 <?dbfo keep-together="always" ?>
2898 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
2899 <colspec colname='c1' colwidth='1.0*'/>
2900 <colspec colname='c2' colwidth='1.0*'/>
2902 <row rowsep='1'><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry></row>
2903 <row><entry>Errors:</entry><entry><link linkend="Errors:Font"><errorname>Font</errorname></link>, <link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
2908 This request indicates that the specified <parameter>FONTID</parameter>
2909 should no longer be associated with an open font. The server is free to
2910 release any client-specific storage or licenses allocated for
2911 the font. The client may reuse the value of <parameter>FONTID</parameter>
2913 <link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>
2917 If <parameter>FONTID</parameter> is not associated with any open fonts, a
2918 <link linkend="Errors:Font"><errorname>Font</errorname></link>
2923 <section id="Requests:close_connection">
2924 <title>close connection</title>
2925 <indexterm zone="Requests:close_connection" significance="preferred"><primary>close connection</primary></indexterm>
2928 When a connection is closed, a
2929 <link linkend="Requests:CloseFont"><function>CloseFont</function></link>
2930 is done on all fonts
2931 that are open on the connection. In addition, the server is
2932 free to release any storage or licenses allocated on behalf of
2933 the client that made the connection.
2938 <section id='Errors'>
2939 <title>Errors</title>
2944 All errors are at least 16 bytes long and contain the following fields:
2946 <informaltable frame='none'>
2947 <?dbfo keep-together="always" ?>
2948 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
2949 <colspec colname='c1' colwidth='1.0*'/>
2950 <colspec colname='c2' colwidth='1.0*'/>
2951 <colspec colname='c3' colwidth='1.0*'/>
2953 <row><entry><parameter>type</parameter>:</entry><entry><type>CARD8</type></entry><entry>value of 1</entry></row>
2954 <row><entry><parameter>error-code</parameter>:</entry><entry><type>CARD8</type></entry></row>
2955 <row><entry><parameter>sequence-number</parameter>:</entry><entry><type>CARD16</type></entry></row>
2956 <row><entry><parameter>length</parameter>:</entry><entry><type>CARD32</type></entry></row>
2957 <row><entry><parameter>timestamp</parameter>:</entry><entry><link linkend="Data_Types:TIMESTAMP"><type>TIMESTAMP</type></link></entry></row>
2958 <row><entry><parameter>major-opcode</parameter>:</entry><entry><type>CARD8</type></entry></row>
2959 <row><entry><parameter>minor-opcode</parameter>:</entry><entry><type>CARD8</type></entry></row>
2960 <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry></row>
2965 The TYPE field has a value of one. The ERROR-CODE field specifies which error
2966 occurred. Core errors codes are in the range 0 through 127, extension error
2967 codes are in the range 128 through 255. The SEQUENCE-NUMBER field contains the
2968 least significant 16 bits of the sequence number of the request that caused the
2969 error. The LENGTH field specifies the length of the error packet in 4-byte
2970 units and must have a value of at least 4. The TIMESTAMP specifies the server
2971 time when the error occurred. The MAJOR-OPCODE and MINOR-OPCODE (zero for core
2972 requests) fields specify the type of request that generated the error. The
2973 DATA-OR-UNUSED field may be used for 16 bits of error-specific information. If
2974 LENGTH is greater than four, these fields are followed by (LENGTH - 4) * 4
2975 bytes of extra data.
2978 The following errors are defined for the core protocol:
2981 <section id="Errors:Request">
2982 <title><errorname>Request</errorname></title>
2983 <indexterm zone="Errors:Request" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Request</errorname></secondary></indexterm>
2984 <informaltable frame='none'>
2985 <?dbfo keep-together="always" ?>
2986 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
2987 <colspec colname='c1' colwidth='1.0*'/>
2988 <colspec colname='c2' colwidth='1.0*'/>
2989 <colspec colname='c2' colwidth='1.0*'/>
2991 <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
2996 This error is generated by any request that has an unknown
2997 combination of major and minor request numbers, or by any
2998 extension request that is issued before a
2999 <link linkend="Requests:QueryExtension"><function>QueryExtension</function></link>
3004 <section id="Errors:Format">
3005 <title><errorname>Format</errorname></title>
3006 <indexterm zone="Errors:Format" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Format</errorname></secondary></indexterm>
3007 <informaltable frame='none'>
3008 <?dbfo keep-together="always" ?>
3009 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
3010 <colspec colname='c1' colwidth='1.0*'/>
3011 <colspec colname='c2' colwidth='1.0*'/>
3012 <colspec colname='c2' colwidth='1.0*'/>
3014 <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
3015 <row><entry><parameter>format</parameter>:</entry><entry><link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link></entry><entry>bad format value</entry></row>
3020 This error is generated by the use of an invalid <link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link>
3022 <link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>,
3023 <link linkend="Requests:QueryXBitmaps8"><function>QueryXBitmaps8</function></link>, and
3024 <link linkend="Requests:QueryXBitmaps16"><function>QueryXBitmaps16</function></link>
3026 The value that caused the error is included as extra data.
3030 <section id="Errors:Font">
3031 <title><errorname>Font</errorname></title>
3032 <indexterm zone="Errors:Font" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Font</errorname></secondary></indexterm>
3033 <informaltable frame='none'>
3034 <?dbfo keep-together="always" ?>
3035 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
3036 <colspec colname='c1' colwidth='1.0*'/>
3037 <colspec colname='c2' colwidth='1.0*'/>
3038 <colspec colname='c2' colwidth='1.0*'/>
3040 <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
3041 <row><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry><entry>bad font identifier</entry></row>
3046 This error is generated by an invalid <link linkend="Data_Types:FONTID"><type>FONTID</type></link> in the
3047 <link linkend="Requests:QueryXInfo"><function>QueryXInfo</function></link>,
3048 <link linkend="Requests:QueryXExtents8"><function>QueryXExtents8</function></link>,
3049 <link linkend="Requests:QueryXExtents16"><function>QueryXExtents16</function></link>,
3050 <link linkend="Requests:QueryXBitmaps8"><function>QueryXBitmaps8</function></link>,
3051 <link linkend="Requests:QueryXBitmaps16"><function>QueryXBitmaps16</function></link>
3053 <link linkend="Requests:CloseFont"><function>CloseFont</function></link>
3054 requests. The value that caused
3055 the error is included as extra data.
3059 <section id="Errors:Range">
3060 <title><errorname>Range</errorname></title>
3061 <indexterm zone="Errors:Range" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Range</errorname></secondary></indexterm>
3062 <informaltable frame='none'>
3063 <?dbfo keep-together="always" ?>
3064 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
3065 <colspec colname='c1' colwidth='1.0*'/>
3066 <colspec colname='c2' colwidth='1.0*'/>
3067 <colspec colname='c2' colwidth='1.0*'/>
3069 <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
3070 <row><entry><parameter>range</parameter>:</entry><entry><link linkend="Data_Types:RANGE"><type>RANGE</type></link></entry><entry>bad range</entry></row>
3075 This error is generated by an invalid <link linkend="Data_Types:RANGE"><type>RANGE</type></link> in the
3076 <link linkend="Requests:QueryXExtents8"><function>QueryXExtents8</function></link>,
3077 <link linkend="Requests:QueryXExtents16"><function>QueryXExtents16</function></link>,
3078 <link linkend="Requests:QueryXBitmaps8"><function>QueryXBitmaps8</function></link>
3080 <link linkend="Requests:QueryXBitmaps16"><function>QueryXBitmaps16</function></link>
3082 value that caused the error is included as extra data.
3086 <section id="Errors:EventMask">
3087 <title><errorname>EventMask</errorname></title>
3088 <indexterm zone="Errors:EventMask" significance="preferred"><primary>Error Codes</primary><secondary><errorname>EventMask</errorname></secondary></indexterm>
3089 <informaltable frame='none'>
3090 <?dbfo keep-together="always" ?>
3091 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
3092 <colspec colname='c1' colwidth='1.0*'/>
3093 <colspec colname='c2' colwidth='1.0*'/>
3094 <colspec colname='c2' colwidth='1.0*'/>
3096 <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
3097 <row><entry><parameter>event-mask</parameter>:</entry><entry><link linkend="Data_Types:EVENTMASK"><type>EVENTMASK</type></link></entry><entry>bad event mask</entry></row>
3102 This error is generated by an invalid <link linkend="Data_Types:EVENTMASK"><type>EVENTMASK</type></link> in the
3103 <link linkend="Requests:SetEventMask"><function>SetEventMask</function></link>
3104 request. The value that caused the error is
3105 included as extra data.
3109 <section id="Errors:AccessContext">
3110 <title><errorname>AccessContext</errorname></title>
3111 <indexterm zone="Errors:AccessContext" significance="preferred"><primary>Error Codes</primary><secondary><errorname>AccessContext</errorname></secondary></indexterm>
3112 <informaltable frame='none'>
3113 <?dbfo keep-together="always" ?>
3114 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
3115 <colspec colname='c1' colwidth='1.0*'/>
3116 <colspec colname='c2' colwidth='1.0*'/>
3117 <colspec colname='c2' colwidth='1.0*'/>
3119 <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
3120 <row><entry><parameter>ac</parameter>:</entry><entry><link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link></entry><entry>unaccepted <type>AccessContext</type></entry></row>
3125 This error is generated by an invalid <link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link> in the
3126 <link linkend="Requests:FreeAC"><function>FreeAC</function></link>
3128 <link linkend="Requests:SetAuthorization"><function>SetAuthorization</function></link>
3130 <link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>
3131 request performed without sufficient authorization. In the
3132 first two cases, the <link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link> of the errant request is
3133 returned as extra data. In the third case, the current
3134 <link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link> is returned as extra data.
3138 <section id="Errors:IDChoice">
3139 <title><errorname>IDChoice</errorname></title>
3140 <indexterm zone="Errors:IDChoice" significance="preferred"><primary>Error Codes</primary><secondary><errorname>IDChoice</errorname></secondary></indexterm>
3141 <informaltable frame='none'>
3142 <?dbfo keep-together="always" ?>
3143 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
3144 <colspec colname='c1' colwidth='1.0*'/>
3145 <colspec colname='c2' colwidth='1.0*'/>
3146 <colspec colname='c2' colwidth='1.0*'/>
3148 <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
3149 <row><entry><parameter>id</parameter>:</entry><entry><link linkend="Data_Types:ID"><type>ID</type></link></entry><entry>bad identifier</entry></row>
3154 This error is generated by an invalid or already associated
3155 <link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link> identifier in a
3156 <link linkend="Requests:CreateAC"><function>CreateAC</function></link>
3157 request or <link linkend="Data_Types:FONTID"><type>FONTID</type></link> identifier
3159 <link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>
3160 request. The value that caused the error
3161 is included as extra data.
3165 <section id="Errors:Name">
3166 <title><errorname>Name</errorname></title>
3167 <indexterm zone="Errors:Name" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Name</errorname></secondary></indexterm>
3168 <informaltable frame='none'>
3169 <?dbfo keep-together="always" ?>
3170 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
3171 <colspec colname='c1' colwidth='1.0*'/>
3172 <colspec colname='c2' colwidth='1.0*'/>
3173 <colspec colname='c2' colwidth='1.0*'/>
3175 <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
3180 This error is generated by a font name pattern that matches
3182 <link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>
3183 request or no catalogue names in a
3184 <link linkend="Requests:SetCatalogues"><function>SetCatalogues</function></link>
3189 <section id="Errors:Resolution">
3190 <title><errorname>Resolution</errorname></title>
3191 <indexterm zone="Errors:Resolution" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Resolution</errorname></secondary></indexterm>
3192 <informaltable frame='none'>
3193 <?dbfo keep-together="always" ?>
3194 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
3195 <colspec colname='c1' colwidth='1.0*'/>
3196 <colspec colname='c2' colwidth='1.0*'/>
3197 <colspec colname='c2' colwidth='1.0*'/>
3199 <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>X value of errant resolution</entry></row>
3200 <row><entry><parameter>y-resolution</parameter>:</entry><entry><type>CARD16</type></entry><entry>Y value of errant resolution</entry></row>
3201 <row><entry><parameter>point-size</parameter>:</entry><entry><type>CARD16</type></entry><entry>point size of errant resolution</entry></row>
3206 This error is generated in response to an invalid <link linkend="Data_Types:RESOLUTION"><type>RESOLUTION</type></link>
3208 <link linkend="Requests:SetResolution"><function>SetResolution</function></link>
3209 request. The value that caused the
3210 error is included in the DATA-OR-UNUSED field and as extra data.
3214 <section id="Errors:Alloc">
3215 <title><errorname>Alloc</errorname></title>
3216 <indexterm zone="Errors:Length" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Alloc</errorname></secondary></indexterm>
3217 <informaltable frame='none'>
3218 <?dbfo keep-together="always" ?>
3219 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
3220 <colspec colname='c1' colwidth='1.0*'/>
3221 <colspec colname='c2' colwidth='1.0*'/>
3222 <colspec colname='c2' colwidth='1.0*'/>
3224 <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
3229 This error is generated by any request for which the server
3230 lacks sufficient resources (especially memory).
3234 <section id="Errors:Length">
3235 <title><errorname>Length</errorname></title>
3236 <indexterm zone="Errors:Length" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Length</errorname></secondary></indexterm>
3237 <informaltable frame='none'>
3238 <?dbfo keep-together="always" ?>
3239 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
3240 <colspec colname='c1' colwidth='1.0*'/>
3241 <colspec colname='c2' colwidth='1.0*'/>
3242 <colspec colname='c2' colwidth='1.0*'/>
3244 <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
3245 <row><entry><parameter>length</parameter>:</entry><entry><type>CARD32</type></entry><entry>bad length value</entry></row>
3250 This error is generated by any request that has a length field
3251 greater than (MAXIMUM-REQUEST-LENGTH * 4) bytes. The value that
3252 caused the error is included as extra data.
3256 <section id="Errors:Implementation">
3257 <title><errorname>Implementation</errorname></title>
3258 <indexterm zone="Errors:Implementation" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Implementation</errorname></secondary></indexterm>
3259 <informaltable frame='none'>
3260 <?dbfo keep-together="always" ?>
3261 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
3262 <colspec colname='c1' colwidth='1.0*'/>
3263 <colspec colname='c2' colwidth='1.0*'/>
3264 <colspec colname='c2' colwidth='1.0*'/>
3266 <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
3271 This error may be generated in response to any request that
3272 the server is unable to process because it is deficient. Use
3273 of this error is highly discouraged and indicates lack of
3274 conformance to the protocol.
3277 <section id="Errors:Extensions">
3278 <title>Extensions</title>
3280 Additional errors may be defined by extensions.
3285 <section id='Events'>
3286 <title>Events</title>
3291 Events may be generated in response to requests or at the server's discretion
3292 after the initial connection setup information has been exchanged. Each event
3293 is at least 12 bytes long and contains the following fields:
3294 <informaltable frame='none'>
3295 <?dbfo keep-together="always" ?>
3296 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
3297 <colspec colname='c1' colwidth='1.0*'/>
3298 <colspec colname='c2' colwidth='1.0*'/>
3299 <colspec colname='c3' colwidth='1.0*'/>
3301 <row><entry><parameter>type</parameter>:</entry><entry><type>CARD8</type></entry><entry>value of 2</entry></row>
3302 <row><entry><parameter>event-code</parameter>:</entry><entry><type>CARD8</type></entry></row>
3303 <row><entry><parameter>sequence-number</parameter>:</entry><entry><type>CARD16</type></entry></row>
3304 <row><entry><parameter>length</parameter>:</entry><entry><type>CARD32</type></entry></row>
3305 <row><entry><parameter>timestamp</parameter>:</entry><entry><link linkend="Data_Types:TIMESTAMP"><type>TIMESTAMP</type></link></entry></row>
3311 The TYPE field contains the value 2. The EVENT-CODE field specifies the number
3312 of the event and is in the range 0-127 for core events or the range 128-255 for
3313 extensions. The SEQUENCE-NUMBER field specifies the least significant 16 bits
3314 of the sequence number of the last request to have been processed by the
3315 server. The LENGTH field specifies the number of 4-byte units in this event
3316 packet and must always have a value of at least 3. The <link linkend="Data_Types:TIMESTAMP"><type>TIMESTAMP</type></link> field
3317 specifies the server time when the event occurred. If LENGTH is greater than
3318 three, these fields are followed by (LENGTH - 3) * 4 bytes of additional data.
3321 Events are described using the following syntax:
3323 <emphasis role="bold"><function>EventName</function></emphasis>
3324 <informaltable frame='none'>
3325 <?dbfo keep-together="always" ?>
3326 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
3327 <colspec colname='c1' colwidth='1.0*'/>
3328 <colspec colname='c2' colwidth='1.0*'/>
3330 <row><entry><parameter>arg1</parameter>:</entry><entry><type>type1</type></entry></row>
3331 <row><entry> ...</entry></row>
3332 <row><entry><parameter>argN</parameter>:</entry><entry><type>typeN</type></entry></row>
3337 </para></blockquote>
3340 If an event does not provide any extra arguments, the
3341 <parameter>arg1</parameter>...<parameter>argN</parameter>
3342 lines are omitted from the description.
3345 The core X Font Service protocol defines the following events:
3348 <section id="Events:KeepAlive">
3349 <title><function>KeepAlive</function></title>
3350 <indexterm zone="Events:KeepAlive" significance="preferred"><primary>KeepAlive</primary></indexterm>
3352 This unsolicited, nonmaskable event may be sent by the
3353 server to verify that the connection has not been broken
3354 (for transports that do not provide this information).
3355 Clients should acknowledge receipt of this request
3356 by sending any request (such as
3357 <link linkend="Requests:NoOp"><function>NoOp</function></link>
3362 <section id="Events:CatalogueListNotify">
3363 <title><function>CatalogueListNotify</function></title>
3364 <indexterm zone="Events:CatalogueListNotify" significance="preferred"><primary>CatalogueListNotify</primary></indexterm>
3365 <informaltable frame='none'>
3366 <?dbfo keep-together="always" ?>
3367 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
3368 <colspec colname='c1' colwidth='1.0*'/>
3369 <colspec colname='c2' colwidth='1.0*'/>
3371 <row><entry><parameter>added</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
3372 <row><entry><parameter>deleted</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
3377 This event is sent to clients that have included
3378 <function><constant>CatalogueListChangeMask</constant></function>
3379 in their core event mask
3380 whenever the list of catalogues that are available has
3381 changed. The ADDED field is <constant>True</constant> if new catalogues have
3382 been added to the server, otherwise it is <constant>False</constant>. The
3383 DELETED field is <constant>True</constant> if any existing catalogues have
3384 been removed from the server, otherwise it is <constant>False</constant>.
3388 <section id="Events:FontListNotify">
3389 <title><function>FontListNotify</function></title>
3390 <indexterm zone="Events:FontListNotify" significance="preferred"><primary>FontListNotify</primary></indexterm>
3391 <informaltable frame='none'>
3392 <?dbfo keep-together="always" ?>
3393 <tgroup cols='2' align='left' colsep='0' rowsep='0'>
3394 <colspec colname='c1' colwidth='1.0*'/>
3395 <colspec colname='c2' colwidth='1.0*'/>
3397 <row><entry><parameter>added</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
3398 <row><entry><parameter>deleted</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
3403 This event is sent to clients that have included
3404 <function><constant>FontListChangeMask</constant></function>
3405 in their event mask whenever the
3406 list of fonts that are provided by the currently selected
3407 catalogues has changed. The ADDED field is <constant>True</constant> if new
3408 fonts have been added to any of the catalogues currently
3409 used by the client, otherwise it is <constant>False</constant>. The DELETED
3410 field is <constant>True</constant> if any existing fonts have been removed
3411 from any of catalogues used by the client, otherwise it
3412 is <constant>False</constant>.
3415 <section id="Events:Extensions">
3416 <title>Extensions</title>
3418 Additional events may be defined by extensions.
3424 <chapter id='Protocol_Encoding'>
3425 <title>Protocol Encoding</title>
3427 <!-- (SN Protocol Encoding -->
3430 Numbers that are prefixed with <quote><literal>#x</literal></quote>
3431 are in hexadecimal (base 16). All other
3432 numbers are in decimal. Requests, replies, errors, events, and compound types
3433 are described using the syntax:
3436 <literallayout class="monospaced">
3439 <emphasis remap='I'>count</emphasis> <emphasis remap='I'>contents</emphasis> <emphasis remap='I'>name</emphasis>
3441 <emphasis remap='I'>count</emphasis> <emphasis remap='I'>contents</emphasis> <emphasis remap='I'>name</emphasis>
3446 where COUNT is the number of bytes in the data stream occupied by this
3447 field, CONTENTS is the name of the type as given in
3448 <link linkend='Data_Types'>Section 4</link> or the value if
3449 this field contains a constant, and NAME is a description of this field.
3452 Objects containing counted lists use a lowercase single-letter variable (whose
3453 scope is limited to the request, reply, event, or error in which it is found)
3454 to represent the number of objects in the list. These variables, and any
3455 expressions in which they are used, should be treated as unsigned integers.
3456 Multiple copies of an object are indicated by CONTENTS prefix
3457 <quote>LISTof</quote>.
3460 Unused bytes (whose value is undefined) will have a blank CONTENTS field and a
3461 NAME field of <quote>unused</quote>. Zeroed bytes (whose value must be zero)
3462 will have a blank CONTENTS field and a NAME field of <quote>zero</quote>.
3463 The expression pad(e) refers to the number of bytes
3464 needed to round a value <quote>e</quote> up to the closed
3468 <literallayout class="monospaced">
3470 pad(e) = (4 - (e mod 4)) mod 4
3473 <section id='Encoding::Data_Types'>
3474 <title>Data Types</title>
3476 <!-- (SN Data Types -->
3478 <literallayout class="monospaced">
3479 <link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link>
3480 4 <type>CARD32</type> access context
3482 with at least one of the following bits set:
3486 but none of the following bits set:
3491 <link linkend="Data_Types:ALTERNATESERVER"><type>ALTERNATESERVER</type></link>
3492 1 <type>BOOL</type> subset
3494 n <type>STRING8</type> name
3495 p unused, p=pad(n+2)
3497 <link linkend="Data_Types:AUTH"><type>AUTH</type></link>
3500 n <type>STRING8</type> name
3502 d <type>STRING8</type> data
3506 <link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link>
3507 4 <type>CARD32</type> value, union of the following bits:
3509 #x00000001 ByteOrderMSB
3510 #x00000002 BitOrderMSB
3511 #x00000000 <constant>ImageRectMin</constant>
3512 #x00000004 <constant>ImageRectMaxWidth</constant>
3513 #x00000008 <constant>ImageRectMax</constant>
3514 #x00000000 <constant>ScanlinePad8</constant>
3515 #x00000100 <constant>ScanlinePad16</constant>
3516 #x00000200 <constant>ScanlinePad32</constant>
3517 #x00000300 <constant>ScanlinePad64</constant>
3518 #x00000000 <constant>ScanlineUnit8</constant>
3519 #x00001000 <constant>ScanlineUnit16</constant>
3520 #x00002000 <constant>ScanlineUnit32</constant>
3521 #x00003000 <constant>ScanlineUnit64</constant>
3523 except for the following bits which must be zero:
3527 and the following of which at most one bit may be set:
3529 #x0000000c at most one bit can be set
3532 <link linkend="Data_Types:BITMAPFORMATMASK"><type>BITMAPFORMATMASK</type></link>
3533 4 <type>CARD32</type> value, mask of the following bits:
3535 #x00000001 <constant>ByteOrderMask</constant>
3536 #x00000002 <constant>BitOrderMask</constant>
3537 #x00000004 <constant>ImageRectMask</constant>
3538 #x00000008 <constant>ScanlinePadMask</constant>
3539 #x00000010 <constant>ScanlineUnitMask</constant>
3541 except for the following bits which must be zero:
3545 <link linkend="Data_Types:BOOL"><type>BOOL</type></link>
3546 1 <type>BOOL</type> boolean, one of the following values:
3547 0 <constant>False</constant>
3548 1 <constant>True</constant>
3550 <link linkend="Data_Types:BYTE"><type>BYTE</type></link>
3551 1 <type>BYTE</type> unsigned byte of data
3554 1 <type>CARD8</type> 8-bit unsigned integer
3557 2 <type>CARD16</type> 16-bit unsigned integer
3560 4 <type>CARD32</type> 32-bit unsigned integer
3562 <link linkend="Data_Types:CHAR2B"><type>CHAR2B</type></link>
3563 1 <type>CARD8</type> byte1
3564 1 <type>CARD8</type> byte2
3566 <link linkend="Data_Types:EVENTMASK"><type>EVENTMASK</type></link>
3567 4 <type>CARD32</type> event mask
3569 for core events, this is union of the following bits:
3571 #00000001 <constant>CatalogueListChangeMask</constant>
3572 #00000002 <constant>FontListChangeMask</constant>
3574 but none of the following bits set:
3578 extensions define their own sets of bits
3580 <link linkend="Data_Types:FONTID"><type>FONTID</type></link>
3581 4 <type>CARD32</type> font identifier
3583 with at least one of the following bits set:
3587 but none of the following bits set:
3592 1 <type>INT8</type> 8-bit signed integer
3595 2 <type>INT16</type> 16-bit signed integer
3598 4 <type>INT32</type> 32-bit signed integer
3600 <link linkend="Data_Types:OFFSET32"><type>OFFSET32</type></link>
3601 4 <type>CARD32</type> position (or integer value)
3602 4 <type>CARD32</type> length
3604 <link linkend="Data_Types:PROPINFO"><type>PROPINFO</type></link>
3605 4 n number of <type>PROPOFFSET</type> components
3606 4 m number of bytes of property data
3607 20*n <type>PROPOFFSET</type> property offsets into data block
3608 m <type>LISTofBYTE</type> property data block
3610 <link linkend="Data_Types:PROPOFFSET"><type>PROPOFFSET</type></link>
3611 8 <type>OFFSET32</type> name in data block
3612 8 <type>OFFSET32</type> value in data block
3613 1 <type>CARD8</type> type, one of the following values:
3614 0 <constant>String</constant>
3615 1 <constant>Unsigned</constant>
3616 2 <constant>Signed</constant>
3619 <link linkend="Data_Types:RANGE"><type>RANGE</type></link>
3620 2 <type>CHAR2B</type> minimum character code
3621 2 <type>CHAR2B</type> maximum character code
3623 <link linkend="Data_Types:RESOLUTION"><type>RESOLUTION</type></link>
3624 2 <type>CARD16</type> x resolution in pixels per inch
3625 2 <type>CARD16</type> y resolution in pixels per inch
3626 2 <type>CARD16</type> point size in decipoints
3630 n <type>STRING8</type> name
3632 <link linkend="Data_Types:STRING8"><type>STRING8</type></link>
3633 n <type>LISTofBYTE</type> array of 8-bit character values
3635 <link linkend="Data_Types:TIMESTAMP"><type>TIMESTAMP</type></link>
3636 4 <type>CARD32</type> milliseconds since server time origin
3638 <link linkend="Data_Types:XCHARINFO"><type>XCHARINFO</type></link>
3639 2 <type>INT16</type> left bearing
3640 2 <type>INT16</type> right bearing
3641 2 <type>INT16</type> width
3642 2 <type>INT16</type> ascent
3643 2 <type>INT16</type> descent
3644 2 <type>CARD16</type> attributes
3646 <link linkend="Data_Types:XFONTINFO"><type>XFONTINFO</type></link>
3647 4 <type>CARD32</type> flags, union of the following bits:
3649 #x00000001 <constant>AllCharactersExist</constant>
3650 #x00000002 <constant>InkInside</constant>
3651 #x00000004 <constant>HorizontalOverlap</constant>
3653 but none of the following bits set:
3657 4 <type>RANGE</type> range of characters in font
3658 1 <type>CARD8</type> drawing direction
3659 0 <constant>LeftToRight</constant>
3660 1 <constant>RightToLeft</constant>
3662 2 <type>CHAR2B</type> default character
3663 12 <type>XCHARINFO</type> minimum bounds
3664 12 <type>XCHARINFO</type> maximum bounds
3665 2 <type>INT16</type> font ascent
3666 2 <type>INT16</type> font descent
3667 n <type>PROPINFO</type> property data
3671 <section id='Encoding::Requests'>
3672 <title>Requests</title>
3673 <para><link linkend="Requests:open_connection"><emphasis role="bold">open connection</emphasis></link></para>
3674 <literallayout class="monospaced">
3675 1 <type>BYTE</type> byteorder, one of the values:
3676 #x42 MostSignificant Byte first
3677 #x6c LeastSignificant Byte first
3678 1 <type>CARD8</type> numberof auth in auth-data
3679 2 2 client-major-protocol-version
3680 2 0 client-minor-protocol-version
3681 2 a/4 lengthof auth-data
3682 a <type>LISTofAUTH</type> auth-data
3684 2 <type>CARD16</type> status
3685 0 <constant>Success</constant>
3686 1 <constant>Continue</constant>
3687 2 <constant>Busy</constant>
3688 3 <constant>Denied</constant>
3691 1 <type>CARD8</type> numberof alternate-servers-hint
3692 1 <type>CARD8</type> authorization-index
3693 2 a/4 lengthof alternate-servers-hint
3694 2 (d+q)/4 lengthof authorization-data
3695 a <type>LISTofALTERNATESERVER</type> alternate-servers-hint
3696 d <type>LISTofBYTE</type> authorization-data
3701 If STATUS is <constant>Busy</constant> or <constant>Denied</constant>, the protocol stops and the connection is
3702 closed. If STATUS is <constant>Continue</constant>, the client is expected to respond with
3703 additional data, to which the server responds with
3704 a new status value and more data. This dialog continues until the status
3705 is set to <constant>Success</constant>, or until the server sets STATUS to <constant>Busy</constant> or <constant>Denied</constant>
3706 and closes the connection:
3709 <literallayout class="monospaced">
3712 d <type>LISTofBYTE</type> more-authorization-data
3716 2 <type>CARD16</type> status
3717 0 <constant>Success</constant>
3718 1 <constant>Continue</constant>
3719 2 <constant>Busy</constant>
3720 3 <constant>Denied</constant>
3722 d <type>LISTofBYTE</type> more-authorization-data
3726 When STATUS is <constant>Success</constant>, the protocol resumes with the following
3730 <literallayout class="monospaced">
3731 4 3+(v+w)/4 length of rest of data
3732 2 <type>CARD16</type> maximum-request-length
3733 2 v length of vendor string
3734 4 <type>CARD32</type> release-number
3735 v <type>STRING8</type> vendor-string
3739 Once the connection has been established, the client may send the
3743 <literallayout class="monospaced">
3744 <link linkend="Requests:NoOp"><emphasis role="bold"><function>NoOp</function></emphasis></link>
3749 <link linkend="Requests:ListExtensions"><emphasis role="bold"><function>ListExtensions</function></emphasis></link>
3755 1 <type>CARD8</type> numberof names
3756 2 <type>CARD16</type> sequence-number
3758 n LISTofSTRNAME names
3761 <link linkend="Requests:QueryExtension"><emphasis role="bold"><function>QueryExtension</function></emphasis></link>
3765 n <type>STRING8</type> name
3769 1 <type>BOOL</type> present
3770 2 <type>CARD16</type> sequence-number
3772 2 <type>CARD16</type> major-version
3773 2 <type>CARD16</type> minor-version
3774 1 <type>CARD8</type> major-opcode
3775 1 <type>CARD8</type> first-event
3776 1 <type>CARD8</type> number-events
3777 1 <type>CARD8</type> first-error
3778 1 <type>CARD8</type> number-errors
3781 <link linkend="Requests:ListCatalogues"><emphasis role="bold"><function>ListCatalogues</function></emphasis></link>
3785 4 <type>CARD32</type> max-names
3786 2 n length of pattern
3788 n <type>STRING8</type> pattern
3793 2 <type>CARD16</type> sequence-number
3795 4 <type>CARD32</type> replies-following-hint
3796 4 <type>CARD32</type> numberof catalogue-names
3797 n LISTofSTRNAME catalogue-names
3800 <link linkend="Requests:SetCatalogues"><emphasis role="bold"><function>SetCatalogues</function></emphasis></link>
3802 1 <type>CARD8</type> numberof catalogue-names
3804 n LISTofSTRNAME catalogue-names
3807 <link linkend="Requests:GetCatalogues"><emphasis role="bold"><function>GetCatalogues</function></emphasis></link>
3813 1 <type>CARD8</type> numberof catalogue-names
3814 2 <type>CARD16</type> sequence-number
3816 n LISTofSTRNAME catalogue-names
3819 <link linkend="Requests:SetEventMask"><emphasis role="bold"><function>SetEventMask</function></emphasis></link>
3821 1 <type>CARD8</type> extension-opcode
3823 4 <type>EVENTMASK</type> event-mask
3825 <link linkend="Requests:GetEventMask"><emphasis role="bold"><function>GetEventMask</function></emphasis></link>
3827 1 <type>CARD8</type> extension-opcode
3832 2 <type>CARD16</type> sequence-number
3834 4 <type>EVENTMASK</type> event-mask
3836 <link linkend="Requests:CreateAC"><emphasis role="bold"><function>CreateAC</function></emphasis></link>
3838 1 <type>CARD8</type> numberof authorization-protocols
3840 4 <type>ACCESSCONTEXT</type> ac
3841 a <type>LISTofAUTH</type> authorization-protocols
3844 1 <type>CARD8</type> authorization-index
3845 2 <type>CARD16</type> sequence-number
3847 2 <type>CARD16</type> status
3848 0 <constant>Success</constant>
3849 1 <constant>Continue</constant>
3850 2 <constant>Busy</constant>
3851 3 <constant>Denied</constant>
3853 d <type>LISTofBYTE</type> authorization-data
3858 If STATUS is <constant>Continue</constant>, the client is expected to respond with additional
3859 data, to which the server
3860 responds with a new status value and more data. This dialog continues
3861 until the status is set to
3862 <constant>Success</constant>, <constant>Busy</constant>, or <constant>Denied</constant> at which point the request is finished.
3865 <literallayout class="monospaced">
3868 d <type>LISTofBYTE</type> more-authorization-data
3872 2 <type>CARD16</type> status
3873 0 <constant>Success</constant>
3874 1 <constant>Continue</constant>
3875 2 <constant>Busy</constant>
3876 3 <constant>Denied</constant>
3878 d <type>LISTofBYTE</type> authorization-data
3881 <link linkend="Requests:FreeAC"><emphasis role="bold"><function>FreeAC</function></emphasis></link>
3885 4 <type>ACCESSCONTEXT</type> ac
3887 <link linkend="Requests:SetAuthorization"><emphasis role="bold"><function>SetAuthorization</function></emphasis></link>
3891 4 <type>ACCESSCONTEXT</type> ac
3893 <link linkend="Requests:SetResolution"><emphasis role="bold"><function>SetResolution</function></emphasis></link>
3895 1 n number of resolutions
3896 2 1+(6*n+p)/4 length
3897 6*n <type>LISTofRESOLUTION</type> resolutions
3900 <link linkend="Requests:GetResolution"><emphasis role="bold"><function>GetResolution</function></emphasis></link>
3906 1 n number of resolutions
3907 2 <type>CARD16</type> sequence-number
3908 4 2+(6*n+p)/4 length
3909 6*n <type>LISTofRESOLUTION</type> resolutions
3912 <link linkend="Requests:ListFonts"><emphasis role="bold"><function>ListFonts</function></emphasis></link>
3916 4 <type>CARD32</type> max-names
3917 2 n length of pattern
3919 n <type>STRING8</type> pattern
3924 2 <type>CARD16</type> sequence-number
3926 4 <type>CARD32</type> replies-following-hint
3927 4 <type>CARD32</type> numberof font-names
3928 n LISTofSTRNAME font-names
3931 <link linkend="Requests:ListFontsWithXInfo"><emphasis role="bold"><function>ListFontsWithXInfo</function></emphasis></link>
3935 4 <type>CARD32</type> max-names
3936 2 n length of pattern
3938 n <type>STRING8</type> pattern
3940 ▶+ (except for last in series)
3943 2 <type>CARD16</type> sequence-number
3944 4 3+(n+p+f)/4 length
3945 4 <type>CARD32</type> replies-hint
3946 f <type>XFONTINFO</type> fontinfo
3947 n <type>STRING8</type> name
3951 1 0 last-reply indicator
3952 2 <type>CARD16</type> sequence-number
3955 <link linkend="Requests:OpenBitmapFont"><emphasis role="bold"><function>OpenBitmapFont</function></emphasis></link>
3959 4 <type>FONTID</type> fontid
3960 4 <type>BITMAPFORMATMASK</type> format-mask
3961 4 <type>BITMAPFORMAT</type> format
3966 1 <type>BOOL</type> otherid-valid
3967 2 <type>CARD16</type> sequence-number
3969 4 <type>FONTID</type> otherid
3970 1 <type>BOOL</type> cachable
3973 <link linkend="Requests:QueryXInfo"><emphasis role="bold"><function>QueryXInfo</function></emphasis></link>
3977 4 <type>FONTID</type> fontid
3981 2 <type>CARD16</type> sequence-number
3983 f <type>XFONTINFO</type> fontinfo
3986 <link linkend="Requests:QueryXExtents8"><emphasis role="bold"><function>QueryXExtents8</function></emphasis></link>
3988 1 <type>BOOL</type> range
3990 4 <type>FONTID</type> fontid
3991 4 n number chars entries
3992 n <type>STRING8</type> chars
3997 2 <type>CARD16</type> sequence-number
3999 4 n number of extents
4000 12*n <type>LISTofXCHARINFO</type> extents
4002 <link linkend="Requests:QueryXExtents16"><emphasis role="bold"><function>QueryXExtents16</function></emphasis></link>
4004 1 <type>BOOL</type> range
4005 2 3+(2*n+p)/4 length
4006 4 <type>FONTID</type> fontid
4007 4 n number chars entries
4008 2*n <type>LISTofCHAR2B</type> chars
4009 p unused, p=pad(2*n)
4013 2 <type>CARD16</type> sequence-number
4015 4 n number of extents
4016 12*n <type>LISTofXCHARINFO</type> extents
4018 <link linkend="Requests:QueryXBitmaps8"><emphasis role="bold"><function>QueryXBitmaps8</function></emphasis></link>
4020 1 <type>BOOL</type> range
4022 4 <type>FONTID</type> fontid
4023 4 <type>BITMAPFORMAT</type> format
4024 4 n number of chars entries
4025 n <type>STRING8</type> chars
4030 2 <type>CARD16</type> sequence-number
4031 4 5+2*n+(m+p)/4 length
4032 4 <type>CARD32</type> replies-following-hint
4033 4 n number of offsets
4034 4 m number of bytes of glyph images
4035 8*n <type>LISTofOFFSET32</type> offsets
4036 m <type>LISTofBYTE</type> glyphimages
4039 <link linkend="Requests:QueryXBitmaps16"><emphasis role="bold"><function>QueryXBitmaps16</function></emphasis></link>
4041 1 <type>BOOL</type> range
4042 2 4+(2*n+p)/4 length
4043 4 <type>FONTID</type> fontid
4044 4 <type>BITMAPFORMAT</type> format
4045 4 n number of chars entries
4046 2*n <type>LISTofCHAR2B</type> chars
4047 p unused, p=pad(2*n)
4051 2 <type>CARD16</type> sequence-number
4052 4 5+2*n+(m+p)/4 length
4053 4 <type>CARD32</type> replies-following-hint
4054 4 n number of offsets
4055 4 m number of bytes of glyph images
4056 8*n <type>LISTofOFFSET32</type> offsets
4057 m <type>LISTofBYTE</type> glyphimages
4060 <link linkend="Requests:CloseFont"><emphasis role="bold"><function>CloseFont</function></emphasis></link>
4064 4 <type>FONTID</type> fontid
4068 <section id='Encoding::Errors'>
4069 <title>Errors</title>
4070 <literallayout class="monospaced">
4072 <link linkend="Errors:Request"><emphasis role="bold"><errorname>Request</errorname></emphasis></link>
4074 1 0 <errorname>Request</errorname>
4075 2 <type>CARD16</type> sequence-number
4077 4 <type>TIMESTAMP</type> timestamp
4078 1 <type>CARD8</type> major-opcode
4079 1 <type>CARD8</type> minor-opcode
4082 <link linkend="Errors:Format"><emphasis role="bold"><errorname>Format</errorname></emphasis></link>
4084 1 1 <errorname>Format</errorname>
4085 2 <type>CARD16</type> sequence-number
4087 4 <type>TIMESTAMP</type> timestamp
4088 1 <type>CARD8</type> major-opcode
4089 1 <type>CARD8</type> minor-opcode
4091 4 <type>BITMAPFORMAT</type> bad-format
4093 <link linkend="Errors:Font"><emphasis role="bold"><errorname>Font</errorname></emphasis></link>
4095 1 2 <errorname>Font</errorname>
4096 2 <type>CARD16</type> sequence-number
4098 4 <type>TIMESTAMP</type> timestamp
4099 1 <type>CARD8</type> major-opcode
4100 1 <type>CARD8</type> minor-opcode
4102 4 <type>FONTID</type> bad-fontid
4104 <link linkend="Errors:Range"><emphasis role="bold"><errorname>Range</errorname></emphasis></link>
4106 1 3 <errorname>Range</errorname>
4107 2 <type>CARD16</type> sequence-number
4109 4 <type>TIMESTAMP</type> timestamp
4110 1 <type>CARD8</type> major-opcode
4111 1 <type>CARD8</type> minor-opcode
4113 4 <type>RANGE</type> bad-range
4115 <link linkend="Errors:EventMask"><emphasis role="bold"><errorname>EventMask</errorname></emphasis></link>
4117 1 4 <errorname>EventMask</errorname>
4118 2 <type>CARD16</type> sequence-number
4120 4 <type>TIMESTAMP</type> timestamp
4121 1 <type>CARD8</type> major-opcode
4122 1 <type>CARD8</type> minor-opcode
4124 4 <type>EVENTMASK</type> event-mask
4126 <link linkend="Errors:AccessContext"><emphasis role="bold"><errorname>AccessContext</errorname></emphasis></link>
4128 1 5 <errorname>AccessContext</errorname>
4129 2 <type>CARD16</type> sequence-number
4131 4 <type>TIMESTAMP</type> timestamp
4132 1 <type>CARD8</type> major-opcode
4133 1 <type>CARD8</type> minor-opcode
4135 4 <type>ACCESSCONTEXT</type> access context
4137 <link linkend="Errors:IDChoice"><emphasis role="bold"><errorname>IDChoice</errorname></emphasis></link>
4139 1 6 <errorname>IDChoice</errorname>
4140 2 <type>CARD16</type> sequence-number
4142 4 <type>TIMESTAMP</type> timestamp
4143 1 <type>CARD8</type> major-opcode
4144 1 <type>CARD8</type> minor-opcode
4146 4 <type>FONTID</type> bad-fontid
4148 <link linkend="Errors:Name"><emphasis role="bold"><errorname>Name</errorname></emphasis></link>
4150 1 7 <errorname>Name</errorname>
4151 2 <type>CARD16</type> sequence-number
4153 4 <type>TIMESTAMP</type> timestamp
4154 1 <type>CARD8</type> major-opcode
4155 1 <type>CARD8</type> minor-opcode
4158 <link linkend="Errors:Resolution"><emphasis role="bold"><errorname>Resolution</errorname></emphasis></link>
4160 1 8 <errorname>Resolution</errorname>
4161 2 <type>CARD16</type> sequence-number
4163 4 <type>TIMESTAMP</type> timestamp
4164 1 <type>CARD8</type> major-opcode
4165 1 <type>CARD8</type> minor-opcode
4166 6 <type>RESOLUTION</type> resolution
4168 <link linkend="Errors:Alloc"><emphasis role="bold"><errorname>Alloc</errorname></emphasis></link>
4170 1 9 <errorname>Alloc</errorname>
4171 2 <type>CARD16</type> sequence-number
4173 4 <type>TIMESTAMP</type> timestamp
4174 1 <type>CARD8</type> major-opcode
4175 1 <type>CARD8</type> minor-opcode
4178 <link linkend="Errors:Length"><emphasis role="bold"><errorname>Length</errorname></emphasis></link>
4180 1 10 <errorname>Length</errorname>
4181 2 <type>CARD16</type> sequence-number
4183 4 <type>TIMESTAMP</type> timestamp
4184 1 <type>CARD8</type> major-opcode
4185 1 <type>CARD8</type> minor-opcode
4187 4 <type>CARD32</type> bad-length
4189 <link linkend="Errors:Implementation"><emphasis role="bold"><errorname>Implementation</errorname></emphasis></link>
4191 1 11 <errorname>Implementation</errorname>
4192 2 <type>CARD16</type> sequence-number
4194 4 <type>TIMESTAMP</type> timestamp
4195 1 <type>CARD8</type> major-opcode
4196 1 <type>CARD8</type> minor-opcode
4202 <section id='Encoding::Events'>
4203 <title>Events</title>
4204 <literallayout class="monospaced">
4205 <link linkend="Events:KeepAlive"><emphasis role="bold"><function>KeepAlive</function></emphasis></link>
4208 2 <type>CARD16</type> sequence-number
4210 4 <type>TIMESTAMP</type> timestamp
4212 <link linkend="Events:CatalogueListNotify"><emphasis role="bold"><function>CatalogueListNotify</function></emphasis></link>
4214 1 1 event CatalogueListNotify
4215 2 <type>CARD16</type> sequence-number
4217 4 <type>TIMESTAMP</type> timestamp
4218 1 <type>BOOL</type> added
4219 1 <type>BOOL</type> deleted
4222 <link linkend="Events:FontListNotify"><emphasis role="bold"><function>FontListNotify</function></emphasis></link>
4224 1 2 event FontListNotify
4225 2 <type>CARD16</type> sequence-number
4227 4 <type>TIMESTAMP</type> timestamp
4228 1 <type>BOOL</type> added
4229 1 <type>BOOL</type> deleted
4236 <chapter id='Acknowledgements'>
4237 <title>Acknowledgements</title>
4239 <!-- (SN Acknowledgements -->
4242 This document represents the culmination of several years of debate and
4243 experiments done under the auspices of the
4244 <orgname class="consortium">MIT X Consortium</orgname> font working group.
4245 Although this was a group effort, the author remains responsible for any errors
4246 or omissions. The protocol presented here was primarily designed by
4247 <personname><firstname>Jim</firstname><surname>Fulton</surname></personname>,
4248 <personname><firstname>Keith</firstname><surname>Packard</surname></personname>,
4250 <personname><firstname>Bob</firstname><surname>Scheifler</surname></personname>.
4251 Special thanks goes to
4252 <personname><firstname>Ned</firstname><surname>Batchelder</surname></personname>,
4253 <personname><firstname>Jim</firstname><surname>Flowers</surname></personname>,
4255 <personname><firstname>Axel</firstname><surname>Deininger</surname></personname>
4256 for their invigorating comments
4257 which never failed to make this a better document.
4258 <personname><firstname>Stephen</firstname><surname>Gildea</surname></personname>
4259 edited version 2 of this document. Finally,
4260 <personname><firstname>David</firstname><surname>Lemke</surname></personname>
4261 deserves great credit for designing and coding the sample implementation.
4265 <bibliography id='References'>
4266 <title>References</title>
4268 All of the following documents are X Consortium standards available from
4271 <biblioentry id='References:x11proto'>
4273 <title><olink targetdoc='x11protocol' targetptr='x11protocol'>X Window System Protocol Version 11</olink></title>
4274 <author><firstname>Robert W.</firstname><surname>Scheifler</surname></author>
4277 <biblioentry id='References:bdf-spec'>
4279 <corpauthor>Adobe Systems</corpauthor>
4280 <title>Bitmap Distribution Format 2.1</title>
4283 <biblioentry id='References:xlfd-spec'>
4285 <corpauthor>X Consortium</corpauthor>
4286 <title><olink targetdoc='xlfd' targetptr='xlfd'>X Logical Font
4287 Description Conventions, Version 1.5</olink></title>
4292 <appendix id="suggested_licensing_policies">
4293 <title>Suggested Licensing Policies</title>
4295 The authorization data passed by the client in the initial connection
4296 setup information may be used by the font server to implement restrictions
4297 on which fonts may be accessed. Furthermore, the font server is free to
4298 refuse new connections at any time.
4301 Configuration or management of the license restrictions is outside the scope of
4302 the font service protocol and is done in a server-dependent manner. Possible
4303 policies might include, but are not limited to, combinations of the following:
4306 <?dbhtml list-presentation="list"?>
4308 <term>No restrictions</term>
4311 anyone may access any fonts. The server neither refuses any connections
4312 nor generates <link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link> errors on any
4313 fonts. For environments without specially-licensed fonts, this is
4319 <term>Per-machine</term>
4322 only those clients connecting from a known set of
4323 machines are permitted access. The server could get the address
4324 of the connection and look in a list of allowed machines.
4329 <term>Per-user</term>
4332 only a known set of users may access the fonts. The
4333 server can use the authorization data (such as a Kerberos ticket
4334 or a Secure RPC credential) to verify the identity of the user
4335 and then look in a list of allowed users.
4340 <term>Simultaneous Use</term>
4343 only a certain number of clients may use a given font at any one time.
4344 Additional clients would receive <link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link>
4345 errors if they attempt to open the font. This is only effective if
4346 the initial clients keep the font open for the entire time that it
4347 is being used (even if all of the data has been transmitted and is
4353 <term>Postage Meter</term>
4356 a particular font may only be accessed a limited
4357 number of times before its license must be renewed. Each time
4358 the font is opened, the server decrements a counter. When the
4359 counter reaches zero, all further attempts to open the font
4360 return an <link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link> error.
4368 It should be noted that chaining of font servers (obtaining font data from
4369 other font servers) may conflict with certain license policies.
4373 <appendix id="implementation_suggestions">
4374 <title>Implementation Suggestions</title>
4376 Font server implementations will probably wish to use techniques such as the
4377 following to avoid limits on the number of simultaneous connections:
4382 The initial connection information returned by the font
4383 server contains the names of other font servers that
4384 may be used as substitutes. A font server may refuse to
4385 accept a connection, indicating that the client should
4386 try one of the alternatives instead.
4391 On operating systems that support processing forking, font
4392 servers might choose to fork so that the child can continue
4393 processing the existing connections and the parent can accept
4394 new connections. Such implementations are encouraged to use
4395 shared memory so that in-memory font databases can be shared.
4400 On operating systems that support passing stream file descriptors
4401 between processes, cooperating font servers could collect
4402 connections in a single process when there are few connections
4403 and spread them among several processes as the load increases.
4408 If a font client is unable to connect to a server (as opposed
4409 to having the connection terminated), it should retry for an
4410 implementation-dependent length of time (see Xlib's
4411 handling of ECONNREFUSED in XConnDis.c).
4416 <index id="index" />