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">
9 <title>The X Font Service Protocol</title>
10 <subtitle>X Window System Standard</subtitle>
11 <releaseinfo>Version 2.0</releaseinfo>
14 <firstname>Jim</firstname><surname>Fulton</surname>
15 <affiliation><orgname>
16 Network Computing Devices, Inc.
17 </orgname></affiliation>
20 <corpname>X Consortium Standard</corpname>
21 <copyright><year>1991</year><holder>Network Computing Devices, Inc.</holder></copyright>
22 <copyright><year>1994</year><holder>X Consortium</holder></copyright>
23 <affiliation><orgname>X Consortium</orgname></affiliation>
24 <productnumber>X Version 11, Release 6.8</productnumber>
25 <edition>Revised May 2, 1994</edition>
30 Permission to use, copy, modify, distribute, and sell this
31 documentation for any purpose is hereby granted without fee,
32 provided that the above copyright notice and this permission
33 notice appear in all copies. Network Computing Devices, Inc.
34 makes no representations about the suitability for any purpose
35 of the information in this document. This documentation is
36 provided "as is" without express or implied warranty.
39 Permission is hereby granted, free of charge, to any person obtaining a copy
40 of this software and associated documentation files (the "Software"), to deal
41 in the Software without restriction, including without limitation the rights
42 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
43 copies of the Software, and to permit persons to whom the Software is
44 furnished to do so, subject to the following conditions:
47 The above copyright notice and this permission notice shall be included in
48 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.
61 Except as contained in this notice, the name of the X Consortium shall not be
62 used in advertising or otherwise to promote the sale, use or other dealings
63 in this Software without prior written authorization from the X Consortium.
70 <sect1 id="introduction">
71 <title>Introduction</title>
73 The management of fonts in large, heterogeneous environments is one of the
74 hardest aspects of using the X Window System
76 <emphasis remap='I'>X Window System</emphasis>
77 is a trademark of The Open Group.
79 . Multiple formats and the lack of
80 a consistent mechanism for exporting font data to all displays on a network
81 prevent the transparent use of applications across different display platforms.
82 The X Font Service protocol is designed to address this and other issues, with
83 specific emphasis on the needs of the core X protocol. Upward-compatible
84 changes (typically in the form of new requests) are expected as consensus is
85 reached on new features (particularly outline font support).
88 Currently, most X displays use network file protocols such as NFS and TFTP to
89 obtain raw font data which they parse directly. Since a common binary format
90 for this data doesn't exist, displays must be able to interpret a variety of
91 formats if they are to be used with different application hosts. This leads to
92 wasted code and data space and a loss of interoperability as displays are used
93 in unforeseen environments.
96 By moving the interpretation of font data out of the X server into a separate
97 service on the network, these problems can be greatly reduced. In addition,
98 new technologies, such as dynamically generating bitmaps from scaled or outline
99 fonts, can be provided to all displays transparently. For horizontal text,
100 caching techniques and increased processor power can potentially make
101 rasterization more efficient on large, centralized hosts than on individual
105 Each font server provides sets of fonts that may be listed and queried for
106 header, property, glyph extents, and bitmap information. This data is
107 transmitted over the network using a binary format (with variations to support
108 different bit- and byte-orders) designed to minimize the amount of processing
109 required by the display. Since the font server, rather than the display, is
110 responsible for parsing the raw font data, new formats can be used by all
111 displays by modifying a single font server.
114 From the user's point of view, font servers are simply a new type of name in
115 the X font path. Network name services allow descriptive names (such as
116 DEPARTMENT-FONTS or APPLICATION-FONTS) to be translated into proper network
117 addresses. X displays send requests to and read replies from the font server
118 rather than reading directly from files. Since the X Font Service protocol is
119 designed to allow subsets of the font data to be requested, displays may easily
120 implement a variety of strategies for fine-grained demand-loading of glyphs.
124 <sect1 id="architectural_model">
125 <title>Architectural Model</title>
127 <!-- (SN Architectural Model -->
131 In this document, the words "client" and "server" refer to the consumer and
132 provider of a font, respectively, unless otherwise indicated. It is important
133 to note that in this context, the X server is also a font client.
136 The X Font Service protocol does not require any changes to the core X protocol
137 or to any applications. To the user, font servers are simply additional types
138 of font path elements. As such, X servers may connect to multiple font
139 servers, as shown in Figure 2.1. Although the font protocol is geared towards
140 the X Window System, it may be also used by other consumers of font data (such
144 <literallayout class="monospaced">
145 ┌────────┐ ┌───────────────┐
146 │ X1 ├──────────────┤ │
147 │ Server │ │ Font Server │
148 └────────┘ ┌───────┤ 1 │
151 │ X2 ├──────┘ ┌───────────────┐
152 │ Server ├──────────────┤ │
153 └────────┘ │ Font Server │
155 ┌─────────┐ │ └───────────────┘
162 Figure 2.1: Connecting to a Font Server
167 Clients communicate with the font server using the request/reply/event model
168 over any mutually-understood virtual stream connection (such as TCP/IP, DECnet,
170 DECnet is a trademark of Digital Equipment Corporation.
172 etc.). Font servers are responsible for providing data in the bit and byte
173 orders requested by the client. The set of requests and events provided in the
174 first version of the X Font Service protocol is limited to supporting the needs
175 of the bitmap-oriented core X Window System protocol. Extensions are expected
180 A font server reads raw font data from a variety of sources (possibly
181 including other font servers) and converts it into a common format that is
182 transmitted to the client using the protocol described in Section 4. New font
183 formats are handled by adding new converters to a font server, as shown in
187 <literallayout class="monospaced">
195 ┌─────────────────────┴──────────────────────┐
199 ├─────┬─────┬─────┬─────┬────┬─────┬───┬─────┤
200 │ bdf │ snf │ pcf │ atm │ f3 │ dwf │ │ │ ... │
201 └─────┴─────┴─────┴─────┴────┴─────┴─│─┴─────┘
212 Figure 2.2: Where Font Data Comes From
216 The server may choose to provide named sets of fonts called "catalogues."
217 Clients may specify which of the sets should be used in listing or opening a
222 An event mechanism similar to that used in the X protocol is provided for
223 asynchronous notification of clients by the server.
228 Clients may provide authorization data for the server to be used in determining
229 (according to the server's licensing policy) whether or not access should be
230 granted to particular fonts. This is particularly useful for clients whose
231 authorization changes over time (such as an X server that can verify the
232 identity of the user).
236 Implementations that wish to provide additional requests or events may use the
237 extension mechanism. Adding to the core font service protocol (with the
238 accompanying change in the major or minor version numbers) is reserved to the X
243 <sect1 id="font_server_naming">
244 <title>Font Server Naming</title>
246 <!-- (SN Font Server Naming -->
249 Font clients that expose font server names to the user are encouraged to
250 provide ways of naming font servers symbolically (e.g. DEPARTMENT-FONTS).
251 However, for environments that lack appropriate name services
252 transport-specific names are necessary. Since these names do occur in the
253 protocol, clients and servers should support at least the applicable formats
254 described below. Formats for additional transports may be registered with the
258 <sect2 id="tcpip_names">
259 <title>TCP/IP Names</title>
261 <!-- (SN TCP/IP Names -->
264 The following syntax should be used for TCP/IP names:
267 <literallayout class="monospaced">
268 <TCP name> ::= "tcp/" <hostname>":" <ipportnumber> ["/" <cataloguelist>]
272 where <hostname> is either symbolic (such as expo.lcs.mit.edu) or numeric
273 decimal (such as 18.30.0.212). The <ipportnumber> is the port on
275 font server is listening for connections. The <cataloguelist> string at
276 the end is optional and specifies a plus-separated list of catalogues
277 that may be requested. For example:
279 <literallayout class="monospaced">
280 tcp/expo.lcs.mit.edu:8012/available+special
285 <sect2 id="decnet_names">
286 <title>DECnet Names</title>
288 <!-- (SN DECnet Names -->
292 The following syntax should be used for DECnet names:
294 <literallayout class="monospaced">
295 <DECnet name> ::= "decnet/" <nodename> "::font$" <objname>
296 ["/" <cataloguelist>]
299 where <nodename> is either symbolic (such as SRVNOD) or the
301 form of the DECnet address (such as 44.70). The <objname> is normal,
302 case-insensitive DECnet object name. The <cataloguelist> string
304 optional and specifies a plus-separated list of catalogues that may be
305 requested. For example:
308 <literallayout class="monospaced">
309 DECNET/SRVNOD::FONT$DEFAULT/AVAILABLE
310 decnet/44.70::font$other
315 <sect1 id="protocol">
316 <title>Protocol</title>
318 <!-- (SN Protocol -->
322 The protocol described below uses the request/reply/error model and is
323 specified using the same conventions outlined in Section 2 of the core X Window
330 Data type names are spelled in upper case with no word separators,
337 Alternate values are capitalized with no word separators,
344 Structure element declarations are in lower case with hyphens
345 as word separators, as in: byte-order-msb
349 Structure element names are referred to in
350 upper case (e.g. BYTE-ORDER-MSB) when used in
351 descriptions to set them off from the surrounding
352 text. When this document is typeset they will be
353 printed in lower case in a distinct font.
359 Type declarations have the form "name: type",
360 as in: CARD8: 8-bit byte
365 Comma-separated lists of alternate values are enclosed in
366 braces, as in: { Min, MaxWidth, Max }
371 Comma-separated lists of structure elements are enclosed in
372 brackets, as in: [ byte1: CARD8, byte2: CARD8 ]
379 A type with a prefix "LISTof" represents a counted list of
380 elements of that type, as in: LISTofCARD8
383 <sect2 id="data_types">
384 <title>Data Types</title>
386 <!-- (SN Data Types -->
389 The following data types are used in the core X Font Server protocol:
392 <literallayout class="monospaced">
397 This value is specified in the CreateAC request as the identifier
398 to be used when referring to a particular AccessContext resource
399 within the server. These resources are used by the server to
400 store client-specified authorization information. This
401 information may be used by the server to determine whether or not
402 the client should be granted access to particular font data.
406 In order to preserve the integrity of font licensing being performed by
407 the font server, care must be taken by a client to properly represent the
408 identity of the true user of the font. Some font clients will in fact
409 be servers (for example, X servers) requesting fonts for their own clients.
410 Other font clients may be doing work on behalf of a number of different
411 users over time (for example, print spoolers).
415 <function>AccessContexts </function>
416 must be created (with
417 <function>CreateAC ) </function>
418 and switched among (with
419 <function>SetAuthorization )</function>
420 to represent all of these "font users" properly.
424 <literallayout class="monospaced">
425 ALTERNATESERVER: [ name: STRING8,
431 This structure specifies the NAME, encoded in ISO 8859-1 according
432 to Section 3, of another font server that may be useful as a
433 substitute for this font server. The SUBSET field indicates
434 whether or not the alternate server is likely to only contain a
435 subset of the fonts available from this font server. This
436 information is returned during the initial connection setup and
437 may be used by the client to find a backup server in case of
442 <literallayout class="monospaced">
443 AUTH: [ name: STRING8,
449 This structure specifies the name of an authorization protocol and
450 initial data for that protocol. It is used in the authorization
451 negotiation in the initial connection setup and in the CreateAC
456 <literallayout class="monospaced">
460 <literallayout class="monospaced">
461 CARD32 containing the following fields defined by the
462 sets of values given further below
464 byte-order-msb: 1 bit,
465 bit-order-msb: 1 bit,
466 image-rect: 2 bits { Min,
470 scanline-pad: 2 bits { ScanlinePad8,
475 scanline-unit: 2 bits { ScanlineUnit8,
486 This structure specifies how glyph images are transmitted in
488 <function>QueryXBitmaps8 </function>
490 <function>QueryXBitmaps16 </function>
495 If the BYTE-ORDER-MSB bit (1 << 0) is set, the Most Significant
496 Byte of each scanline unit is returned first. Otherwise, the
497 Least Significant Byte is returned first.
501 If the BIT-ORDER-MSB bit (1 << 1) is set, the left-most bit in
502 each glyph scanline unit is stored in the Most Significant Bit of
503 each transmitted scanline unit. Otherwise, the left-most bit is
504 stored in the Least Significant Bit.
508 The IMAGE-RECT field specifies a rectangle of pixels within the
509 glyph image. It contains one of the following alternate values:
512 <literallayout class="monospaced">
513 ImageRectMin (0 << 2)
514 ImageRectMaxWidth (1 << 2)
515 ImageRectMax (2 << 2)
518 For a glyph with extents XCHARINFO in a font with header information
519 XFONTINFO, the IMAGE-RECT values have the following meanings:
522 <function>ImageRectMin -</function>
523 This refers to the minimal bounding rectangle
524 surrounding the inked pixels in the glyph. This is the
525 most compact representation. The edges of the rectangle
528 <literallayout class="monospaced">
529 left: XCHARINFO.LBEARING
530 right: XCHARINFO.RBEARING
531 top: XCHARINFO.ASCENT
532 bottom: XCHARINFO.DESCENT
536 <function>ImageRectMaxWidth - </function>
537 This refers to the scanlines between the
538 glyph's ascent and descent, padded on the left to the minimum
539 left-bearing (or 0, whichever is less) and on the right to
540 the maximum right-bearing (or logical-width, whichever is
541 greater). All glyph images share a common horizontal
542 origin. This is a combination of ImageRectMax in the
543 horizontal direction and ImageRectMin in the vertical
544 direction. The edges of the rectangle are:
547 <literallayout class="monospaced">
548 left: min (XFONTINFO.MIN-BOUNDS.LBEARING, 0)
549 right: max (XFONTINFO.MAX-BOUNDS.RBEARING,
550 XFONTINFO.MAX-BOUNDS.WIDTH)
551 top: XCHARINFO.ASCENT
552 bottom: XCHARINFO.DESCENT
556 ImageRectMax - This refers to all scanlines, from the maximum
557 ascent (or the font ascent, whichever is greater) to the
558 maximum descent (or the font descent, whichever is greater),
559 padded to the same horizontal extents as MaxWidth.
560 All glyph images have the same sized bitmap and share a
561 common origin. This is the least compact representation,
562 but may be the easiest or most efficient (particularly for
563 character cell fonts) for some clients to use. The edges of
567 <literallayout class="monospaced">
568 left: min (XFONTINFO.MIN-BOUNDS.LBEARING, 0)
569 right: max (XFONTINFO.MAX-BOUNDS.RBEARING,
570 XFONTINFO.MAX-BOUNDS.WIDTH)
571 top: max (XFONTINFO.FONT-ASCENT,
572 XFONTINFO.MAX-BOUNDS.ASCENT)
573 bottom: max (XFONTINFO.FONT-DESCENT,
574 XFONTINFO.MAX-BOUNDS.DESCENT)
577 The SCANLINE-PAD field specifies the number of bits (8, 16, 32,
578 or 64) to which each glyph scanline is padded before transmitting.
579 It contains one of the following alternate values:
581 <literallayout class="monospaced">
582 ScanlinePad8 (0 << 8)
583 ScanlinePad16 (1 << 8)
584 ScanlinePad32 (2 << 8)
585 ScanlinePad64 (3 << 8)
588 The SCANLINE-UNIT field specifies the number of bits (8, 16, 32,
589 or 64) that should be treated as a unit for swapping. This value
590 must be less than or equal to the number of bits specified by the
591 SCANLINE-PAD. It contains one of the following alternate values:
594 <literallayout class="monospaced">
595 ScanlineUnit8 (0 << 12)
596 ScanlineUnit16 (1 << 12)
597 ScanlineUnit32 (2 << 12)
598 ScanlineUnit64 (3 << 12)
601 BITMAPFORMATs are byte-swapped as CARD32s. All unspecified bits
605 Use of an invalid BITMAPFORMAT causes a Format error to
610 BITMAPFORMATMASK: CARD32 mask
614 This is a mask of bits representing the fields in a BITMAPFORMAT:
617 <literallayout class="monospaced">
618 ByteOrderMask (1 << 0)
619 BitOrderMask (1 << 1)
620 ImageRectMask (1 << 2)
621 ScanlinePadMask (1 << 3)
622 ScanlineUnitMask (1 << 4)
625 Unspecified bits are required to be zero or else a Format error
633 This is a boolean value containing one of the following alternate
637 <literallayout class="monospaced">
649 This is an unsigned byte of data whose encoding
650 is determined by the context in which it is used.
655 CARD8: 8-bit unsigned integer
659 CARD16: 16-bit unsigned integer
663 CARD32: 32-bit unsigned integer
668 These are unsigned numbers. The latter two are byte-swapped when
669 the server and client have different byte orders.
674 CHAR2B: [ byte1, byte2: CARD8 ]
678 This structure specifies an individual character code within
679 either a 2-dimensional matrix (using BYTE1 and BYTE2 as the row
680 and column indices, respectively) or a vector (using BYTE1 and
681 BYTE2 as most- and least-significant bytes, respectively). This
682 data type is treated as a pair of 8-bit values and is never
683 byte-swapped. Therefore, the client should always transmit BYTE1
689 EVENTMASK: CARD32 mask
694 This is a mask of bits indicating which of an extension's (or the
695 core's) maskable events the client would like to receive. Each
696 bit indicates one or more events, and a bit value of one indicates
697 interest in a corresponding set of events. The following bits are
698 defined for event masks specified for the core protocol (i.e. an
699 EXTENSION-OPCODE of zero in
700 <function>SetEventMask </function>
702 <function>GetEventMask </function>
706 <literallayout class="monospaced">
707 CatalogueListChangeMask (1 << 0)
708 FontListChangeMask (1 << 1)
713 <function>CatalogueListChangeMask </function>
714 is set, client is interested in
716 <function>CatalogueListNotify </function>
718 <function>FontListChangeMask </function>
719 is set, the client is interested in
721 <function>FontListNotify </function>
726 Extensions that provide additional events may define their own
727 event masks. These event masks have their own scope and may use
728 the same bit values as the core or other extensions.
730 All unused bits must be set to zero. In
731 <function>SetEventMask </function>
733 any bits are set that are not defined for the extension (or core)
734 for which this EVENTMASK is intended (according to the EXTENSION-
736 <function>SetEventMask </function>
738 <function>EventMask </function>
741 This value is swapped as a CARD32.
751 This is specified by the client in the request
752 <function>OpenBitmapFont </function>
753 as the identifier to be used when referring to a particular open
764 This is a 32-bit value in which the top 3 bits must be clear, and
765 at least 1 other bit must be set (yielding a range of 1 through
766 2^29-1). It is specified by the client to represent objects in
767 the server. Identifiers are scoped according to their type are
768 private to the client; thus, the same identifier may be used for
769 both a FONTID and an ACCESSCONTEXT as well as by multiple clients.
772 An ID of zero is referred to as None.
777 INT8: 8-bit signed integer
781 INT16: 16-bit signed integer
785 INT32: 32-bit signed integer
790 These are signed numbers. The latter two are byte-swapped when
791 the client and server have different byte orders.
795 <literallayout class="monospaced">
796 OFFSET32: [ position: CARD32,
802 This structure indicates a position and length within a block of
807 <literallayout class="monospaced">
808 PROPINFO: [ offsets: LISTofPROPOFFSET,
814 This structure describes the list of properties provided by a
815 font. Strings for all of the properties names and values are
816 stored within the data block and are located using a table of
820 This structure is padded to 32-bit alignment.
824 <literallayout class="monospaced">
825 PROPOFFSET: [ name: OFFSET32,
828 zero-pad3: BYTE, BYTE, BYTE ]
833 This structure specifies the position, length, and type of
834 of data for a property.
837 The NAME field specifies the position and length (which must be
838 greater than zero) of the property name relative to the beginning
839 of the PROPINFO.DATA block for this font. The interpretation of
840 the position and length of the VALUE field is determined by the
841 TYPE field, which contains one of the following alternate values:
845 <literallayout class="monospaced">
853 which have the following meanings:
857 This property contains a counted string of bytes. The
858 data is stored in the PROPINFO.DATA block beginning at
859 relative byte VALUE.POSITION (beginning with zero), extending
860 for VALUE.LENGTH (at least zero) bytes.
864 This property contains a unsigned, 32-bit number stored
865 as a CARD32 in VALUE.POSITION (VALUE.LENGTH is zero).
869 This property contains a signed, 32-bit number stored as
870 an INT32 in VALUE.POSITION (VALUE.LENGTH is zero).
871 This structure is zero-padded to 32-bit alignment.
877 RANGE: [ min-char, max-char: CHAR2B ]
882 This structure specifies a range of character codes. A single
883 character is represented by MIN-CHAR equals MAX-CHAR. If the
884 linear interpretation of MAX-CHAR is less than that of MIN-CHAR,
885 or if MIN-CHAR is less than the font's
886 XFONTINFO.CHAR-RANGE.MIN-CHAR, or if MAX-CHAR is greater than the
887 font's XFONTINFO.CHAR-RANGE.MAX-CHAR, the range is invalid.
891 <literallayout class="monospaced">
892 RESOLUTION: [ x-resolution: CARD16,
893 y-resolution: CARD16,
894 decipoint-size: CARD16 ]
899 This structure specifies resolution and point size to be used in
900 resolving partially-specified scaled font names. The X-RESOLUTION
901 and Y-RESOLUTION are measured in pixels-per-inch and must be
902 greater than zero. The DECIPOINT-SIZE is the preferred font
903 size, measured in tenths of a point, and must be greater than zero.
913 This is a counted list of 1-byte character codes, typically
914 encoded in ISO 8859-1. A character code "c" is equivalent to a
915 CHAR2B structure whose BYTE1 is zero and whose BYTE2 is "c".
925 This is the number of milliseconds that have passed since a server-
926 dependent origin. It is provided in errors and events and is
932 XCHARINFO: [ lbearing, rbearing: INT16,
934 ascent, descent: INT16,
940 This structure specifies the ink extents and horizontal escapement
941 (also known as the set- or logical width) of an individual
942 character. The first five values represent directed distances in
943 a coordinate system whose origin is aligned with the lower-left
944 edge of the left-most pixel of the glyph baseline (i.e. the
945 baseline falls between two pixels as shown in Figure 3-1 of the
946 "Bitmap Distribution Format 2.1" Consortium standard [2]).
950 The LBEARING field specifies the directed distance measured to the
951 right from the origin to the left edge of the left-most inked
956 The RBEARING field specifies the directed distance (measured to
957 the right) from the origin to the right edge of the right-most
958 inked pixel in the glyph.
962 The WIDTH field specifies the directed distance (measured to the
963 right) from the origin to the position where the next character
964 should appear (called the "escapement point"). This distance
965 includes any whitespace used for intercharacter padding and is
966 also referred to as the "logical width" or "horizontal
971 The ASCENT field specifies the directed distance (measured up)
972 from the baseline to the top edge of the top-most inked pixel
977 The DESCENT field specifies the directed distance (measured
978 down) from the baseline to the bottom edge of the bottom-most
983 The ATTRIBUTES field specifies glyph-specific information that
984 is passed through the application. If this value is not being
985 used, it should be zero.
988 The ink bounding box of a glyph is defined to be the smallest
989 rectangle that encloses all of the inked pixels. This box has
990 a width of RBEARING - LBEARING pixels and a height of
991 ASCENT + DESCENT pixels.
995 <literallayout class="monospaced">
996 XFONTINFO: [ flags: CARD32,
997 drawing-direction: { LeftToRight, RightToLeft }
999 default-char: CHAR2B,
1000 min-bounds: XCHARINFO,
1001 max-bounds: XCHARINFO,
1003 font-descent: INT16,
1004 properties: PROPINFO ]
1009 This structure specifies attributes related to the font as a
1013 The FLAGS field is a bit mask containing zero or more of the
1014 following boolean values (unspecified bits must be zero):
1017 <literallayout class="monospaced">
1018 AllCharactersExist (1 << 0)
1019 InkInside (1 << 1)
1020 HorizontalOverlap (1 << 2)
1024 which have the following meanings:
1032 If this bit is set, all of the characters
1033 in the range given by CHAR-RANGE have glyphs encoded in
1034 the font. If this bit is clear, some of the characters
1035 may not have encoded glyphs.
1044 If this bit is set, the inked pixels of each glyph
1045 fall within the rectangle described by the font's ascent,
1046 descent, origin, and the glyph's escapement point. If
1047 this bit is clear, there may be glyphs whose ink extends
1048 outside this rectangle.
1056 If this bit is set, the two ink bounding
1057 boxes (smallest rectangle enclosing the inked pixels) of
1058 some pairs of glyphs in the font may overlap when displayed
1059 side-by-side (i.e. the second character is imaged at the
1060 escapement point of the first) on a common baseline. If
1061 this bit is clear, there are no pairs of glyphs whose ink
1062 bounding boxes overlap.
1066 The DRAWING-DIRECTION field contains a hint indicating whether
1067 most of the character metrics have a positive (or "LeftToRight")
1068 logical width or a negative ("RightToLeft") logical width. It
1069 contains the following alternate values:
1071 <literallayout class="monospaced">
1076 The CHAR-RANGE.MIN-CHAR and CHAR-RANGE.MAX-CHAR fields specify the
1077 first and last character codes that have glyphs encoded in this font.
1078 All fonts must have at least one encoded glyph (in which case the
1079 MIN-CHAR and MAX-CHAR are equal), but are not required to have glyphs
1080 encoded at all positions between the first and last characters.
1083 The DEFAULT-CHAR field specifies the character code of the glyph
1084 that the client should substitute for unencoded characters. Requests
1085 for extents or bitmaps for an unencoded character generate zero-filled
1086 metrics and a zero-length glyph bitmap, respectively.
1089 The MIN-BOUNDS and MAX-BOUNDS fields contain the minimum and maximum
1090 values of each of the extents field of all encoded characters in the
1091 font (i.e. non-existent characters are ignored).
1094 The FONT-ASCENT and FONT-DESCENT fields specify the font designer's
1095 logical height of the font, above and below the baseline,
1096 respectively. The sum of the two values is often used as the
1097 vertical line spacing of the font. Individual glyphs are permitted
1098 to have ascents and descents that are greater than these values.
1101 The PROPERTIES field contains the property data associated with
1105 This structure is padded to 32-bit alignment.
1110 <sect2 id="requests">
1111 <title>Requests</title>
1113 <!-- (SN Requests -->
1117 This section describes the requests that may be sent by the client and the
1118 replies or errors that are generated in response. Versions of the protocol
1119 with the same major version are required to be upward-compatible.
1123 Every request on a given connection is implicitly assigned a sequence number,
1124 starting with 1, that is used in replies, error, and events. Servers are
1125 required to generate replies and errors in the order in which the corresponding
1126 requests are received. Servers are permitted to add or remove fonts to the
1127 list visible to the client between any two requests, but requests must be
1128 processed atomically. Each request packet is at least 4 bytes long and
1129 contains the following fields:
1132 <literallayout class="monospaced">
1139 The MAJOR-OPCODE specifies which core request or extension package this packet
1140 represents. If the MAJOR-OPCODE corresponds to a core request, the
1141 MINOR-OPCODE contains 8 bits of request-specific data. Otherwise, the
1142 MINOR-OPCODE specifies which extension request this packet represents. The
1143 LENGTH field specifies the number of 4-byte units contained within the packet
1144 and must be at least one. If this field contains a value greater than one it
1145 is followed by (LENGTH - 1) * 4 bytes of request-specific data. Unless
1146 otherwise specified, unused bytes are not required to be zero.
1150 If a request packet contains too little or too much data, the server returns
1151 a Length error. If the server runs out of internal resources (such as
1152 memory) while processing a request, it returns an Alloc error. If a server is
1153 deficient (and therefore non-compliant) and is unable to process a request, it
1154 may return an Implementation error. If a client uses an extension request
1155 without previously having issued a
1156 <function>QueryExtension </function>
1157 request for that extension, the server responds with a
1158 <function>Request </function>
1159 error. If the server encounters a request
1160 with an unknown MAJOR-OPCODE or MINOR-OPCODE, it responds with a
1161 <function>Request </function>
1163 At most one error is generated per request. If more than one error condition
1164 is encountered in processing a requests, the choice of which error is returned
1165 is server-dependent.
1169 Core requests have MAJOR-OPCODE values between 0 and 127, inclusive. Extension
1170 requests have MAJOR-OPCODE values between 128 and 255, inclusive, that are
1171 assigned by by the server. All MINOR-OPCODE values in extension requests are
1172 between 0 and 255, inclusive.
1176 Each reply is at least 8 bytes long and contains the following fields:
1179 <literallayout class="monospaced">
1180 type: CARD8 value of 0
1181 data-or-unused: CARD8
1182 sequence-number: CARD16
1187 The TYPE field has a value of zero. The DATA-OR-UNUSED field may be used to
1188 encode one byte of reply-specific data (see Section 5.2 on request encoding).
1189 The least-significant 16 bits of the sequence number of the request that
1190 generated the reply are stored in the SEQUENCE-NUMBER field. The LENGTH field
1191 specifies the number of 4-byte units in this reply packet, including the fields
1192 described above, and must be at least two. If LENGTH is greater than two, the
1193 fields described above are followed by (LENGTH - 2) * 4 bytes of additional
1198 Requests that have replies are described using the following syntax:
1201 <literallayout class="monospaced">
1203 <emphasis remap='I'>arg1</emphasis>: type1
1204 <emphasis remap='I'>arg2</emphasis>: type2
1206 <emphasis remap='I'>argN</emphasis>: typeN
1208 <emphasis remap='I'>result1</emphasis>: type1
1209 <emphasis remap='I'>result2</emphasis>: type2
1211 <emphasis remap='I'>resultM</emphasis>: typeM
1213 Errors: <emphasis remap='I'>kind1</emphasis>, <emphasis remap='I'>kind2</emphasis> ..., <emphasis remap='I'>kindK</emphasis>
1219 If a request does not generate a reply, the"=>" and result lines are
1220 omitted. If a request may generate multiple replies, the "=>" is replaced by
1221 a "=>+". In the authorization data exchanges in the initial connection setup
1222 and the CreateAC request, "->" indicates data sent by the client in response
1223 to data sent by the server.
1227 The protocol begins with the establishment of a connection over a
1228 mutually-understood virtual stream:
1231 <literallayout class="monospaced">
1235 client-major-protocol-version: CARD16
1236 client-minor-protocol-version: CARD16
1237 authorization-protocols: LISTofAUTH
1240 The initial byte of the connection specifies the BYTE-ORDER in
1241 which subsequent 16-bit and 32-bit numeric values are to be
1242 transmitted. The octal value 102 (ASCII uppercase `B')
1243 indicates that the most-significant byte is to be transmitted
1244 first; the octal value 154 (ASCII lowercase `l') indicates
1245 that the least-significant byte is to be transmitted first.
1246 If any other value is encountered the server closes the
1247 connection without any response.
1252 The CLIENT-MAJOR-PROTOCOL-VERSION and
1253 CLIENT-MINOR-PROTOCOL-VERSION specify which version of the
1254 font service protocol the client would like to use. If the
1255 client can support multiple versions, the highest version
1256 should be given. This version of the protocol has a
1257 major version of 2 and a minor version of 0.
1260 The AUTHORIZATION-PROTOCOLS contains a list of protocol names and
1261 optional initial data for which the client can provide
1262 information. The server may use this to determine which
1263 protocol to use or as part of the initial exchange of
1266 <literallayout class="monospaced">
1268 status: { Success, Continue,
1270 server-major-protocol-version: CARD16
1271 server-minor-protocol-version: CARD16
1272 alternate-servers-hint: LISTofALTERNATESERVER
1273 authorization-index: CARD8
1274 authorization-data: LISTofBYTE
1278 The SERVER-MAJOR-PROTOCOL-VERSION and
1279 SERVER-MINOR-PROTOCOL-VERSION specify the version of the font
1280 service protocol that the server expects from the client. If
1281 the server supports the version specified by the client, this
1282 version number should be returned. If the client has
1283 requested a higher version than is supported by the server,
1284 the server's highest version should be returned. Otherwise,
1285 if the client has requested a lower version than is supported
1286 by the server, the server's lowest version should be returned.
1287 It is the client's responsibility to decide whether or not it
1288 can match this version of the protocol.
1291 The ALTERNATE-SERVERS-HINT is a list of other font servers
1292 that may have related sets of fonts (determined by means
1293 outside this protocol, typically by the system administrator).
1294 Clients may choose to contact these font servers if the
1295 connection is rejected or lost.
1298 The STATUS field indicates whether the server accepted,
1299 rejected, or would like more information about the connection.
1300 It has one of the following alternate values:
1302 <literallayout class="monospaced">
1311 If STATUS is Denied, the server has rejected the client's
1312 authorization information. If STATUS is Busy, the server has
1313 simply decided that it cannot provide fonts to this client at
1314 this time (it may be able to at a later time). In both cases,
1315 AUTHORIZATION-INDEX is set to zero, no authorization-data is
1316 returned, and the server closes the connection after sending
1317 the data described so far.
1320 Otherwise the AUTHORIZATION-INDEX is set to the index
1321 (beginning with 1) into the AUTHORIZATION-PROTOCOLS list of
1322 the protocol that the server will use for this connection. If
1323 the server does not want to use any of the given protocols,
1324 this value is set to zero. The AUTHORIZATION-DATA field is
1325 used to send back authorization protocol-dependent data to the
1326 client (such as a challenge, authentication of the server,
1333 If STATUS is Success, the following section of protocol is
1334 omitted. Otherwise, if STATUS is Continue, the server expects
1335 more authorization data from the client (i.e. the connection
1336 setup is not finished, so no requests or events may be sent):
1339 <literallayout class="monospaced">
1341 more-authorization-data: STRING8
1343 status: { Success, Continue,
1345 more-authorization-data: LISTofBYTE
1350 The values in STATUS have the same meanings as described
1351 above. This section of protocol is repeated until the server
1352 either accepts (sets STATUS to Success) or rejects (sets
1353 STATUS to Denied or Busy) the connection.
1357 Once the connection has been accepted and STATUS is Success,
1358 an implicit AccessContext is created for the authorization
1359 data and the protocol continues with the following data sent
1363 <literallayout class="monospaced">
1365 remaining-length: CARD32
1366 maximum-request-length: CARD16
1367 release-number: CARD32
1371 The REMAINING-LENGTH specifies the length in 4-byte units of
1372 the remaining data to be transmitted to the client. The
1373 MAXIMUM-REQUEST-LENGTH specifies the largest request size in
1374 4-byte units that is accepted by the server and must have a
1375 value of at least 4096. Requests with a length field larger
1376 than this value are ignored and a Length error is returned.
1377 The VENDOR string specifies the name of the manufacturer of
1378 the font server. The RELEASE-NUMBER specifies the particular
1379 release of the server in a manufacturer-dependent manner.
1383 After the connection is established and the setup information has been
1384 exchanged, the client may issue any of requests described below:
1389 <!-- .IN "NoOp" "" "@DEF@" -->
1390 <function>NoOp</function>
1396 This request does nothing. It is typically used in response
1398 <function>KeepAlive </function>
1405 <!-- .IN "ListExtensions" "" "@DEF@" -->
1406 <function>ListExtensions</function>
1414 <emphasis remap='I'>names</emphasis>: LISTofSTRING8
1420 This request returns the names of the extension packages
1421 that are supported by the server. Extension names are
1422 case-sensitive and are encoded in ISO 8859-1.
1427 <!-- .IN "QueryExtension" "" "@DEF@" -->
1428 <function>QueryExtension</function>
1433 <emphasis remap='I'>name</emphasis>: STRING8
1442 <emphasis remap='I'>present</emphasis>: BOOL
1445 <emphasis remap='I'>major-version</emphasis>: CARD16
1448 <emphasis remap='I'>minor-version</emphasis>: CARD16
1451 <emphasis remap='I'>major-opcode</emphasis>: CARD8
1454 <emphasis remap='I'>first-event</emphasis>: CARD8
1457 <emphasis remap='I'>number-events</emphasis>: CARD8
1460 <emphasis remap='I'>first-error</emphasis>: CARD8
1463 <emphasis remap='I'>number-errors</emphasis>: CARD8
1467 <function>Alloc</function>
1470 This request determines whether or not the extension package
1471 specified by NAME (encoded in ISO 8859-1) is supported by the
1472 server and that there is sufficient number of major opcode,
1473 event, and error codes available. If so, then PRESENT is set
1474 to True, MAJOR-VERSION and MINOR-VERSION are set to the
1475 respective major and minor version numbers of the protocol
1476 that the server would prefer; MAJOR-OPCODE is set to the value
1477 to use in extension requests; FIRST-EVENT is set to the value
1478 of the first extension-specific event code or zero if the
1479 extension does not have any events; NUMBER-EVENTS is set to
1480 the number of new events that the event defines; FIRST-ERROR
1481 is set to the value of the first extension-specific error code
1482 or zero if the extension does not define any new errors; and
1483 NUMBER-ERRORS is set to the number of new errors the extension
1488 Otherwise, PRESENT is set to False and the remaining fields are
1493 The server is free to return different values to different
1494 clients. Therefore, clients must use this request before
1495 issuing any of the requests in the named extension package or
1497 <function>SetEventMask request to express interest in any of</function>
1498 this extension's events. Otherwise, a
1499 <function>Request </function>
1506 <!-- .IN "ListCatalogues" "" "@DEF@" -->
1507 <function>ListCatalogues</function>
1512 <emphasis remap='I'>pattern</emphasis>: STRING8
1515 <emphasis remap='I'>max-names</emphasis>: CARD32
1524 <emphasis remap='I'>replies-following-hint</emphasis>: CARD32
1527 <emphasis remap='I'>names</emphasis>: LISTofSTRING8
1531 <function>Alloc</function>
1534 This request returns a list of at most MAX-NAMES names
1535 of collections (called catalogues) of fonts that match
1536 the specified PATTERN. In the pattern (which is encoded
1537 in ISO 8859-1), the `?' character (octal 77) matches any
1538 single character; the `*' character (octal 52) matches
1539 any series of zero or more characters; and alphabetic
1540 characters match either upper- or lowercase. The
1541 returned NAMES are encoded in ISO 8859-1 and may contain
1542 mixed character cases.
1545 If PATTERN is of zero length or MAX-NAMES is equal to zero,
1546 one reply containing a zero-length list of names is returned.
1547 This may be used to synchronize the client with the server.
1550 Servers are free to add or remove catalogues to the set returned by
1551 <function>ListCatalogues</function>
1552 between any two requests. This request is not
1553 cumulative; repeated uses are processed in isolation and do
1554 result in an iteration through the list.
1557 To reduce the amount of buffering needed by the server, the
1558 list of names may be split across several reply packets, so
1559 long as the names arrive in the same order that they would
1560 have appeared had they been in a single packet. The
1561 REPLIES-FOLLOWING-HINT field in all but the last reply
1562 contains a positive value that specifies the number of
1563 replies that are likely, but not required, to follow. In the
1564 last reply, which may contain zero or more names, this field
1571 <!-- .IN "SetCatalogues" "" "@DEF@" -->
1572 <function>SetCatalogues</function>
1576 <emphasis remap='I'>names</emphasis>: LISTofSTRING8
1580 <function>Alloc , </function>
1581 <function>Name</function>
1584 This request sets the list of catalogues whose fonts should be
1585 visible to the client. The union of the fonts provided by
1586 each of the named catalogues forms the set of fonts whose
1587 names match patterns in
1588 <function>ListFonts , </function>
1589 <function>ListFontsWithXInfo , </function>
1591 <function>OpenBitmapFont </function>
1592 requests. The catalogue names are
1593 case-insensitive and are encoded in ISO 8859-1. A zero-length
1594 list resets the client's catalogue list to the
1595 server-dependent default.
1599 If any of the catalogue names are invalid, a
1600 <function>Name </function>
1601 error is returned and the request is ignored.
1607 <!-- .IN "GetCatalogues" "" "@DEF@" -->
1608 <function>GetCatalogues</function>
1617 <emphasis remap='I'>names</emphasis>: LISTofSTRING8
1621 <function>Alloc</function>
1624 This request returns the current list of catalogue names
1625 (encoded in ISO 8859-1) associated with the client. These
1626 catalogues determine the set of fonts that are visible
1628 <function>ListFonts</function>,
1629 <function>ListFontsWithXInfo</function>,
1631 <function>OpenBitmapFont</function>.
1632 A zero-length list indicates the server's default set of
1633 fonts. Catalogue names are case-insensitive and may be
1634 returned in mixed case.
1640 <!-- .IN "SetEventMask" "" "@DEF@" -->
1641 <function>SetEventMask</function>
1646 <emphasis remap='I'>extension-opcode</emphasis>: CARD8
1649 <emphasis remap='I'>event-mask</emphasis>: EVENTMASK
1653 <function>EventMask ,</function>
1654 <function>Request</function>
1657 This request specifies the set of maskable events that the
1658 extension indicated by EXTENSION-OPCODE (or zero for the core)
1659 should generate for the client. Event masks are limited in
1660 scope to the extension (or core) for which they are defined,
1661 so expressing interest in events from one or more extensions
1662 requires multiple uses of this request.
1666 The default event mask if
1667 <function>SetEventMask </function>
1669 is zero, indicating no interest in any maskable events.
1670 Some events are not maskable and cannot be blocked.
1674 If EXTENSION-OPCODE is not a valid extension opcode previously
1676 <function>QueryExtension </function>
1678 <function>Request </function>
1680 returned. If EVENT-MASK contains any bits that do not
1681 correspond to valid events for the specified extension (or
1683 <function>EventMask</function>
1684 error is returned and the request is
1691 <!-- .IN "GetEventMask" "" "@DEF@" -->
1692 <function>GetEventMask</function>
1697 <emphasis remap='I'>extension-opcode</emphasis>: CARD8
1705 <emphasis remap='I'>event-mask</emphasis>: EVENTMASK
1709 <function>Request</function>
1712 This request returns the set of maskable core events the
1713 extension indicated by EXTENSION-OPCODE (or the core if zero)
1714 should generate for the client. Non-maskable events are
1715 always sent to the client.
1718 If EXTENSION-OPCODE is not a valid extension opcode
1719 previously returned by
1720 <function>QueryExtension </function>
1722 <function>Request</function>
1729 <!-- .IN "CreateAC" "" "@DEF@" -->
1730 <function>CreateAC</function>
1735 <emphasis remap='I'>ac</emphasis>: ACCESSCONTEXT
1738 <emphasis remap='I'>authorization-protocols</emphasis>: LISTofAUTH
1747 <emphasis remap='I'>status</emphasis>: { Success, Continue, Denied }
1750 <emphasis remap='I'>authorization-index</emphasis>: CARD8
1753 <emphasis remap='I'>authorization-data</emphasis>: LISTofBYTE
1757 <function>IDChoice</function>
1760 This request creates a new
1761 <function>AccessContext </function>
1763 server containing the specified authorization data. When
1765 <function>AccessContext</function>
1766 is selected by the client using the
1767 <function>SetAuthorization </function>
1768 request, the data may be used by the server
1769 to determine whether or not the client should be granted
1770 access to particular font information.
1774 If STATUS is Denied, the server rejects the client's
1775 authorization information and does not associate AC with any
1777 <function>AccessContext . </function>
1778 In this case, AUTHORIZATION-INDEX is set
1779 to zero, and zero bytes of AUTHORIZATION-DATA is returned.
1783 Otherwise, AUTHORIZATION-INDEX is set to the index (beginning
1784 with 1) into the AUTHORIZATION-PROTOCOLS list of the protocol
1785 that the server will use for this connection. If the server
1786 does not want to use any of the given protocols, this value is
1787 set to zero. The AUTHORIZATION-DATA field is used to send
1788 back authorization protocol-dependent data to the client (such
1789 as a challenge, authentication of the server, etc.).
1793 If STATUS is Continue, the client is expected to continue
1794 the request by sending the following protocol and receiving
1795 the indicated response from the server. This continues
1796 until STATUS is set to either Success or Denied.
1798 <literallayout class="monospaced">
1800 more-authorization-data: STRING8
1802 status: { Success, Continue, Denied }
1803 more-authorization-data: LISTofBYTE
1806 Once the connection has been accepted and STATUS is Success,
1807 the request is complete.
1810 If AC is not in the range [1..2^29-1] or is already associated
1811 with an access context, an IDChoice error is returned.
1817 <!-- .IN "FreeAC" "" "@DEF@" -->
1818 <function>FreeAC</function>
1823 <emphasis remap='I'>ac</emphasis>: ACCESSCONTEXT
1827 <function>AccessContext , </function>
1828 <function>Alloc</function>
1831 This request indicates that the specified AC should no longer
1832 be associated with a valid access context. If AC is also the
1834 <function>AccessContext</function>
1836 <function>SetAuthorization</function>
1837 request), an implicit
1838 <function>SetAuthorization</function>
1841 <function>AccessContext</function>
1842 established for the initial
1843 connection setup. Operations on fonts that were opened under
1844 AC are not affected. The client may reuse the value of AC in
1846 <function>CreateAC </function>
1850 If AC isn't associated with any valid authorization previously
1852 <function>CreateAC , an </function>
1853 <function>AccessContext </function>
1860 <!-- .IN "SetAuthorization" "" "@DEF@" -->
1861 <function>SetAuthorization</function>
1866 <emphasis remap='I'>ac</emphasis>: ACCESSCONTEXT
1870 <function>AccessContext</function>
1873 This request sets the
1874 <function>AccessContext </function>
1875 to be used for subsequent
1876 requests (except for
1877 <function>QueryXInfo</function>,
1878 <function>QueryXExtents8</function>,
1879 <function>QueryXExtents16</function>,
1880 <function>QueryXBitmaps8</function>,
1881 <function>QueryXBitmaps16</function>
1883 <function>CloseFont </function>
1884 which are done under the
1885 <function>AccessContext </function>
1888 <function>OpenBitmapFont</function>
1890 An AC of None restores the
1891 <function>AccessContext</function>
1892 established for the initial connection setup.
1896 If AC is neither None nor a value associated with a valid
1897 <function>AccessContext</function>
1898 previously created by
1899 <function>CreateAC</function>,
1901 <function>AccessContext</function>
1908 <!-- .IN "SetResolution" "" "@DEF@" -->
1909 <function>SetResolution</function>
1914 <emphasis remap='I'>resolutions</emphasis>: LISTofRESOLUTION
1918 <function>Resolution</function>,
1919 <function>Alloc</function>
1922 This request provides a hint as to the resolution and
1923 preferred point size of the drawing surfaces for which the
1924 client will be requesting fonts. The server may use this
1925 information to set the RESOLUTION_X and RESOLUTION_Y fields
1926 of scalable XLFD font names, to order sets of names based on
1927 their resolutions, and to choose the server-dependent
1928 instance that is used when a partially-specified scalable
1932 If a zero-length list of RESOLUTIONS is given, the
1933 server-dependent default value is restored. Otherwise, if
1934 elements of all of the specified RESOLUTIONS are non-zero, the
1935 default resolutions for this client are changed.
1938 If a RESOLUTION entry contains a zero, a Resolution error is
1939 returned and the default resolutions are not changed.
1944 <!-- .IN "GetResolution" "" "@DEF@" -->
1945 <function>GetResolution</function>
1952 <emphasis remap='I'>resolutions</emphasis>: LISTofRESOLUTION
1956 <function>Alloc</function>
1959 This request returns the current list of default resolutions.
1960 If a client has not performed a
1961 <function>SetResolution</function>,
1962 a server-dependent default value is returned.
1968 <!-- .IN "ListFonts" "" "@DEF@" -->
1969 <function>ListFonts</function>
1974 <emphasis remap='I'>pattern</emphasis>: STRING8
1977 <emphasis remap='I'>max-names</emphasis>: CARD32
1986 <emphasis remap='I'>replies-following-hint</emphasis>: CARD32
1989 <emphasis remap='I'>names</emphasis>: LISTofSTRING8
1993 <function>Alloc</function>
1996 This request returns a list of at most MAX-NAMES font names
1997 that match the specified PATTERN, according to matching rules
1998 of the X Logical Font Description Conventions [3]. In the
1999 pattern (which is encoded in ISO 8859-1) the `?' character
2000 (octal 77) matches any single character; the `*' character
2001 (octal 52) matches any series of zero or more characters; and
2002 alphabetic characters match either upper- or lowercase. The
2003 returned NAMES are encoded in ISO 8859-1 and may contain mixed
2004 character cases. Font names are not required to be in XLFD
2008 If PATTERN is of zero length or MAX-NAMES is equal to zero,
2009 one reply containing a zero-length list of names is returned.
2010 This may be used to synchronize the client with the server.
2013 Servers are free to add or remove fonts to the set returned by
2014 <function>ListFonts </function>
2015 between any two requests. This request is not
2016 cumulative; repeated uses are processed in isolation and do
2017 result in an iteration through the list.
2020 To reduce the amount of buffering needed by the server, the
2021 list of names may be split across several reply packets, so
2022 long as the names arrive in the same order that they would
2023 have appeared had they been in a single packet. The
2024 REPLIES-FOLLOWING-HINT field in all but the last reply
2025 contains a positive value that specifies the number of
2026 replies that are likely, but not required, to follow. In the
2027 last reply, which may contain zero or more names, this field
2034 <!-- .IN "ListFontsWithXInfo" "" "@DEF@" -->
2035 <function>ListFontsWithXInfo</function>
2040 <emphasis remap='I'>pattern</emphasis>: STRING8
2043 <emphasis remap='I'>pattern</emphasis>: STRING8
2046 <emphasis remap='I'>pattern</emphasis>: STRING8
2049 <emphasis remap='I'>max-names</emphasis>: CARD32
2059 <emphasis remap='I'>replies-following-hint</emphasis>: CARD32
2062 <emphasis remap='I'>info</emphasis>: XFONTINFO
2065 <emphasis remap='I'>name</emphasis>: STRING8
2069 <function>Alloc</function>
2072 This request is similar to
2073 <function>ListFonts </function>
2074 except that a separate
2075 reply containing the name, header, and property data is
2076 generated for each matching font name. Following these
2077 replies, if any, a final reply containing a zero-length NAME
2078 and no INFO is sent.
2082 The REPLIES-FOLLOWING-HINT field in all but the last reply
2083 contains a positive value that specifies the number of replies
2084 that are likely, but not required, to follow. In the last
2085 reply, this field is set to zero.
2089 If PATTERN is of zero length or if MAX-NAMES is equal to
2090 zero, only the final reply containing a zero-length NAME and
2091 no INFO is returned. This may be used to synchronize the
2092 client with the server.
2098 <!-- .IN "OpenBitmapFont" "" "@DEF@" -->
2099 <function>OpenBitmapFont</function>
2104 <emphasis remap='I'>fontid</emphasis>: FONTID
2107 <emphasis remap='I'>pattern</emphasis>: STRING8
2110 <emphasis remap='I'>format-mask</emphasis>: BITMAPFORMATMASK
2113 <emphasis remap='I'>format-hint</emphasis>: BITMAPFORMAT
2122 <emphasis remap='I'>otherid</emphasis>: FONTID or None
2125 <emphasis remap='I'>otherid-valid</emphasis>: BOOL
2128 <emphasis remap='I'>cachable</emphasis>: BOOL
2132 <function>IDChoice</function>,
2133 <function>Name</function>,
2134 <function>Format</function>,
2135 <function>AccessContext</function>,
2136 <function>Alloc</function>
2139 This request looks for a server-dependent choice of the
2140 font names that match the specified PATTERN according to the
2142 <function>ListFonts . </function>
2143 If no matches are found, a
2144 <function>Name </function>
2145 error is returned. Otherwise, the server attempts to
2146 open the font associated with the chosen name.
2149 Permission to access the font is determined by the server
2150 according the licensing policy used for this font. The server
2151 may use the client's current
2152 <function>AccessContext</function>
2155 <function>SetAuthorization </function>
2156 request or the original connection
2157 setup) to determine any client-specific sets of permissions.
2158 After the font has been opened, the client is allowed to
2160 <function>AccessContext</function>
2162 <function>SetAuthorization</function>
2165 <function>AccessContext</function>
2167 <function>FreeAC</function>
2169 <function>QueryXInfo</function>,
2170 <function>QueryXExtents8</function>,
2171 <function>QueryXExtents16</function>,
2172 <function>QueryXBitmaps8</function>,
2173 <function>QueryXBitmaps16</function>
2175 <function>CloseFont</function>
2176 requests on this FONTID are
2177 performed according to permissions granted at the time of the
2178 <function>OpenBitmapFont</function>
2182 If the server is willing and able to detect that the client
2183 has already opened the font successfully (possibly under a
2184 different name), the OTHERID field may be set to one of the
2185 identifiers previously used to open the font. The
2186 OTHERID-VALID field indicates whether or not OTHERID is
2187 still associated with an open font: if it is True, the
2188 client may use OTHERID as an alternative to FONTID.
2189 Otherwise, if OTHERID-VALID is False, OTHERID is no longer
2190 open but has not been reused by a subsequent
2191 <function>OpenBitmapFont</function>
2196 If OTHERID is set to None, then OTHERID-VALID should be set
2201 The FORMAT-MASK indicates which fields in FORMAT-HINT
2202 the client is likely to use in subsequent
2203 <function>GetXBitmaps8</function>
2205 <function>GetXBitmaps16 </function>
2206 requests. Servers may wish to use
2207 this information to precompute certain values.
2211 If CACHABLE is set to True, the client may cache the font
2212 (so that redundant opens of the same font may be avoided)
2214 <function>AccessContexts </function>
2215 during the life of the
2216 client without violating the font's licensing policy. This
2217 flag is typically set whenever a font is unlicensed or is
2218 licensed on a per-display basis. If CACHABLE is False, the
2219 client should reopen the font for each
2220 <function>AccessContext .</function>
2224 The server is permitted to add to or remove from the set of
2226 <function>ListFonts </function>
2227 between any two requests, though
2228 mechanisms outside the protocol. Therefore, it is possible
2229 for this request (which is atomic) to return a different font
2230 than would result from separate a
2231 <function> ListFonts </function>
2233 <function>OpenBitmapFont </function>
2234 with a non-wildcarded font name.
2238 If FONTID is not in the range [1..2^29-1] or if it is already
2239 associated with an open font, an
2240 <function>IDChoice </function>
2242 If no font is available that matches the specified PATTERN, a
2243 <function>Name </function>
2244 error is returned. If the font is present but the client
2245 is not permitted access, an
2246 <function>AccessContext </function>
2248 If FORMAT-MASK has any unspecified bits set or if any of the
2249 fields in FORMAT-HINT indicated by FORMAT-MASK are invalid, a
2250 <function>Format </function>
2257 <!-- .IN "QueryXInfo" "" "@DEF@" -->
2258 <function>QueryXInfo</function>
2263 <emphasis remap='I'>fontid</emphasis>: FONTID
2271 <emphasis remap='I'>info</emphasis>: XFONTINFO
2275 <function>Font</function>,
2276 <function>Alloc</function>
2279 This request returns the font header and property information
2280 for the open font associated with FONTID.
2284 If FONTID is not associated with any open fonts, a
2285 <function> Font </function>
2293 <!-- .IN "QueryXExtents8" "" "@DEF@" -->
2294 <function>QueryXExtents8</function>
2299 <emphasis remap='I'>fontid</emphasis>: FONTID
2302 <emphasis remap='I'>range</emphasis>: BOOL
2306 <emphasis remap='I'>chars</emphasis>: STRING8
2314 <emphasis remap='I'>extents</emphasis>: LISTofXCHARINFO
2318 <function>Font</function>,
2319 <function>Range</function>,
2320 <function>Alloc</function>
2323 This request is equivalent to
2324 <function>QueryXExtents16 </function>
2326 uses 1-byte character codes.
2332 <!-- .IN "QueryXExtents16" "" "@DEF@" -->
2333 <function>QueryXExtents16</function>
2337 <emphasis remap='I'>fontid</emphasis>: FONTID
2341 <emphasis remap='I'>range</emphasis>: BOOL
2345 <emphasis remap='I'>chars</emphasis>: LISTofCHAR2B
2353 <emphasis remap='I'>extents</emphasis>: LISTofXCHARINFO
2357 <function>Font</function>,
2358 <function>Range</function>,
2359 <function>Alloc</function>
2362 This request returns a list of glyph extents from the open
2363 font associated with FONTID for the series of characters
2364 specified by RANGE and CHARS.
2368 If RANGE is True, each succeeding pair of elements in CHARS is
2369 treated as a range of characters for which extents should be
2370 returned. If CHARS contains an odd number of elements, the
2371 font's XFONTINFO.CHAR-RANGE.MAX-CHAR is implicitly appended to
2372 the list. If CHARS contains no elements, the list is
2373 implicitly replaced with the font's XFONTINFO.CHAR-RANGE. If
2374 any of the resulting character ranges are invalid, a Range
2375 error is returned. Otherwise, the character ranges are
2376 concatenated in the order given by CHARS to produce a set of
2377 character codes for which extents are returned.
2381 If RANGE is False, then CHARS specifies the set of character
2382 codes for which extents are returned. If CHARS is of
2383 zero length, then a zero-length list of extents is returned.
2387 The extents for each character code in the resulting set (which
2388 may contain duplicates) are returned in the order in
2389 which the character codes appear in the set.
2390 At least one metric for each character shall be non-zero
2391 unless the character is not encoded in the font, in which case
2392 all-zero metrics are returned.
2393 A blank, zero-width character can be encoded
2394 with non-zero but equal left and right bearings.
2398 If FONTID is not associated with any open fonts, a
2399 <function>Font</function>
2401 returned. If RANGE is True and CHARS contains any invalid
2403 <function>Range</function>
2410 <!-- .IN "QueryXBitmaps8" "" "@DEF@" -->
2411 <function>QueryXBitmaps8</function>
2416 <emphasis remap='I'>fontid</emphasis>: FONTID
2419 <emphasis remap='I'>range</emphasis>: BOOL
2422 <emphasis remap='I'>chars</emphasis>: STRING8
2425 <emphasis remap='I'>format</emphasis>: BITMAPFORMAT
2434 <emphasis remap='I'>replies-following-hint</emphasis>: CARD32
2438 <emphasis remap='I'>offsets</emphasis>: LISTofOFFSET32
2442 <emphasis remap='I'>bitmaps</emphasis>: LISTofBYTE
2446 <function>Font</function>,
2447 <function>Range</function>,
2448 <function>Format</function>,
2449 <function>Alloc</function>
2452 This request is equivalent to
2453 <function>QueryXBitmaps16 </function>
2455 uses 1-byte character codes.
2460 <!-- .IN "QueryXBitmaps16" "" "@DEF@" -->
2461 <function>QueryXBitmaps16</function>
2466 <emphasis remap='I'>fontid</emphasis>: FONTID
2470 <emphasis remap='I'>range</emphasis>: BOOL
2474 <emphasis remap='I'>chars</emphasis>: LISTofCHAR2B
2478 <emphasis remap='I'>format</emphasis>: BITMAPFORMAT
2486 <emphasis remap='I'>replies-following-hint</emphasis>: CARD32
2490 <emphasis remap='I'>offsets</emphasis>: LISTofOFFSET32
2494 <emphasis remap='I'>bitmaps</emphasis>: LISTofBYTE
2498 <function>Font</function>,
2499 <function>Range</function>,
2500 <function>Format</function>,
2501 <function>Alloc</function>
2504 This request returns a list of glyph bitmaps from the open
2505 font associated with FONTID for the series of characters
2506 specified by RANGE and CHARS.
2510 If RANGE is True, each succeeding pair of elements in CHARS is
2511 treated as a range of characters for which bitmaps should be
2512 returned. If CHARS contains an odd number of elements, the
2513 font's XFONTINFO.CHAR-RANGE.MAX-CHAR is implicitly appended to
2514 the list. If CHARS contains no elements, the list is
2515 implicitly replaced with the font's XFONTINFO.CHAR-RANGE. If
2516 any of the resulting character ranges are invalid, a Range
2517 error is returned. Otherwise, the character ranges are
2518 concatenated in the order given by CHARS to produce a set of
2519 character codes for which bitmaps are returned.
2523 If RANGE is False, then CHARS specifies the set of character
2524 codes for which bitmaps are returned. If CHARS is of zero
2525 length, then a single reply containing a zero-length list of
2526 offsets and bitmaps is returned.
2530 If any of the resulting character ranges are invalid, a Range
2531 error is returned. Otherwise, the resulting character ranges
2532 are concatenated in the order given by CHARS to produce a set
2533 of character codes for which bitmaps are returned.
2537 The server is free to return the glyph bitmaps in multiple
2538 replies to reduce the amount of buffering that is necessary.
2539 In this situation, the set of characters obtained above is
2540 partitioned into an implementation-dependent number of
2541 ordered, non-overlapping subsets containing runs of one or
2542 more consecutive characters. The global ordering of
2543 characters must be maintained such that concatenating the
2544 subsets in order that they were produced yields the original
2545 set. A reply is generated for each subset, in the order that
2550 For each character in a subset, an image of that character's
2551 glyph is described by a rectangle of bits corresponding to the
2552 pixels specified by FORMAT.IMAGE-RECT. Within the image, set
2553 and clear bits represent inked and non-inked pixels,
2558 Each scanline of a glyph image, from top to bottom, is zero-padded
2559 on the right to a multiple of the number of bits specified by
2560 FORMAT.SCANLINE-PAD. The scanline is then divided from left
2561 to right into a sequence of FORMAT.SCANLINE-UNIT bits. The
2562 bits of each unit are then arranged such that the left-most
2563 pixel is stored in the most- or least-significant bit,
2564 according to FORMAT.BIT-ORDER-MSB. The bytes of each unit are
2565 then arranged such that the most- or least-significant byte,
2566 according to FORMAT.BYTE-ORDER-MSB, is transmitted first.
2567 Finally, the units are arranged such that the left-most is
2568 transmitted first and the right-most is transmitted last.
2572 The individual images within a subset are then concatenated in
2573 a server-dependent order to form the BITMAPS data of the
2574 reply. If a glyph image is duplicated within a reply, the
2575 server is free to return fewer (but at least one) copies of
2576 the image. If a character is not encoded within the font, a
2577 zero-length bitmap is substituted for this character. Each
2578 glyph image must begin at a bit position that is a multiple of
2579 the FORMAT.SCANLINE-UNIT.
2583 The OFFSETS array in a reply contains one entry for each
2584 character in the subset being returned, in the order that the
2585 characters appear in the subset. Each entry specifies the
2586 starting location in bytes and size in bytes of the
2587 corresponding glyph image in the BITMAPS data of that reply
2588 (i.e. an offset may not refer to data in another reply).
2592 The REPLIES-FOLLOWING-HINT field in all but the last reply
2593 contains a positive value that specifies the number of replies
2594 that are likely, but not required, to follow. In the last
2595 reply, which may contain data for zero or more characters,
2596 this field is set to zero.
2600 If FONTID is not associated with any open fonts, a Font error
2601 is returned. If RANGE is True and CHARS contains any invalid
2602 ranges, a Range error is returned. If FORMAT is invalid, a
2603 Format error is returned.
2608 <!-- .IN "CloseFont" "" "@DEF@" -->
2609 <function>CloseFont</function>
2614 <emphasis remap='I'>fontid</emphasis>: FONTID
2618 <function>Font</function>,
2619 <function>Alloc</function>
2622 This request indicates that the specified FONTID should no
2623 longer be associated with an open font. The server is free to
2624 release any client-specific storage or licenses allocated for
2625 the font. The client may reuse the value of FONTID in a
2627 <function>OpenBitmapFont </function>
2632 If FONTID is not associated with any open fonts, a
2633 <function> Font </function>
2640 <function>"close connection"</function>
2641 <!-- .IN "close connection" "" "@DEF@" -->
2646 When a connection is closed, a
2647 <function>CloseFont </function>
2648 is done on all fonts
2649 that are open on the connection. In addition, the server is
2650 free to release any storage or licenses allocated on behalf of
2651 the client that made the connection.
2657 <title>Errors</title>
2662 All errors are at least 16 bytes long and contain the following fields:
2666 <emphasis remap='I'>type</emphasis>: CARD8 value of 1
2670 <emphasis remap='I'>error-code</emphasis>: CARD8
2674 <emphasis remap='I'>sequence-number</emphasis>: CARD16
2678 <emphasis remap='I'>length</emphasis>: CARD32
2682 <emphasis remap='I'>timestamp</emphasis>: TIMESTAMP
2686 <emphasis remap='I'>major-opcode</emphasis>: CARD8
2690 <emphasis remap='I'>minor-opcode</emphasis>: CARD8
2694 <emphasis remap='I'>data-or-unused</emphasis>: CARD16
2699 The TYPE field has a value of one. The ERROR-CODE field specifies which error
2700 occurred. Core errors codes are in the range 0 through 127, extension error
2701 codes are in the range 128 through 255. The SEQUENCE-NUMBER field contains the
2702 least significant 16 bits of the sequence number of the request that caused the
2703 error. The LENGTH field specifies the length of the error packet in 4-byte
2704 units and must have a value of at least 4. The TIMESTAMP specifies the server
2705 time when the error occurred. The MAJOR-OPCODE and MINOR-OPCODE (zero for core
2706 requests) fields specify the type of request that generated the error. The
2707 DATA-OR-UNUSED field may be used for 16 bits of error-specific information. If
2708 LENGTH is greater than four, these fields are followed by (LENGTH - 4) * 4
2709 bytes of extra data.
2713 The following errors are defined for the core protocol:
2717 <!-- .IN "Error Codes" "Request" "@DEF@" -->
2718 <function>Request</function>
2723 <emphasis remap='I'>data-or-unused</emphasis>: CARD16 unused
2726 This error is generated by any request that has an unknown
2727 combination of major and minor request numbers, or by any
2728 extension request that is issued before a
2729 <function>QueryExtension </function>
2736 <!-- .IN "Error Codes" "Format" "@DEF@" -->
2737 <function>Format</function>
2742 <emphasis remap='I'>data-or-unused</emphasis>: CARD16 unused
2745 <emphasis remap='I'>format</emphasis>: BITMAPFORMAT bad format value
2748 This error is generated by the use of an invalid BITMAPFORMAT
2750 <function>OpenBitmapFont</function>,
2751 <function>QueryXBitmaps8</function>, and
2752 <function>QueryXBitmaps16</function>
2754 The value that caused the error is included as extra data.
2760 <!-- .IN "Error Codes" "Font" "@DEF@" -->
2761 <function>Font</function>
2765 <emphasis remap='I'>data-or-unused</emphasis>: CARD16 unused
2768 <emphasis remap='I'>fontid</emphasis>: FONTID bad font identifier
2771 This error is generated by an invalid FONTID in the
2772 <function>QueryXInfo</function>,
2773 <function>QueryXExtents8</function>,
2774 <function>QueryXExtents16</function>,
2775 <function>QueryXBitmaps8</function>,
2776 <function>QueryXBitmaps16</function>
2778 <function>CloseFont </function>
2779 requests. The value that caused
2780 the error is included as extra data.
2786 <!-- .IN "Error Codes" "Range" "@DEF@" -->
2787 <function>Range</function>
2792 <emphasis remap='I'>data-or-unused</emphasis>: CARD16 unused
2795 <emphasis remap='I'>range</emphasis>: RANGE bad range
2798 This error is generated by an invalid RANGE in the
2799 <function> QueryXExtents8</function>,
2800 <function>QueryXExtents16</function>,
2801 <function>QueryXBitmaps8</function>
2803 <function>QueryXBitmaps16 </function>
2805 value that caused the error is included as extra data.
2810 <!-- .IN "Error Codes" "EventMask" "@DEF@" -->
2811 <function>EventMask</function>
2816 <emphasis remap='I'>data-or-unused</emphasis>: CARD16 unused
2820 <emphasis remap='I'>event-mask</emphasis>: EVENTMASK bad event mask
2823 This error is generated by an invalid EVENTMASK in the
2824 <function>SetEventMask </function>
2825 request. The value that caused the error is
2826 included as extra data.
2831 <!-- .IN "Error Codes" "AccessContext" "@DEF@" -->
2832 <function>AccessContext</function>
2837 <emphasis remap='I'>data-or-unused</emphasis>: CARD16 unused
2840 <emphasis remap='I'>ac</emphasis>: ACCESSCONTEXT unaccepted
2841 <function>AccessContext</function>
2844 This error is generated by an invalid ACCESSCONTEXT in the
2845 <function>FreeAC </function>
2847 <function>SetAuthorization </function>
2849 <function>OpenBitmapFont</function>
2850 request performed without sufficient authorization. In the
2851 first two cases, the ACCESSCONTEXT of the errant request is
2852 returned as extra data. In the third case, the current
2853 ACCESSCONTEXT is returned as extra data.
2858 <!-- .IN "Error Codes" "IDChoice" "@DEF@" -->
2859 <function>IDChoice</function>
2864 <emphasis remap='I'>data-or-unused</emphasis>: CARD16 unused
2867 <emphasis remap='I'>id</emphasis>: ID bad identifier
2870 This error is generated by an invalid or already associated
2871 ACCESSCONTEXT identifier in a
2872 <function>CreateAC </function>
2873 request or FONTID identifier
2875 <function>OpenBitmapFont </function>
2876 request. The value that caused the error
2877 is included as extra data.
2882 <!-- .IN "Error Codes" "Name" "@DEF@" -->
2883 <function>Name</function>
2888 <emphasis remap='I'>data-or-unused</emphasis>: CARD16 unused
2891 This error is generated by a font name pattern that matches
2893 <function>OpenBitmapFont </function>
2894 request or no catalogue names in a
2895 <function>SetCatalogues </function>
2902 <!-- .IN "Error Codes" "Resolution" "@DEF@" -->
2903 <function>Resolution</function>
2908 <emphasis remap='I'>data-or-unused</emphasis>: CARD16 X value of errant resolution
2912 <emphasis remap='I'>y-resolution</emphasis>: CARD16 Y value of errant resolution
2916 <emphasis remap='I'>point-size</emphasis>: CARD16 point size of errant resolution
2919 This error is generated in response to an invalid RESOLUTION
2921 <function>SetResolution </function>
2922 request. The value that caused the
2923 error is included in the DATA-OR-UNUSED field and as extra data.
2929 <!-- .IN "Error Codes" "Alloc" "@DEF@" -->
2930 <function>Alloc</function>
2935 <emphasis remap='I'>data-or-unused</emphasis>: CARD16 unused
2938 This error is generated by any request for which the server
2939 lacks sufficient resources (especially memory).
2945 <!-- .IN "Error Codes" "Length" "@DEF@" -->
2946 <function>Length</function>
2951 <emphasis remap='I'>data-or-unused</emphasis>: CARD16 unused
2954 <emphasis remap='I'>length</emphasis>: CARD32 bad length value
2957 This error is generated by any request that has a length field
2958 greater than (MAXIMUM-REQUEST-LENGTH * 4) bytes. The value that
2959 caused the error is included as extra data.
2964 <!-- .IN "Error Codes" "Implementation" "@DEF@" -->
2965 <function>Implementation</function>
2970 <emphasis remap='I'>data-or-unused</emphasis>: CARD16 unused
2973 This error may be generated in response to any request that
2974 the server is unable to process because it is deficient. Use
2975 of this error is highly discouraged and indicates lack of
2976 conformance to the protocol.
2978 Additional errors may be defined by extensions.
2984 <title>Events</title>
2990 Events may be generated in response to requests or at the server's discretion
2991 after the initial connection setup information has been exchanged. Each event
2992 is at least 12 bytes long and contains the following fields:
2996 <!-- .TA .75i .75i .75i .75i -->
2997 <emphasis remap='I'>type</emphasis>: CARD8 value of 2
3001 <emphasis remap='I'>event-code</emphasis>: CARD8
3005 <emphasis remap='I'>sequence-number</emphasis>: CARD16
3009 <emphasis remap='I'>length</emphasis>: CARD32
3013 <emphasis remap='I'>timestamp</emphasis>: TIMESTAMP
3018 The TYPE field contains the value 2. The EVENT-CODE field specifies the number
3019 of the event and is in the range 0-127 for core events or the range 128-255 for
3020 extensions. The SEQUENCE-NUMBER field specifies the least significant 16 bits
3021 of the sequence number of the last request to have been processed by the
3022 server. The LENGTH field specifies the number of 4-byte units in this event
3023 packet and must always have a value of at least 3. The TIMESTAMP field
3024 specifies the server time when the event occurred. If LENGTH is greater than
3025 three, these fields are followed by (LENGTH - 3) * 4 bytes of additional data.
3029 Events are described using the following syntax:
3031 <literallayout class="monospaced">
3032 <function>EventName</function>
3033 <emphasis remap='I'>arg1</emphasis>: type1
3035 <emphasis remap='I'>argN</emphasis>: typeN
3041 If an event does not provide any extra arguments, the
3042 <emphasis remap='I'>arg1</emphasis>...<emphasis remap='I'>argN</emphasis>
3043 lines are omitted from the description.
3047 The core X Font Service protocol defines the following events:
3051 <!-- .IN "KeepAlive" "" "@DEF@" -->
3052 <function>KeepAlive</function>
3056 This unsolicited, nonmaskable event may be sent by the
3057 server to verify that the connection has not been broken
3058 (for transports that do not provide this information).
3059 Clients should acknowledge receipt of this request
3060 by sending any request (such as
3061 <function>NoOp</function>
3068 <!-- .IN "CatalogueListNotify" "" "@DEF@" -->
3069 <function>CatalogueListNotify</function>
3073 <emphasis remap='I'>added</emphasis>: BOOL
3076 <emphasis remap='I'>deleted</emphasis>: BOOL
3079 This event is sent to clients that have included
3080 <function>CatalogueListChangeMask </function>
3081 in their core event mask
3082 whenever the list of catalogues that are available has
3083 changed. The ADDED field is True if new catalogues have
3084 been added to the server, otherwise it is False. The
3085 DELETED field is True if any existing catalogues have
3086 been removed from the server, otherwise it is False.
3091 <!-- .IN "FontListNotify" "" "@DEF@" -->
3092 <function>FontListNotify</function>
3096 <emphasis remap='I'>added</emphasis>: BOOL
3100 <emphasis remap='I'>deleted</emphasis>: BOOL
3103 This event is sent to clients that have included
3104 <function>FontListChangeMask </function>
3105 in their event mask whenever the
3106 list of fonts that are provided by the currently selected
3107 catalogues has changed. The ADDED field is True if new
3108 fonts have been added to any of the catalogues currently
3109 used by the client, otherwise it is False. The DELETED
3110 field is True if any existing fonts have been removed
3111 from any of catalogues used by the client, otherwise it
3116 Additional events may be defined by extensions.
3122 <sect1 id="protocol_encoding">
3123 <title>Protocol Encoding</title>
3125 <!-- (SN Protocol Encoding -->
3129 Numbers that are prefixed with "#x" are in hexadecimal (base 16). All other
3130 numbers are in decimal. Requests, replies, errors, events, and compound types
3131 are described using the syntax:
3134 <literallayout class="monospaced">
3137 <emphasis remap='I'>count</emphasis> <emphasis remap='I'>contents</emphasis> <emphasis remap='I'>name</emphasis>
3139 <emphasis remap='I'>count</emphasis> <emphasis remap='I'>contents</emphasis> <emphasis remap='I'>name</emphasis>
3144 where COUNT is the number of bytes in the data stream occupied by this
3145 field, CONTENTS is the name of the type as given in Section 4 or the value if
3146 this field contains a constant, and NAME is a description of this field.
3150 Objects containing counted lists use a lowercase single-letter variable (whose
3151 scope is limited to the request, reply, event, or error in which it is found)
3152 to represent the number of objects in the list. These variables, and any
3153 expressions in which they are used, should be treated as unsigned integers.
3154 Multiple copies of an object are indicated by CONTENTS prefix "LISTof".
3158 Unused bytes (whose value is undefined) will have a blank CONTENTS field and a
3159 NAME field of "unused". Zeroed bytes (whose value must be zero) will have a
3160 blank CONTENTS field and a NAME field of "zero". The expression pad(e)
3161 refers to the number of bytes needed to round a value "e" up to the closed
3165 <literallayout class="monospaced">
3167 pad(e) = (4 - (e mod 4)) mod 4
3170 <sect2 id="data_types_2">
3171 <title>Data Types</title>
3173 <!-- (SN Data Types -->
3176 <literallayout class="monospaced">
3179 4 CARD32 access context with at least one of the following bits set:
3183 but none of the following bits set:
3192 p unused, p=pad(n+2)
3206 4 CARD32 value, union of the following bits:
3207 #x00000001 ByteOrderMSB
3208 #x00000002 BitOrderMSB
3209 #x00000000 ImageRectMin
3210 #x00000004 ImageRectMaxWidth
3211 #x00000008 ImageRectMax
3212 #x00000000 ScanlinePad8
3213 #x00000100 ScanlinePad16
3214 #x00000200 ScanlinePad32
3215 #x00000300 ScanlinePad64
3216 #x00000000 ScanlineUnit8
3217 #x00001000 ScanlineUnit16
3218 #x00002000 ScanlineUnit32
3219 #x00003000 ScanlineUnit64
3221 except for the following bits which must be zero:
3225 and the following of which at most one bit may be set:
3227 #x0000000c at most one bit can be set
3232 4 CARD32 value, mask of the following bits:
3234 #x00000001 ByteOrderMask
3235 #x00000002 BitOrderMask
3236 #x00000004 ImageRectMask
3237 #x00000008 ScanlinePadMask
3238 #x00000010 ScanlineUnitMask
3240 except for the following bits which must be zero:
3246 1 BOOL boolean, one of the following values:
3251 1 BYTE unsigned byte of data
3254 1 CARD8 8-bit unsigned integer
3257 2 CARD16 16-bit unsigned integer
3260 4 CARD32 32-bit unsigned integer
3268 for core events, this is union of the following bits:
3270 #00000001 CatalogueListChangeMask
3271 #00000002 FontListChangeMask
3273 but none of the following bits set:
3277 extensions define their own sets of bits
3281 4 CARD32 font identifier with at least one of
3282 the following bits set:
3286 but none of the following bits set:
3291 1 INT8 8-bit signed integer
3294 2 INT16 16-bit signed integer
3297 4 INT32 32-bit signed integer
3300 4 CARD32 position (or integer value)
3304 4 n number of PROPOFFSET components
3305 4 m number of bytes of property data
3306 20*n PROPOFFSET property offsets into data block
3307 m LISTofBYTE property data block
3310 8 OFFSET32 name in data block
3311 8 OFFSET32 value in data block
3313 1 CARD8 type, one of the following values:
3320 2 CHAR2B minimum character code
3321 2 CHAR2B maximum character code
3324 2 CARD16 x resolution in pixels per inch
3325 2 CARD16 y resolution in pixels per inch
3326 2 CARD16 point size in decipoints
3333 n LISTofBYTE array of 8-bit character values
3336 4 CARD32 milliseconds since server time origin
3339 2 INT16 left bearing
3340 2 INT16 right bearing
3347 4 CARD32 flags, union of the following bits:
3348 #x00000001 AllCharactersExist
3349 #x00000002 InkInside
3350 #x00000004 HorizontalOverlap
3352 but none of the following bits set:
3355 4 RANGE range of characters in font
3356 1 CARD8 drawing direction
3360 2 CHAR2B default character
3361 12 XCHARINFO minimum bounds
3362 12 XCHARINFO maximum bounds
3364 2 INT16 font descent
3365 n PROPINFO property data
3369 <sect2 id="requests_2">
3370 <title>Requests</title>
3371 <para><emphasis role="bold">open connection</emphasis></para>
3372 <literallayout class="monospaced">
3373 1 BYTE byteorder, one of the values:
3374 #x42 MostSignificant Byte first
3375 #x6c LeastSignificant Byte first
3376 1 CARD8 numberof auth in auth-data
3377 2 2 client-major-protocol-version
3378 2 0 client-minor-protocol-version
3379 2 a/4 lengthof auth-data
3380 a LISTofAUTH auth-data
3389 1 CARD8 numberof alternate-servers-hint
3390 1 CARD8 authorization-index
3391 2 a/4 lengthof alternate-servers-hint
3392 2 (d+q)/4 lengthof authorization-data
3393 a LISTofALTERNATESERVER alternate-servers-hint
3394 d LISTofBYTE authorization-data
3399 If STATUS is Busy or Denied, the protocol stops and the connection is
3400 closed. If STATUS is Continue, the client is expected to respond with
3401 additional data, to which the server responds with
3402 a new status value and more data. This dialog continues until the status
3403 is set to Success, or until the server sets STATUS to Busy or Denied
3404 and closes the connection:
3407 <literallayout class="monospaced">
3410 d LISTofBYTE more-authorization-data
3420 d LISTofBYTE more-authorization-data
3424 When STATUS is Success, the protocol resumes with the following
3428 <literallayout class="monospaced">
3429 4 3+(v+w)/4 length of rest of data
3430 2 CARD16 maximum-request-length
3431 2 v length of vendor string
3432 4 CARD32 release-number
3433 v STRING8 vendor-string
3437 Once the connection has been established, the client may send the
3441 <literallayout class="monospaced">
3442 <emphasis role="bold">NoOp</emphasis>
3447 <emphasis role="bold">ListExtensions</emphasis>
3453 1 CARD8 numberof names
3454 2 CARD16 sequence-number
3456 n LISTofSTRNAME names
3459 <emphasis role="bold">QueryExtension</emphasis>
3468 2 CARD16 sequence-number
3470 2 CARD16 major-version
3471 2 CARD16 minor-version
3472 1 CARD8 major-opcode
3474 1 CARD8 number-events
3476 1 CARD8 number-errors
3479 <emphasis role="bold">ListCatalogues</emphasis>
3484 2 n length of pattern
3491 2 CARD16 sequence-number
3493 4 CARD32 replies-following-hint
3494 4 CARD32 numberof catalogue-names
3495 n LISTofSTRNAME catalogue-names
3498 <emphasis role="bold">SetCatalogues</emphasis>
3500 1 CARD8 numberof catalogue-names
3502 n LISTofSTRNAME catalogue-names
3505 <emphasis role="bold">GetCatalogues</emphasis>
3511 1 CARD8 numberof catalogue-names
3512 2 CARD16 sequence-number
3514 n LISTofSTRNAME catalogue-names
3517 <emphasis role="bold">SetEventMask</emphasis>
3519 1 CARD8 extension-opcode
3521 4 EVENTMASK event-mask
3523 <emphasis role="bold">GetEventMask</emphasis>
3525 1 CARD8 extension-opcode
3530 2 CARD16 sequence-number
3532 4 EVENTMASK event-mask
3534 <emphasis role="bold">CreateAC</emphasis>
3536 1 CARD8 numberof authorization-protocols
3539 a LISTofAUTH authorization-protocols
3542 1 CARD8 authorization-index
3543 2 CARD16 sequence-number
3551 d LISTofBYTE authorization-data
3556 If STATUS is Continue, the client is expected to respond with additional
3557 data, to which the server
3558 responds with a new status value and more data. This dialog continues
3559 until the status is set to
3560 Success, Busy, or Denied at which point the request is finished.
3563 <literallayout class="monospaced">
3566 d LISTofBYTE more-authorization-data
3576 d LISTofBYTE authorization-data
3579 <emphasis role="bold">FreeAC</emphasis>
3585 <emphasis role="bold">SetAuthorization</emphasis>
3591 <emphasis role="bold">SetResolution</emphasis>
3593 1 n number of resolutions
3594 2 1+(6*n+p)/4 length
3595 6*n LISTofRESOLUTION resolutions
3598 <emphasis role="bold">GetResolution</emphasis>
3604 1 n number of resolutions
3605 2 CARD16 sequence-number
3606 4 2+(6*n+p)/4 length
3607 6*n LISTofRESOLUTION resolutions
3610 <emphasis role="bold">ListFonts</emphasis>
3615 2 n length of pattern
3622 2 CARD16 sequence-number
3624 4 CARD32 replies-following-hint
3625 4 CARD32 numberof font-names
3626 n LISTofSTRNAME font-names
3629 <emphasis role="bold">ListFontsWithXInfo</emphasis>
3634 2 n length of pattern
3638 =>+(except for last in series)
3641 2 CARD16 sequence-number
3642 4 3+(n+p+f)/4 length
3643 4 CARD32 replies-hint
3644 f XFONTINFO fontinfo
3649 1 0 last-reply indicator
3650 2 CARD16 sequence-number
3653 <emphasis role="bold">OpenBitmapFont</emphasis>
3658 4 BITMAPFORMATMASK format-mask
3659 4 BITMAPFORMAT format
3664 1 BOOL otherid-valid
3665 2 CARD16 sequence-number
3671 <emphasis role="bold">QueryXInfo</emphasis>
3679 2 CARD16 sequence-number
3681 f XFONTINFO fontinfo
3684 <emphasis role="bold">QueryXExtents8</emphasis>
3689 4 n number chars entries
3695 2 CARD16 sequence-number
3697 4 n number of extents
3698 12*n LISTofXCHARINFO extents
3700 <emphasis role="bold">QueryXExtents16</emphasis>
3703 2 3+(2*n+p)/4 length
3705 4 n number chars entries
3706 2*n LISTofCHAR2B chars
3707 p unused, p=pad(2*n)
3711 2 CARD16 sequence-number
3713 4 n number of extents
3714 12*n LISTofXCHARINFO extents
3716 <emphasis role="bold">QueryXBitmaps8</emphasis>
3721 4 BITMAPFORMAT format
3722 4 n number of chars entries
3728 2 CARD16 sequence-number
3729 4 5+2*n+(m+p)/4 length
3730 4 CARD32 replies-following-hint
3731 4 n number of offsets
3732 4 m number of bytes of glyph images
3733 8*n LISTofOFFSET32 offsets
3734 m LISTofBYTE glyphimages
3737 <emphasis role="bold">QueryXBitmaps16</emphasis>
3740 2 4+(2*n+p)/4 length
3742 4 BITMAPFORMAT format
3743 4 n number of chars entries
3744 2*n LISTofCHAR2B chars
3745 p unused, p=pad(2*n)
3749 2 CARD16 sequence-number
3750 4 5+2*n+(m+p)/4 length
3751 4 CARD32 replies-following-hint
3752 4 n number of offsets
3753 4 m number of bytes of glyph images
3754 8*n LISTofOFFSET32 offsets
3755 m LISTofBYTE glyphimages
3758 <emphasis role="bold">CloseFont</emphasis>
3766 <sect2 id="errors_2">
3767 <title>Errors</title>
3768 <literallayout class="monospaced">
3770 <emphasis role="bold">Request</emphasis>
3773 2 CARD16 sequence-number
3775 4 TIMESTAMP timestamp
3776 1 CARD8 major-opcode
3777 1 CARD8 minor-opcode
3780 <emphasis role="bold">Format</emphasis>
3783 2 CARD16 sequence-number
3785 4 TIMESTAMP timestamp
3786 1 CARD8 major-opcode
3787 1 CARD8 minor-opcode
3789 4 BITMAPFORMAT bad-format
3791 <emphasis role="bold">Font</emphasis>
3794 2 CARD16 sequence-number
3796 4 TIMESTAMP timestamp
3797 1 CARD8 major-opcode
3798 1 CARD8 minor-opcode
3802 <emphasis role="bold">Range</emphasis>
3805 2 CARD16 sequence-number
3807 4 TIMESTAMP timestamp
3808 1 CARD8 major-opcode
3809 1 CARD8 minor-opcode
3813 <emphasis role="bold">EventMask</emphasis>
3816 2 CARD16 sequence-number
3818 4 TIMESTAMP timestamp
3819 1 CARD8 major-opcode
3820 1 CARD8 minor-opcode
3822 4 EVENTMASK event-mask
3824 <emphasis role="bold">AccessContext</emphasis>
3827 2 CARD16 sequence-number
3829 4 TIMESTAMP timestamp
3830 1 CARD8 major-opcode
3831 1 CARD8 minor-opcode
3833 4 ACCESSCONTEXT access context
3835 <emphasis role="bold">IDChoice</emphasis>
3838 2 CARD16 sequence-number
3840 4 TIMESTAMP timestamp
3841 1 CARD8 major-opcode
3842 1 CARD8 minor-opcode
3846 <emphasis role="bold">Name</emphasis>
3849 2 CARD16 sequence-number
3851 4 TIMESTAMP timestamp
3852 1 CARD8 major-opcode
3853 1 CARD8 minor-opcode
3856 <emphasis role="bold">Resolution</emphasis>
3859 2 CARD16 sequence-number
3861 4 TIMESTAMP timestamp
3862 1 CARD8 major-opcode
3863 1 CARD8 minor-opcode
3864 6 RESOLUTION resolution
3866 <emphasis role="bold">Alloc</emphasis>
3869 2 CARD16 sequence-number
3871 4 TIMESTAMP timestamp
3872 1 CARD8 major-opcode
3873 1 CARD8 minor-opcode
3876 <emphasis role="bold">Length</emphasis>
3879 2 CARD16 sequence-number
3881 4 TIMESTAMP timestamp
3882 1 CARD8 major-opcode
3883 1 CARD8 minor-opcode
3887 <emphasis role="bold">Implementation</emphasis>
3890 2 CARD16 sequence-number
3892 4 TIMESTAMP timestamp
3893 1 CARD8 major-opcode
3894 1 CARD8 minor-opcode
3900 <sect2 id="events_2">
3901 <title>Events</title>
3902 <literallayout class="monospaced">
3903 <emphasis role="bold">KeepAlive</emphasis>
3906 2 CARD16 sequence-number
3908 4 TIMESTAMP timestamp
3910 <emphasis role="bold">CatalogueListNotify</emphasis>
3912 1 1 event CatalogueListNotify
3913 2 CARD16 sequence-number
3915 4 TIMESTAMP timestamp
3920 <emphasis role="bold">FontListNotify</emphasis>
3922 1 2 event FontListNotify
3923 2 CARD16 sequence-number
3925 4 TIMESTAMP timestamp
3934 <sect1 id="acknowledgements">
3935 <title>Acknowledgements</title>
3937 <!-- (SN Acknowledgements -->
3940 This document represents the culmination of several years of debate and
3941 experiments done under the auspices of the MIT X Consortium font working group.
3942 Although this was a group effort, the author remains responsible for any errors
3943 or omissions. The protocol presented here was primarily designed by Jim
3944 Fulton, Keith Packard, and Bob Scheifler. Special thanks goes to Ned
3945 Batchelder, Jim Flowers, and Axel Deininger for their invigorating comments
3946 which never failed to make this a better document.
3947 Stephen Gildea edited version 2 of this document.
3948 Finally, David Lemke
3949 deserves great credit for designing and coding the sample implementation.
3954 <title>References</title>
3956 All of the following documents are X Consortium standards available from
3960 <title>X Window System Protocol Version 11</title>
3961 <author><firstname>Robert W.</firstname><surname>Scheifler</surname></author>
3965 <title>Adobe System - Bitmap Distribution Format 2.1</title>
3969 <title>X Consortium. X Logical Font Description Conventions, Version 1.5</title>
3975 <appendix id="suggested_licensing_policies">
3976 <title>Suggested Licensing Policies</title>
3978 The authorization data passed by the client in the initial connection
3979 setup information may be used by the font server to implement restrictions
3980 on which fonts may be accessed. Furthermore, the font server is free to
3981 refuse new connections at any time.
3984 Configuration or management of the license restrictions is outside the scope of
3985 the font service protocol and is done in a server-dependent manner. Possible
3986 policies might include, but are not limited to, combinations of the following:
3992 No restrictions - anyone may access any fonts. The server neither
3993 refuses any connections nor generates AccessContext errors on any
3994 fonts. For environments without specially-licensed fonts, this is
4000 Per-machine - only those clients connecting from a known set of
4001 machines are permitted access. The server could get the address
4002 of the connection and look in a list of allowed machines.
4007 Per-user - only a known set of users may access the fonts. The
4008 server can use the authorization data (such as a Kerberos ticket
4009 or a Secure RPC credential) to verify the identity of the user
4010 and then look in a list of allowed users.
4015 Simultaneous Use - only a certain number of clients may use a given
4016 font at any one time. Additional clients would receive AccessContext
4017 errors if they attempt to open the font. This is only effective if
4018 the initial clients keep the font open for the entire time that it
4019 is being used (even if all of the data has been transmitted and is
4025 Postage Meter - a particular font may only be accessed a limited
4026 number of times before its license must be renewed. Each time
4027 the font is opened, the server decrements a counter. When the
4028 counter reaches zero, all further attempts to open the font
4029 return an AccessContext error.
4035 It should be noted that chaining of font servers (obtaining font data from
4036 other font servers) may conflict with certain license policies.
4040 <appendix id="implementation_suggestions">
4041 <title>Implementation Suggestions</title>
4044 Font server implementations will probably wish to use techniques such as the
4045 following to avoid limits on the number of simultaneous connections:
4050 The initial connection information returned by the font
4051 server contains the names of other font servers that
4052 may be used as substitutes. A font server may refuse to
4053 accept a connection, indicating that the client should
4054 try one of the alternatives instead.
4059 On operating systems that support processing forking, font
4060 servers might choose to fork so that the child can continue
4061 processing the existing connections and the parent can accept
4062 new connections. Such implementations are encouraged to use
4063 shared memory so that in-memory font databases can be shared.
4068 On operating systems that support passing stream file descriptors
4069 between processes, cooperating font servers could collect
4070 connections in a single process when there are few connections
4071 and spread them among several processes as the load increases.
4076 If a font client is unable to connect to a server (as opposed
4077 to having the connection terminated), it should retry for an
4078 implementation-dependent length of time (see Xlib's
4079 handling of ECONNREFUSED in XConnDis.c).