1 X Logical Font Description Conventions
7 Digital Equipment Corporation
15 X Version 11, Release 7.7
19 Copyright © 1988, 1994 X Consortium
21 Permission is hereby granted, free of charge, to any person obtaining a copy of
22 this software and associated documentation files (the "Software"), to deal in
23 the Software without restriction, including without limitation the rights to
24 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
25 of the Software, and to permit persons to whom the Software is furnished to do
26 so, subject to the following conditions:
28 The above copyright notice and this permission notice shall be included in all
29 copies or substantial portions of the Software.
31 THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X
34 CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
35 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
36 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38 Except as contained in this notice, the name of the X Consortium shall not be
39 used in advertising or otherwise to promote the sale, use or other dealings in
40 this Software without prior written authorization from the X Consortium.
42 X Window System is a trademark of The Open Group.
44 Copyright © 1988, 1989 Digital Equipment Corporation, Maynard MA. All rights
47 Permission to use, copy, modify, and distribute this documentation for any
48 purpose and without fee is hereby granted, provided that the above copyright
49 notice and this permission notice appear in all copies. Digital Equipment
50 Corporation makes no representations about the suitability for any purpose of
51 the information in this document. This documentation is provided as is without
52 express or implied warranty.
54 Helvetica and Times are registered trademarks of Linotype Company.
56 ITC Avant Garde Gothic is a registered trademark of International Typeface
59 Times Roman is a registered trademark of Monotype Corporation.
61 Bitstream Amerigo is a registered trademark of Bitstream Inc.
63 Stone is a registered trademark of Adobe Systems Inc.
65 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
70 2. Requirements and Goals
72 Provide Unique and Descriptive Font Names
73 Support Multiple Font Vendors and Character Sets
74 Support Scalable and Polymorphic Fonts
75 Support Transformations and Subsetting of Fonts
76 Be Independent of X Server and Operating or File System Implementations
77 Support Arbitrarily Complex Font Matching and Substitution
80 3. X Logical Font Description
85 FontName Field Definitions
147 Built-in Font Property Atoms
149 4. Matrix Transformations
151 Metrics and Font Properties
155 7. Affected Elements of Xlib and the X Protocol
158 XLFD Conformance Requirements
159 FONT_ASCENT, FONT_DESCENT, and DEFAULT_CHAR
165 Chapter 1. Introduction
167 It is a requirement that X client applications must be portable across server
168 implementations, with very different file systems, naming conventions, and font
169 libraries. However, font access requests, as defined by the X Window System
170 Protocol, neither specify server-independent conventions for font names nor
171 provide adequate font properties for logically describing typographic fonts.
173 X clients must be able to dynamically determine the fonts available on any
174 given server so that understandable information can be presented to the user or
175 so that intelligent font fallbacks can be chosen. It is desirable for the most
176 common queries to be accomplished without the overhead of opening each font and
177 inspecting font properties, by means of simple ListFonts requests. For example,
178 if a user selected a Helvetica typeface family, a client application should be
179 able to query the server for all Helvetica fonts and present only those
180 setwidths, weights, slants, point sizes, and character sets available for that
183 This document gives a standard logical font description (hereafter referred to
184 as XLFD) and the conventions to be used in the core protocol so that clients
185 can query and access screen type libraries in a consistent manner across all X
186 servers. In addition to completely specifying a given font by means of its
187 FontName, the XLFD also provides for a standard set of key FontProperties that
188 describe the font in more detail.
190 The XLFD provides an adequate set of typographic font properties, such as
191 CAP_HEIGHT, X_HEIGHT, and RELATIVE_SETWIDTH, for publishing and other
192 applications to do intelligent font matching or substitution when handling
193 documents created on some foreign server that use potentially unknown fonts. In
194 addition, this information is required by certain clients to position
195 subscripts automatically and determine small capital heights, recommended
196 leading, word-space values, and so on.
198 Chapter 2. Requirements and Goals
202 Provide Unique and Descriptive Font Names
203 Support Multiple Font Vendors and Character Sets
204 Support Scalable and Polymorphic Fonts
205 Support Transformations and Subsetting of Fonts
206 Be Independent of X Server and Operating or File System Implementations
207 Support Arbitrarily Complex Font Matching and Substitution
210 The XLFD meets the short-term and long-term goals to have a standard logical
211 font description that:
213 ● Provides unique, descriptive font names that support simple pattern
216 ● Supports multiple font vendors, arbitrary character sets, and encodings
218 ● Supports naming and instancing of scalable and polymorphic fonts
220 ● Supports transformations and subsetting of fonts
222 ● Is independent of X server and operating or file system implementations
224 ● Supports arbitrarily complex font matching or substitution
228 Provide Unique and Descriptive Font Names
230 It should be possible to have font names that are long enough and descriptive
231 enough to have a reasonable probability of being unique without inventing a new
232 registration organization. Resolution and size-dependent font masters,
233 multivendor font libraries, and so on must be anticipated and handled by the
236 The name itself should be structured to be amenable to simple pattern matching
237 and parsing, thus allowing X clients to restrict font queries to some subset of
238 all possible fonts in the server.
240 Support Multiple Font Vendors and Character Sets
242 The font name and properties should distinguish between fonts that were
243 supplied by different font vendors but that possibly share the same name. We
244 anticipate a highly competitive font market where users will be able to buy
245 fonts from many sources according to their particular requirements.
247 A number of font vendors deliver each font with all glyphs designed for that
248 font, where charset mappings are defined by encoding vectors. Some server
249 implementations may force these mappings to proprietary or standard charsets
250 statically in the font data. Others may desire to perform the mapping
251 dynamically in the server. Provisions must be made in the font name that allows
252 a font request to specify or identify specific charset mappings in server
253 environments where multiple charsets are supported.
255 Support Scalable and Polymorphic Fonts
257 If a font source can be scaled to an arbitrary size or varied in other ways, it
258 should be possible for an application to determine that fact from the font
259 name, and the application should be able to construct a font name for any
262 Support Transformations and Subsetting of Fonts
264 Arbitrary two-dimensional linear transformations of fonts should be able to be
265 requested by applications. Since such transformed fonts may be used for special
266 effects requiring a few characters from each of many differently transformed
267 fonts, it should be possible to request only a few characters from a font for
270 Be Independent of X Server and Operating or File System Implementations
272 X client applications that require a particular font should be able to use the
273 descriptive name without knowledge of the file system or other repository in
274 use by the server. However, it should be possible for servers to translate a
275 given font name into a file name syntax that it knows how to deal with, without
276 compromising the uniqueness of the font name. This algorithm should be
277 reversible (exactly how this translation is done is implementation dependent).
279 Support Arbitrarily Complex Font Matching and Substitution
281 In addition to the font name, the XLFD should define a standard list of
282 descriptive font properties, with agreed-upon fallbacks for all fonts. This
283 allows client applications to derive font-specific formatting or display data
284 and to perform font matching or substitution when asked to handle potentially
285 unknown fonts, as required.
289 The XLFD must be extensible so that new and/or private descriptive font
290 properties can be added to conforming fonts without making existing X client or
291 server implementations obsolete.
293 Chapter 3. X Logical Font Description
300 FontName Field Definitions
362 Built-in Font Property Atoms
364 XLFD is divided into two basic components: the FontName, which gives all font
365 information needed to uniquely identify a font in X protocol requests (for
366 example, OpenFont, ListFonts, and so on) and a variable list of optional
367 FontProperties, which describe a font in more detail.
369 The FontName is used in font queries and is returned as data in certain X
370 protocol requests. It is also specified as the data value for the FONT item in
371 the X Consortium Character Bitmap Distribution Format Standard (BDF V2.1).
373 The FontProperties are supplied on a font-by-font basis and are returned as
374 data in certain X protocol requests as part of the XFontStruct data structure.
375 The names and associated data values for each of the FontProperties may also
376 appear as items of the STARTPROPERTIES...ENDPROPERTIESlist in the BDF V2.1
381 Each FontName is logically composed of two strings: a FontNameRegistry prefix
382 that is followed by a FontNameSuffix. The FontName uses the ISO 8859-1
383 encoding. The FontNameRegistry is an x-registered-name (a name that has been
384 registered with the X Consortium) that identifies the registration authority
385 that owns the specified FontNameSuffix syntax and semantics.
387 All font names that conform to this specification are to use a FontNameRegistry
388 prefix, which is defined to be the string "-" (HYPHEN). All FontNameRegistry
389 prefixes of the form: +version-, where the specified version indicates some
390 future XLFD specification, are reserved by the X Consortium for future
391 extensions to XLFD font names. If required, extensions to the current XLFD font
392 name shall be constructed by appending new fields to the current structure,
393 each delimited by the existing field delimiter. The availability of other
394 FontNameRegistry prefixes or fonts that support other registries is server
395 implementation dependent.
397 In the X protocol specification, the FontName is required to be a string;
398 hence, numeric field values are represented in the name as string equivalents.
399 All FontNameSuffix fields are also defined as FontProperties; numeric property
400 values are represented as signed or unsigned integers, as appropriate.
404 The FontName is a structured, parsable string (of type STRING8) whose
405 Backus-Naur Form syntax description is as follows:
407 FontName ::= XFontNameRegistry XFontNameSuffix | PrivFontNameRegistry
409 XFontNameRegistry :: XFNDelim | XFNExtPrefix Version XFNDelim
411 FOUNDRY XFNDelim FAMILY_NAME XFNDelim WEIGHT_NAME XFNDelim
412 SLANT XFNDelim SETWIDTH_NAME XFNDelim ADD_STYLE_NAME
413 XFontNameSuffix ::= XFNDelim PIXEL_SIZE XFNDelim POINT_SIZE XFNDelim
414 RESOLUTION_X XFNDelim RESOLUTION_Y XFNDelim SPACING
415 XFNDelim AVERAGE_WIDTH XFNDelim CHARSET_REGISTRY XFNDelim
417 Version ::= STRING8 - the XLFD version that defines an extension to
418 the font name syntax (for example, "1.4")
419 XFNExtPrefix ::= OCTET - "+" (PLUS)
420 XFNDelim ::= OCTET - "-" (HYPHEN)
421 PrivFontNameRegistry STRING8 - other than those strings reserved by XLFD
423 PrivFontNameSuffix STRING8
426 Field values are constructed as strings of ISO 8859-1 graphic characters,
427 excluding the following:
429 ● '-' (HYPHEN), the XLFD font name delimiter character
431 ● '?' (QUESTION MARK) and "*" (ASTERISK), the X protocol font name wildcard
434 ● ',' (COMMA), used by Xlib to separate XLFD font names in a font set.
436 ● '"' (QUOTATION MARK), used by some commercial products to quote a font
439 Alphabetic case distinctions are allowed but are for human readability concerns
440 only. Conforming X servers will perform matching on font name query or open
441 requests independent of case. The entire font name string must have no more
442 than 255 characters. It is recommended that clients construct font name query
443 patterns by explicitly including all field delimiters to avoid unexpected
444 results. Note that SPACE is a valid character of a FontName field; for example,
445 the string "ITC Avant Garde Gothic" might be a FAMILY_NAME.
447 FontName Field Definitions
449 This section discusses the FontName:
459 ● SETWIDTH_NAME field
461 ● ADD_STYLE_NAME field
467 ● RESOLUTION_X and RESOLUTION_Y fields
471 ● AVERAGE_WIDTH field
473 ● CHARSET_REGISTRY and CHARSET_ENCODING fields
477 FOUNDRY is an x-registered-name, the name or identifier of the digital type
478 foundry that digitized and supplied the font data, or if different, the
479 identifier of the organization that last modified the font shape or metric
482 The reason this distinction is necessary is that a given font design may be
483 licensed from one source (for example, ITC) but digitized and sold by any
484 number of different type suppliers. Each digital version of the original
485 design, in general, will be somewhat different in metrics and shape from the
486 idealized original font data, because each font foundry, for better or for
487 worse, has its own standards and practices for tweaking a typeface for a
488 particular generation of output technologies or has its own perception of
491 It is up to the type supplier to register with the X Consortium a suitable name
492 for this FontName field according to the registration procedures defined by the
495 The X Consortium shall define procedures for registering foundry and other
496 names and shall maintain and publish, as part of its public distribution, a
497 registry of such registered names for use in XLFD font names and properties.
501 FAMILY_NAME is a string that identifies the range or family of typeface designs
502 that are all variations of one basic typographic style. This must be spelled
503 out in full, with words separated by spaces, as required. This name must be
504 human-understandable and suitable for presentation to a font user to identify
507 It is up to the type supplier to supply and maintain a suitable string for this
508 field and font property, to secure the proper legal title to a given name, and
509 to guard against the infringement of other's copyrights or trademarks. By
510 convention, FAMILY_NAME is not translated. FAMILY_NAME may include an
511 indication of design ownership if considered a valid part of the typeface
514 The following are examples of FAMILY_NAME:
518 ● ITC Avant Garde Gothic
530 WEIGHT_NAME is a string that identifies the font's typographic weight, that is,
531 the nominal blackness of the font, according to the FOUNDRY's judgment. This
532 name must be human-understandable and suitable for presentation to a font user.
533 The value "0" is used to indicate a polymorphic font (see Polymorphic Fonts).
535 The interpretation of this field is somewhat problematic because the
536 typographic judgment of weight has traditionally depended on the overall design
537 of the typeface family in question; that is, it is possible that the DemiBold
538 weight of one font could be almost equivalent in typographic feel to a Bold
539 font from another family.
541 WEIGHT_NAME is captured as an arbitrary string because it is an important part
542 of a font's complete human-understandable name. However, it should not be used
543 for font matching or substitution. For this purpose, X client applications
544 should use the weight-related font properties (RELATIVE_WEIGHT and WEIGHT) that
545 give the coded relative weight and the calculated weight, respectively.
549 SLANT is a code-string that indicates the overall posture of the typeface
550 design used in the font. The encoding is as follows:
552 ┌───────┬───────────────┬─────────────────────────────────────────────────────┐
553 │Code │English │Description │
555 ├───────┼───────────────┼─────────────────────────────────────────────────────┤
556 │"R" │Roman │Upright design │
557 ├───────┼───────────────┼─────────────────────────────────────────────────────┤
558 │"I" │Italic │Italic design, slanted clockwise from the vertical │
559 ├───────┼───────────────┼─────────────────────────────────────────────────────┤
560 │"O" │Oblique │Obliqued upright design, slanted clockwise from the │
562 ├───────┼───────────────┼─────────────────────────────────────────────────────┤
563 │"RI" │Reverse Italic │Italic design, slanted counterclockwise from the │
565 ├───────┼───────────────┼─────────────────────────────────────────────────────┤
566 │"RO" │Reverse Oblique│Obliqued upright design, slanted counterclockwise │
567 │ │ │from the vertical │
568 ├───────┼───────────────┼─────────────────────────────────────────────────────┤
569 │"OT" │Other │Other │
570 ├───────┼───────────────┼─────────────────────────────────────────────────────┤
571 │numeric│Polymorphic │See Polymorphic Fonts. │
572 └───────┴───────────────┴─────────────────────────────────────────────────────┘
574 The SLANT codes are for programming convenience only and usually are converted
575 into their equivalent human-understandable form before being presented to a
580 SETWIDTH_NAME is a string that gives the font's typographic proportionate
581 width, that is, the nominal width per horizontal unit of the font, according to
582 the FOUNDRY's judgment. The value "0" is used to indicate a polymorphic font
583 (see Polymorphic Fonts).
585 As with WEIGHT_NAME, the interpretation of this field or font property is
586 somewhat problematic, because the designer's judgment of setwidth has
587 traditionally depended on the overall design of the typeface family in
588 question. For purposes of font matching or substitution, X client applications
589 should either use the RELATIVE_SETWIDTH font property that gives the relative
590 coded proportionate width or calculate the proportionate width.
592 The following are examples of SETWIDTH_NAME:
604 ADD_STYLE_NAME is a string that identifies additional typographic style
605 information that is not captured by other fields but is needed to identify the
606 particular font. The character "[" anywhere in the field is used to indicate a
607 polymorphic font (see Polymorphic Fonts).
609 ADD_STYLE_NAME is not a typeface classification field and is only used for
610 uniqueness. Its use, as such, is not limited to typographic style distinctions.
612 The following are examples of ADD_STYLE_NAME:
624 PIXEL_SIZE gives the body size of the font at a particular POINT_SIZE and
625 RESOLUTION_Y. PIXEL_SIZE is either an integer-string or a string beginning with
626 "[". A string beginning with "[" represents a matrix (see Matrix
627 Transformations). PIXEL_SIZE usually incorporates additional vertical spacing
628 that is considered part of the font design. (Note, however, that this value is
629 not necessarily equivalent to the height of the font bounding box.) Zero is
630 used to indicate a scalable font (see Scalable Fonts).
632 PIXEL_SIZE usually is used by X client applications that need to query fonts
633 according to device-dependent size, regardless of the point size or vertical
634 resolution for which the font was designed.
638 POINT_SIZE gives the body size for which the font was designed. POINT_SIZE is
639 either an integer-string or a string beginning with "[". A string beginning
640 with "[" represents a matrix (see Matrix Transformations). This field usually
641 incorporates additional vertical spacing that is considered part of the font
642 design. (Note, however, that POINT_SIZE is not necessarily equivalent to the
643 height of the font bounding box.) POINT_SIZE is expressed in decipoints (where
644 points are as defined in the X protocol or 72.27 points equal 1 inch). Zero is
645 used to indicate a scalable font (see Scalable Fonts).
647 POINT_SIZE and RESOLUTION_Y are used by X clients to query fonts according to
648 device-independent size to maintain constant text size on the display
649 regardless of the PIXEL_SIZE used for the font.
651 RESOLUTION_X and RESOLUTION_Y Fields
653 RESOLUTION_X and RESOLUTION_Y are unsigned integer-strings that give the
654 horizontal and vertical resolution, measured in pixels or dots per inch (dpi),
655 for which the font was designed. Zero is used to indicate a scalable font (see
656 Scalable Fonts). Horizontal and vertical values are required because a separate
657 bitmap font must be designed for displays with very different aspect ratios
658 (for example, 1:1, 4:3, 2:1, and so on).
660 The separation of pixel or point size and resolution is necessary because X
661 allows for servers with very different video characteristics (for example,
662 horizontal and vertical resolution, screen and pixel size, pixel shape, and so
663 on) to potentially access the same font library. The font name, for example,
664 must differentiate between a 14-point font designed for 75 dpi (body size of
665 about 14 pixels) or a 14-point font designed for 150 dpi (body size of about 28
666 pixels). Further, in servers that implement some or all fonts as continuously
667 scaled and scan-converted outlines, POINT_SIZE and RESOLUTION_Y will help the
668 server to differentiate between potentially separate font masters for text,
669 title, and display sizes or for other typographic considerations.
673 SPACING is a code-string that indicates the escapement class of the font, that
674 is, monospace (fixed pitch), proportional (variable pitch), or charcell (a
675 special monospaced font that conforms to the traditional data-processing
676 character cell font model). The encoding is as follows:
678 ┌────┬────────────┬───────────────────────────────────────────────────────────┐
679 │Code│English │Description │
681 ├────┼────────────┼───────────────────────────────────────────────────────────┤
682 │ │ │A font whose logical character widths vary for each glyph. │
683 │"P" │Proportional│Note that no other restrictions are placed on the metrics │
684 │ │ │of a proportional font. │
685 ├────┼────────────┼───────────────────────────────────────────────────────────┤
686 │ │ │A font whose logical character widths are constant (that │
687 │"M" │Monospaced │is, every glyph in the font has the same logical width). No│
688 │ │ │other restrictions are placed on the metrics of a │
689 │ │ │monospaced font. │
690 ├────┼────────────┼───────────────────────────────────────────────────────────┤
691 │ │ │A monospaced font that follows the standard typewriter │
692 │ │ │character cell model (that is, the glyphs of the font can │
693 │ │ │be modeled by X clients as "boxes" of the same width and │
694 │ │ │height that are imaged side-by-side to form text strings or│
695 │ │ │top-to-bottom to form text lines). By definition, all │
696 │ │ │glyphs have the same logical character width, and no glyphs│
697 │ │ │have "ink" outside of the character cell. There is no │
698 │"C" │CharCell │kerning (that is, on a per-character basis with positive │
699 │ │ │metrics: 0 <= left-bearing <= right-bearing <= width; with │
700 │ │ │negative metrics: width <= left-bearing <= right-bearing <=│
701 │ │ │zero). Also, the vertical extents of the font do not exceed│
702 │ │ │the vertical spacing (that is, on a per-character basis: │
703 │ │ │ascent <= font-ascent and descent <= font-descent). The │
704 │ │ │cell height = font-descent + font-ascent, and the width = │
705 │ │ │AVERAGE_WIDTH. │
706 └────┴────────────┴───────────────────────────────────────────────────────────┘
710 AVERAGE_WIDTH is an integer-string typographic metric value that gives the
711 unweighted arithmetic mean of the absolute value of the width of each glyph in
712 the font (measured in tenths of pixels), multiplied by -1 if the dominant
713 writing direction for the font is right-to-left. A leading "~" (TILDE)
714 indicates a negative value. For monospaced and character cell fonts, this is
715 the width of all glyphs in the font. Zero is used to indicate a scalable font
716 (see Scalable Fonts).
718 CHARSET_REGISTRY and CHARSET_ENCODING Fields
720 The character set used to encode the glyphs of the font (and implicitly the
721 font's glyph repertoire), as maintained by the X Consortium character set
722 registry. CHARSET_REGISTRY is an x-registered-name that identifies the
723 registration authority that owns the specified encoding. CHARSET_ENCODING is a
724 registered name that identifies the coded character set as defined by that
725 registration authority and, optionally, a subsetting hint.
727 Although the X protocol does not explicitly have any knowledge about character
728 set encodings, it is expected that server implementors will prefer to embed
729 knowledge of certain proprietary or standard charsets into their font library
730 for reasons of performance and convenience. The CHARSET_REGISTRY and
731 CHARSET_ENCODING fields or properties allow an X client font request to specify
732 a specific charset mapping in server environments where multiple charsets are
733 supported. The availability of any particular character set is font and server
734 implementation dependent.
736 To prevent collisions when defining character set names, it is recommended that
737 CHARSET_REGISTRY and CHARSET_ENCODING name pairs be constructed according to
738 the following conventions:
740 CharsetRegistry ::= StdCharsetRegistryName | PrivCharsetRegistryName
741 CharsetEncoding ::= StdCharsetEncodingName | PrivCharsetEncodingName
742 StdCharsetRegistryName StdOrganizationId StdNumber | StdOrganizationId
743 ::= StdNumber Dot Year
744 PrivCharsetRegistryName OrganizationId STRING8
746 StdCharsetEncodingName STRING8-numeric part number of referenced standard
748 PrivCharsetEncodingName STRING8
750 StdOrganizationId ::= STRING8-the registered name or acronym of the
751 referenced standard organization
752 StdNumber ::= STRING8-referenced standard number
753 OrganizationId ::= STRING8-the registered name or acronym of the
755 Dot ::= OCTET-"." (FULL STOP)
756 Year ::= STRING8-numeric year (for example, 1989)
758 The X Consortium shall maintain and publish a registry of such character set
759 names for use in X protocol font names and properties as specified in XLFD.
761 The ISO Latin-1 character set shall be registered by the X Consortium as the
762 CHARSET_REGISTRY-CHARSET_ENCODING value pair: "ISO8859-1".
764 If the CHARSET_ENCODING contains a "[" (LEFT SQUARE BRACKET), the "[" and the
765 characters after it up to a "]" (RIGHT SQUARE BRACKET) are a subsetting hint
766 telling the font source that the client is interested only in a subset of the
767 characters of the font. The font source can, optionally, return a font that
768 contains only those characters or any superset of those characters. The client
769 can expect to obtain valid glyphs and metrics only for those characters, and
770 not for any other characters in the font. The font properties may optionally be
771 calculated by considering only the characters in the subset.
773 The BNF for the subsetting hint is
775 Subset ::= LeftBracket RangeList RightBracket
776 RangeList ::= Range | Range Space RangeList
777 Range ::= Number | Number Underscore Number
778 Number ::= "0x" HexNumber | DecNumber
779 HexNumber ::= HexDigit | HexDigit HexNumber
780 DecNumber ::= DecDigit | DecDigit DecNumber
781 DecDigit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
782 HexDigit ::= DecDigit | "a" | "b" | "c" | "d" | "e" | "f"
783 LeftBracket ::= "[" (LEFT SQUARE BRACKET)
784 RightBracket ::= "]" (RIGHT SQUARE BRACKET)
785 Space ::= "\0" (SPACE)
786 Underscore ::= "_" (LOW LINE)
788 Each Range specifies characters that are to be part of the subset included in
789 the font. A Range containing two Numbers specifies the first and last
790 character, inclusively, of a range of characters. A Range that is a single
791 Number specifies a single character to be included in the font. A HexNumber is
792 interpreted as a hexadecimal number. A DecNumber is interpreted as a decimal
793 number. The font consists of the union of all the Ranges in the RangeList.
797 -misc-fixed-medium-r-normal--0-0-0-0-c-0-iso8859-1[65 70 80_90]
799 tells the font source that the client is interested only in characters 65, 70,
804 The following examples of font names are derived from the screen fonts shipped
805 with the X Consortium distribution.
807 ┌───────┬──────────────────────────────────────────────────────────────────────┐
809 ├───────┼──────────────────────────────────────────────────────────────────────┤
812 ├───────┼──────────────────────────────────────────────────────────────────────┤
813 │Charter│-Bitstream-Charter-Medium-R-Normal--12-120-75-75-P-68-ISO8859-1 │
815 ├───────┼──────────────────────────────────────────────────────────────────────┤
817 │Bold 12│-Bitstream-Charter-Bold-R-Normal--12-120-75-75-P-76-ISO8859-1 │
819 ├───────┼──────────────────────────────────────────────────────────────────────┤
821 │Bold │-Bitstream-Charter-Bold-I-Normal--12-120-75-75-P-75-ISO8859-1 │
824 ├───────┼──────────────────────────────────────────────────────────────────────┤
826 │Italic │-Bitstream-Charter-Medium-I-Normal--12-120-75-75-P-66-ISO8859-1 │
828 ├───────┼──────────────────────────────────────────────────────────────────────┤
829 │Courier│-Adobe-Courier-Medium-R-Normal--8-80-75-75-M-50-ISO8859-1 │
831 ├───────┼──────────────────────────────────────────────────────────────────────┤
832 │Courier│-Adobe-Courier-Medium-R-Normal--10-100-75-75-M-60-ISO8859-1 │
834 ├───────┼──────────────────────────────────────────────────────────────────────┤
835 │Courier│-Adobe-Courier-Medium-R-Normal--12-120-75-75-M-70-ISO8859-1 │
837 ├───────┼──────────────────────────────────────────────────────────────────────┤
838 │Courier│-Adobe-Courier-Medium-R-Normal--24-240-75-75-M-150-ISO8859-1 │
840 ├───────┼──────────────────────────────────────────────────────────────────────┤
842 │Bold 10│-Adobe-Courier-Bold-R-Normal--10-100-75-75-M-60-ISO8859-1 │
844 ├───────┼──────────────────────────────────────────────────────────────────────┤
846 │Bold │-Adobe-Courier-Bold-O-Normal--10-100-75-75-M-60-ISO8859-1 │
849 ├───────┼──────────────────────────────────────────────────────────────────────┤
851 │Oblique│-Adobe-Courier-Medium-O-Normal--10-100-75-75-M-60-ISO8859-1 │
853 ├───────┼──────────────────────────────────────────────────────────────────────┤
856 ├───────┼──────────────────────────────────────────────────────────────────────┤
857 │Symbol │-Adobe-Symbol-Medium-R-Normal--14-100-100-100-P-85-Adobe-FONTSPECIFIC │
859 ├───────┼──────────────────────────────────────────────────────────────────────┤
860 │Symbol │-Adobe-Symbol-Medium-R-Normal--20-140-100-100-P-107-Adobe-FONTSPECIFIC│
862 ├───────┼──────────────────────────────────────────────────────────────────────┤
863 │Symbol │-Adobe-Symbol-Medium-R-Normal--25-180-100-100-P-142-Adobe-FONTSPECIFIC│
865 ├───────┼──────────────────────────────────────────────────────────────────────┤
866 │Symbol │-Adobe-Symbol-Medium-R-Normal--34-240-100-100-P-191-Adobe-FONTSPECIFIC│
868 ├───────┼──────────────────────────────────────────────────────────────────────┤
870 │Bold 10│-Adobe-Times-Bold-R-Normal--14-100-100-100-P-76-ISO8859-1 │
872 ├───────┼──────────────────────────────────────────────────────────────────────┤
874 │Bold │-Adobe-Times-Bold-I-Normal--14-100-100-100-P-77-ISO8859-1 │
877 ├───────┼──────────────────────────────────────────────────────────────────────┤
879 │Italic │-Adobe-Times-Medium-I-Normal--14-100-100-100-P-73-ISO8859-1 │
881 ├───────┼──────────────────────────────────────────────────────────────────────┤
883 │Roman │-Adobe-Times-Medium-R-Normal--14-100-100-100-P-74-ISO8859-1 │
885 └───────┴──────────────────────────────────────────────────────────────────────┘
889 All font properties are optional but will generally include the font name
890 fields and, on a font-by-font basis, any other useful font descriptive and use
891 information that may be required to use the font intelligently. The XLFD
892 specifies an extensive set of standard X font properties, their interpretation,
893 and fallback rules when the property is not defined for a given font. The goal
894 is to provide client applications with enough font information to be able to
895 make automatic formatting and display decisions with good typographic results.
897 Font property names use the ISO 8859-1 encoding.
899 Additional standard X font property definitions may be defined in the future
900 and private properties may exist in X fonts at any time. Private font
901 properties should be defined to conform to the general mechanism defined in the
902 X protocol to prevent overlap of name space and ambiguous property names, that
903 is, private font property names are of the form: "_" (LOW LINE), followed by
904 the organizational identifier, followed by "_" (LOW LINE), and terminated with
907 The Backus-Naur Form syntax description of X font properties is as follows:
909 Properties ::= OptFontPropList
910 OptFontPropList NULL | OptFontProp OptFontPropList
912 OptFontProp ::= PrivateFontProp | XFontProp
913 PrivateFontProp STRING8 | Underscore OrganizationId Underscore STRING8
915 FOUNDRY | FAMILY_NAME | WEIGHT_NAME | SLANT | SETWIDTH_NAME |
916 ADD_STYLE_NAME | PIXEL_SIZE | POINT_SIZE | RESOLUTION_X |
917 RESOLUTION_Y | SPACING | AVERAGE_WIDTH | CHARSET_REGISTRY |
918 CHARSET_ENCODING | QUAD_WIDTH | RESOLUTION | MIN_SPACE |
919 NORM_SPACE | MAX_SPACE | END_SPACE | SUPERSCRIPT_X |
920 SUPERSCRIPT_Y | SUBSCRIPT_X | SUBSCRIPT_Y | UNDERLINE_POSITION
921 XFontProp ::= | UNDERLINE_THICKNESS | STRIKEOUT_ASCENT | STRIKEOUT_DESCENT |
922 ITALIC_ANGLE | X_HEIGHT | WEIGHT | FACE_NAME | FULL_NAME | FONT
923 | COPYRIGHT | AVG_CAPITAL_WIDTH | AVG_LOWERCASE_WIDTH |
924 RELATIVE_SETWIDTH | RELATIVE_WEIGHT | CAP_HEIGHT | SUPERSCRIPT_
925 SIZE | FIGURE_WIDTH | SUBSCRIPT_SIZE | SMALL_CAP_SIZE | NOTICE
926 | DESTINATION | FONT_TYPE | FONT_VERSION | RASTERIZER_NAME |
927 RASTERIZER_VERSION | RAW_ASCENT | RAW_DESCENT | RAW_* |
928 AXIS_NAMES | AXIS_LIMITS | AXIS_TYPES
929 Underscore ::= OCTET-"_" (LOW LINE)
930 OrganizationId STRING8-the registered name of the organization
935 FOUNDRY is as defined in the FontName except that the property type is ATOM.
937 FOUNDRY cannot be calculated or defaulted if not supplied as a font property.
941 FAMILY_NAME is as defined in the FontName except that the property type is
944 FAMILY_NAME cannot be calculated or defaulted if not supplied as a font
949 WEIGHT_NAME is as defined in the FontName except that the property type is
952 WEIGHT_NAME can be defaulted if not supplied as a font property, as follows:
954 if (WEIGHT_NAME undefined) then
955 WEIGHT_NAME = ATOM("Medium")
959 SLANT is as defined in the FontName except that the property type is ATOM.
961 SLANT can be defaulted if not supplied as a font property, as follows:
963 if (SLANT undefined) then
968 SETWIDTH_NAME is as defined in the FontName except that the property type is
971 SETWIDTH_NAME can be defaulted if not supplied as a font property, as follows:
973 if (SETWIDTH_NAME undefined) then
974 SETWIDTH_NAME = ATOM("Normal")
978 ADD_STYLE_NAME is as defined in the FontName except that the property type is
981 ADD_STYLE_NAME can be defaulted if not supplied as a font property, as follows:
983 if (ADD_STYLE_NAME undefined) then
984 ADD_STYLE_NAME = ATOM("")
988 PIXEL_SIZE is as defined in the FontName except that the property type is
991 X clients requiring pixel values for the various typographic fixed spaces (em
992 space, en space, and thin space) can use the following algorithm for computing
993 these values from other properties specified for a font:
995 DeciPointsPerInch = 722.7
996 EMspace = ROUND ((RESOLUTION_X * POINT_SIZE) / DeciPointsPerInch)
997 ENspace = ROUND (EMspace / 2)
998 THINspace = ROUND (EMspace / 3)\fP
1000 where a slash (/) denotes real division, an asterisk (*) denotes real
1001 multiplication, and ROUND denotes a function that rounds its real argument a up
1002 or down to the next integer. This rounding is done according to X = FLOOR ( a +
1003 0.5), where FLOOR is a function that rounds its real argument down to the
1006 PIXEL_SIZE can be approximated if not supplied as a font property, according to
1007 the following algorithm:
1009 DeciPointsPerInch = 722.7
1010 if (PIXEL_SIZE undefined) then
1011 PIXEL_SIZE = ROUND ((RESOLUTION_Y * POINT_SIZE) / DeciPointsPerInch)
1015 POINT_SIZE is as defined in the FontName except that the property type is
1018 X clients requiring device-independent values for em space, en space, and thin
1019 space can use the following algorithm:
1021 EMspace = ROUND (POINT_SIZE / 10)
1022 ENspace = ROUND (POINT_SIZE / 20)
1023 THINspace = ROUND (POINT_SIZE / 30)
1025 Design POINT_SIZE cannot be calculated or approximated.
1029 RESOLUTION_X is as defined in the FontName except that the property type is
1032 RESOLUTION_X cannot be calculated or approximated.
1036 RESOLUTION_Y is as defined in the FontName except that the property type is
1039 RESOLUTION_X cannot be calculated or approximated.
1043 SPACING is as defined in the FontName except that the property type is ATOM.
1045 SPACING can be calculated if not supplied as a font property, according to the
1046 definitions given above for the FontName.
1050 AVERAGE_WIDTH is as defined in the FontName except that the property type is
1053 AVERAGE_WIDTH can be calculated if not provided as a font property, according
1054 to the following algorithm:
1056 if (AVERAGE_WIDTH undefined) then
1057 AVERAGE_WIDTH = ROUND (MEAN (ABS (width of each glyph in font)) * 10)
1058 * (if (dominant writing direction L-to-R) then 1 else -1)
1060 where MEAN is a function that returns the arithmetic mean of its arguments.
1062 X clients that require values for the number of characters per inch (pitch) of
1063 a monospaced font can use the following algorithm using the AVERAGE_WIDTH and
1064 RESOLUTION_X font properties:
1066 if (SPACING not proportional) then
1067 CharPitch = (RESOLUTION_X * 10) / AVERAGE_WIDTH
1071 CHARSET_REGISTRY is as defined in the FontName except that the property type is
1074 CHARSET_REGISTRY cannot be defaulted if not supplied as a font property.
1078 CHARSET_ENCODING is as defined in the FontName except that the property type is
1081 CHARSET_ENCODING cannot be defaulted if not supplied as a font property.
1085 MIN_SPACE is an integer value (of type INT32) that gives the recommended
1086 minimum word-space value to be used with this font.
1088 MIN_SPACE can be approximated if not provided as a font property, according to
1089 the following algorithm:
1091 if (MIN_SPACE undefined) then
1092 MIN_SPACE = ROUND(0.75 * NORM_SPACE)
1096 NORM_SPACE is an integer value (of type INT32) that gives the recommended
1097 normal word-space value to be used with this font.
1099 NORM_SPACE can be approximated if not provided as a font property, according to
1100 the following algorithm:
1102 DeciPointsPerInch = 722.7
1103 if (NORM_SPACE undefined) then
1104 if (SPACE glyph exists) then
1105 NORM_SPACE = width of SPACE
1106 else NORM_SPACE = ROUND((0.33 * RESOLUTION_X * POINT_SIZE)/ DeciPointsPerInch)
1110 MAX_SPACE is an integer value (of type INT32) that gives the recommended
1111 maximum word-space value to be used with this font.
1113 MAX_SPACE can be approximated if not provided as a font property, according to
1114 the following algorithm:
1116 if (MAX_SPACE undefined) then
1117 MAX_SPACE = ROUND(1.5 * NORM_SPACE)
1121 END_SPACE is an integer value (of type INT32) that gives the recommended
1122 spacing at the end of sentences.
1124 END_SPACE can be approximated if not provided as a font property, according to
1125 the following algorithm:
1127 if (END_SPACE undefined) then
1128 END_SPACE = NORM_SPACE
1132 AVG_CAPITAL_WIDTH is an integer value (of type INT32) that gives the unweighted
1133 arithmetic mean of the absolute value of the width of each capital glyph in the
1134 font, in tenths of pixels, multiplied by -1 if the dominant writing direction
1135 for the font is right-to-left. This property applies to both Latin and
1136 non-Latin fonts. For Latin fonts, capitals are the glyphs A through Z. This
1137 property is usually used for font matching or substitution.
1139 AVG_CAPITAL_WIDTH can be calculated if not provided as a font property,
1140 according to the following algorithm:
1142 if (AVG_CAPITAL_WIDTH undefined) then
1143 if (capitals exist) then
1144 AVG_CAPITAL_WIDTH = ROUND (MEAN
1145 (ABS (width of each capital glyph)) * 10)
1146 * (if (dominant writing direction L-to-R) then 1 else -1)
1147 else AVG_CAPITAL_WIDTH undefined
1151 AVG_LOWERCASE_WIDTH is an integer value (of type INT32) that gives the
1152 unweighted arithmetic mean width of the absolute value of the width of each
1153 lowercase glyph in the font in tenths of pixels, multiplied by -1 if the
1154 dominant writing direction for the font is right-to-left. For Latin fonts,
1155 lowercase are the glyphs a through z. This property is usually used for font
1156 matching or substitution.
1158 Where appropriate, AVG_LOWERCASE_WIDTH can be approximated if not provided as a
1159 font property, according to the following algorithm:
1161 if (AVG_LOWERCASE_WIDTH undefined) then
1162 if (lowercase exists) then
1163 AVG_LOWERCASE_WIDTH = ROUND (MEAN
1164 (ABS (width of each lowercase glyph)) * 10)
1165 * (if (dominant writing direction L-to-R) then 1 else -1)
1166 else AVG_LOWERCASE_WIDTH undefined
1170 QUAD_WIDTH is an integer typographic metric (of type INT32) that gives the
1171 width of a quad (em) space.
1175 Because all typographic fixed spaces (em, en, and thin) are constant for a
1176 given font size (that is, they do not vary according to setwidth), the use of
1177 this font property has been deprecated. X clients that require typographic
1178 fixed space values are encouraged to discontinue use of QUAD_WIDTH and compute
1179 these values from other font properties (for example, PIXEL_SIZE). X clients
1180 that require a font-dependent width value should use either the FIGURE_WIDTH or
1181 one of the average character width font properties (AVERAGE_WIDTH,
1182 AVG_CAPITAL_WIDTH or AVG_LOWERCASE_WIDTH).
1186 FIGURE_WIDTH is an integer typographic metric (of type INT32) that gives the
1187 width of the tabular figures and the dollar sign, if suitable for tabular
1188 setting (all widths equal). For Latin fonts, these tabular figures are the
1189 Arabic numerals 0 through 9.
1191 FIGURE_WIDTH can be approximated if not supplied as a font property, according
1192 to the following algorithm:
1194 if (numerals and DOLLAR sign are defined & widths are equal) then
1195 FIGURE_WIDTH = width of DOLLAR
1196 else FIGURE_WIDTH property undefined
1200 SUPERSCRIPT_X is an integer value (of type INT32) that gives the recommended
1201 horizontal offset in pixels from the position point to the X origin of
1202 synthetic superscript text. If the current position point is at [X,Y], then
1203 superscripts should begin at [X + SUPERSCRIPT_X, Y - SUPERSCRIPT_Y].
1205 SUPERSCRIPT_X can be approximated if not provided as a font property, according
1206 to the following algorithm:
1208 if (SUPERSCRIPT_X undefined) then
1209 if (TANGENT(ITALIC_ANGLE) defined) then
1210 SUPERSCRIPT_X = ROUND((0.40 * CAP_HEIGHT) / TANGENT(ITALIC_ANGLE))
1211 else SUPERSCRIPT_X = ROUND(0.40 * CAP_HEIGHT)
1213 where TANGENT is a trigonometric function that returns the tangent of its
1214 argument, which is in 1/64 degrees.
1218 SUPERSCRIPT_Y is an integer value (of type INT32) that gives the recommended
1219 vertical offset in pixels from the position point to the Y origin of synthetic
1220 superscript text. If the current position point is at [X,Y], then superscripts
1221 should begin at [X + SUPERSCRIPT_X, Y - SUPERSCRIPT_Y].
1223 SUPERSCRIPT_Y can be approximated if not provided as a font property, according
1224 to the following algorithm:
1226 if (SUPERSCRIPT_Y undefined) then
1227 SUPERSCRIPT_Y = ROUND(0.40 * CAP_HEIGHT)
1231 SUBSCRIPT_X is an integer value (of type INT32) that gives the recommended
1232 horizontal offset in pixels from the position point to the X origin of
1233 synthetic subscript text. If the current position point is at [X,Y], then
1234 subscripts should begin at [X + SUBSCRIPT_X, Y + SUBSCRIPT_Y].
1236 SUBSCRIPT_X can be approximated if not provided as a font property, according
1237 to the following algorithm:
1239 if (SUBSCRIPT_X undefined) then
1240 if (TANGENT(ITALIC_ANGLE) defined) then
1241 SUBSCRIPT_X = ROUND((0.40 * CAP_HEIGHT) / TANGENT(ITALIC_ANGLE))
1242 else SUBSCRIPT_X = ROUND(0.40 * CAP_HEIGHT)
1246 SUBSCRIPT_Y is an integer value (of type INT32) that gives the recommended
1247 vertical offset in pixels from the position point to the Y origin of synthetic
1248 subscript text. If the current position point is at [X,Y], then subscripts
1249 should begin at [X + SUBSCRIPT_X, Y + SUBSCRIPT_Y].
1251 SUBSCRIPT_Y can be approximated if not provided as a font property, according
1252 to the following algorithm:
1254 if (SUBSCRIPT_Y undefined) then
1255 SUBSCRIPT_Y = ROUND(0.40 * CAP_HEIGHT)
1259 SUPERSCRIPT_SIZE is an integer value (of type INT32) that gives the recommended
1260 body size of synthetic superscripts to be used with this font, in pixels. This
1261 will generally be smaller than the size of the current font; that is,
1262 superscripts are imaged from a smaller font offset according to SUPERSCRIPT_X
1265 SUPERSCRIPT_SIZE can be approximated if not provided as a font property,
1266 according to the following algorithm:
1268 if (SUPERSCRIPT_SIZE undefined) then
1269 SUPERSCRIPT_SIZE = ROUND(0.60 * PIXEL_SIZE)
1273 SUBSCRIPT_SIZE is an integer value (of type INT32) that gives the recommended
1274 body size of synthetic subscripts to be used with this font, in pixels. As with
1275 SUPERSCRIPT_SIZE, this will generally be smaller than the size of the current
1276 font; that is, subscripts are imaged from a smaller font offset according to
1277 SUBSCRIPT_X and SUBSCRIPT_Y.
1279 SUBSCRIPT_SIZE can be approximated if not provided as a font property,
1280 according to the algorithm:
1282 if (SUBSCRIPT_SIZE undefined) then
1283 SUBSCRIPT_SIZE = ROUND(0.60 * PIXEL_SIZE)
1287 SMALL_CAP_SIZE is an integer value (of type INT32) that gives the recommended
1288 body size of synthetic small capitals to be used with this font, in pixels.
1289 Small capitals are generally imaged from a smaller font of slightly more
1290 weight. No offset [X,Y] is necessary.
1292 SMALL_CAP_SIZE can be approximated if not provided as a font property,
1293 according to the following algorithm:
1295 if (SMALL_CAP_SIZE undefined) then
1296 SMALL_CAP_SIZE = ROUND(PIXEL_SIZE * ((X_HEIGHT
1297 + ((CAP_HEIGHT - X_HEIGHT) / 3)) / CAP_HEIGHT))
1301 UNDERLINE_POSITION is an integer value (of type INT32) that gives the
1302 recommended vertical offset in pixels from the baseline to the top of the
1303 underline. If the current position point is at [X,Y], the top of the baseline
1304 is given by [X, Y + UNDERLINE_POSITION].
1306 UNDERLINE_POSITION can be approximated if not provided as a font property,
1307 according to the following algorithm:
1309 if (UNDERLINE_POSITION undefined) then
1310 UNDERLINE_POSITION = ROUND((maximum descent) / 2)
1312 where maximum descent is the maximum descent (below the baseline) in pixels of
1313 any glyph in the font.
1317 UNDERLINE_THICKNESS is an integer value (of type INT32) that gives the
1318 recommended underline thickness, in pixels.
1320 UNDERLINE_THICKNESS can be approximated if not provided as a font property,
1321 according to the following algorithm:
1323 CapStemWidth = average width of the stems of capitals
1324 if (UNDERLINE_THICKNESS undefined) then
1325 UNDERLINE_THICKNESS = CapStemWidth
1329 STRIKEOUT_ASCENT is an integer value (of type INT32) that gives the vertical
1330 ascent for boxing or voiding glyphs in this font. If the current position is at
1331 [X,Y] and the string extent is EXTENT, the upper-left corner of the strikeout
1332 box is at [X, Y - STRIKEOUT_ASCENT] and the lower-right corner of the box is at
1333 [X + EXTENT, Y + STRIKEOUT_DESCENT].
1335 STRIKEOUT_ASCENT can be approximated if not provided as a font property,
1336 according to the following algorithm:
1338 if (STRIKEOUT_ASCENT undefined)
1339 STRIKEOUT_ASCENT = maximum ascent
1341 where maximum ascent is the maximum ascent (above the baseline) in pixels of
1342 any glyph in the font.
1346 STRIKEOUT_DESCENT is an integer value (of type INT32) that gives the vertical
1347 descent for boxing or voiding glyphs in this font. If the current position is
1348 at [X,Y] and the string extent is EXTENT, the upper-left corner of the
1349 strikeout box is at [X, Y - STRIKEOUT_ASCENT] and the lower-right corner of the
1350 box is at [X + EXTENT, Y + STRIKEOUT_DESCENT].
1352 STRIKEOUT_DESCENT can be approximated if not provided as a font property,
1353 according to the following algorithm:
1355 if (STRIKEOUT_DESCENT undefined)
1356 STRIKEOUT_DESCENT = maximum descent
1358 where maximum descent is the maximum descent (below the baseline) in pixels of
1359 any glyph in the font.
1363 ITALIC_ANGLE is an integer value (of type INT32) that gives the nominal posture
1364 angle of the typeface design, in 1/64 degrees, measured from the glyph origin
1365 counterclockwise from the three o'clock position.
1367 ITALIC_ANGLE can be defaulted if not provided as a font property, according to
1368 the following algorithm:
1370 if (ITALIC_ANGLE undefined) then
1371 ITALIC_ANGLE = (90 * 64)
1375 CAP_HEIGHT is an integer value (of type INT32) that gives the nominal height of
1376 the capital letters contained in the font, as specified by the FOUNDRY or
1379 Certain clients require CAP_HEIGHT to compute scale factors and positioning
1380 offsets for synthesized glyphs where this information or designed glyphs are
1381 not explicitly provided by the font (for example, small capitals, superiors,
1382 inferiors, and so on). CAP_HEIGHT is also a critical factor in font matching
1385 CAP_HEIGHT can be approximated if not provided as a font property, according to
1386 the following algorithm:
1388 if (CAP_HEIGHT undefined) then
1389 if (Latin font) then
1390 CAP_HEIGHT = XCharStruct.ascent[glyph X]
1391 else if (capitals exist) then
1392 CAP_HEIGHT = XCharStruct.ascent[some unaccented capital glyph]
1393 else CAP_HEIGHT undefined
1397 X_HEIGHT is an integer value (of type INT32) that gives the nominal height
1398 above the baseline of the lowercase glyphs contained in the font, as specified
1399 by the FOUNDRY or typeface designer.
1401 As with CAP_HEIGHT, X_HEIGHT is required by certain clients to compute scale
1402 factors for synthesized small capitals where this information is not explicitly
1403 provided by the font resource. X_HEIGHT is a critical factor in font matching
1406 X_HEIGHT can be approximated if not provided as a font property, according to
1407 the following algorithm:
1409 if (X_HEIGHT undefined) then
1410 if (Latin font) then
1411 X_HEIGHT = XCharStruct.ascent[glyph x]
1412 else if (lowercase exists) then
1413 X_HEIGHT = XCharStruct.ascent[some unaccented lc glyph without an ascender]
1414 else X_HEIGHT undefined
1418 RELATIVE_SETWIDTH is an unsigned integer value (of type CARD32) that gives the
1419 coded proportionate width of the font, relative to all known fonts of the same
1420 typeface family, according to the type designer's or FOUNDRY's judgment.
1422 RELATIVE_SETWIDTH ranges from 10 to 90 or is 0 if undefined or unknown. The
1423 following reference values are defined:
1425 ┌────┬───────────────────┬────────────────────────────────────────────┐
1426 │Code│English Translation│Description │
1427 ├────┼───────────────────┼────────────────────────────────────────────┤
1428 │0 │Undefined │Undefined or unknown │
1429 ├────┼───────────────────┼────────────────────────────────────────────┤
1430 │10 │UltraCondensed │The lowest ratio of average width to height │
1431 ├────┼───────────────────┼────────────────────────────────────────────┤
1432 │20 │ExtraCondensed │ │
1433 ├────┼───────────────────┼────────────────────────────────────────────┤
1434 │30 │Condensed │Condensed, Narrow, Compressed, ... │
1435 ├────┼───────────────────┼────────────────────────────────────────────┤
1436 │40 │SemiCondensed │ │
1437 ├────┼───────────────────┼────────────────────────────────────────────┤
1438 │50 │Medium │Medium, Normal, Regular, ... │
1439 ├────┼───────────────────┼────────────────────────────────────────────┤
1440 │60 │SemiExpanded │SemiExpanded, DemiExpanded, ... │
1441 ├────┼───────────────────┼────────────────────────────────────────────┤
1443 ├────┼───────────────────┼────────────────────────────────────────────┤
1444 │80 │ExtraExpanded │ExtraExpanded, Wide, ... │
1445 ├────┼───────────────────┼────────────────────────────────────────────┤
1446 │90 │UltraExpanded │The highest ratio of average width to height│
1447 └────┴───────────────────┴────────────────────────────────────────────┘
1449 RELATIVE_SETWIDTH can be defaulted if not provided as a font property,
1450 according to the following algorithm:
1452 if (RELATIVE_SETWIDTH undefined) then
1453 RELATIVE_SETWIDTH = 50
1455 For polymorphic fonts, RELATIVE_SETWIDTH is not necessarily a linear function
1456 of the font's setwidth axis.
1458 X clients that want to obtain a calculated proportionate width of the font
1459 (that is, a font-independent way of identifying the proportionate width across
1460 all fonts and all font vendors) can use the following algorithm:
1462 SETWIDTH = AVG_CAPITAL_WIDTH / (CAP_HEIGHT * 10)
1464 where SETWIDTH is a real number with zero being the narrowest calculated
1469 RELATIVE_WEIGHT is an unsigned integer value (of type CARD32) that gives the
1470 coded weight of the font, relative to all known fonts of the same typeface
1471 family, according to the type designer's or FOUNDRY's judgment.
1473 RELATIVE_WEIGHT ranges from 10 to 90 or is 0 if undefined or unknown. The
1474 following reference values are defined:
1476 ┌────┬────────────────┬───────────────────────────────────────────────────────┐
1477 │Code│English │Description │
1479 ├────┼────────────────┼───────────────────────────────────────────────────────┤
1480 │0 │Undefined │Undefined or unknown │
1481 ├────┼────────────────┼───────────────────────────────────────────────────────┤
1482 │10 │UltraLight │The lowest ratio of stem width to height │
1483 ├────┼────────────────┼───────────────────────────────────────────────────────┤
1485 ├────┼────────────────┼───────────────────────────────────────────────────────┤
1487 ├────┼────────────────┼───────────────────────────────────────────────────────┤
1488 │40 │SemiLight │SemiLight, Book, ... │
1489 ├────┼────────────────┼───────────────────────────────────────────────────────┤
1490 │50 │Medium │Medium, Normal, Regular,... │
1491 ├────┼────────────────┼───────────────────────────────────────────────────────┤
1492 │60 │SemiBold │SemiBold, DemiBold, ... │
1493 ├────┼────────────────┼───────────────────────────────────────────────────────┤
1495 ├────┼────────────────┼───────────────────────────────────────────────────────┤
1496 │80 │ExtraBold │ExtraBold, Heavy, ... │
1497 ├────┼────────────────┼───────────────────────────────────────────────────────┤
1498 │90 │UltraBold │UltraBold, Black, ..., the highest ratio of stem width │
1500 └────┴────────────────┴───────────────────────────────────────────────────────┘
1502 RELATIVE_WEIGHT can be defaulted if not provided as a font property, according
1503 to the following algorithm:
1505 if (RELATIVE_WEIGHT undefined) then
1506 RELATIVE_WEIGHT = 50
1508 For polymorphic fonts, RELATIVE_WEIGHT is not necessarily a linear function of
1509 the font's weight axis.
1513 Calculated WEIGHT is an unsigned integer value (of type CARD32) that gives the
1514 calculated weight of the font, computed as the ratio of capital stem width to
1515 CAP_HEIGHT, in the range 0 to 1000, where 0 is the lightest weight.
1517 WEIGHT can be calculated if not supplied as a font property, according to the
1518 following algorithm:
1520 CapStemWidth = average width of the stems of capitals
1521 if (WEIGHT undefined) then
1522 WEIGHT = ROUND ((CapStemWidth * 1000) / CAP_HEIGHT)
1524 A calculated value for weight is necessary when matching fonts from different
1525 families because both the RELATIVE_WEIGHT and the WEIGHT_NAME are assigned by
1526 the typeface supplier, according to its tradition and practice, and therefore,
1527 are somewhat subjective. Calculated WEIGHT provides a font-independent way of
1528 identifying the weight across all fonts and all font vendors.
1532 RESOLUTION is an integer value (of type INT32) that gives the resolution for
1533 which this font was created, measured in 1/100 pixels per point.
1537 As independent horizontal and vertical design resolution components are
1538 required to accommodate displays with nonsquare aspect ratios, the use of this
1539 font property has been deprecated, and independent RESOLUTION_X and
1540 RESOLUTION_Y font name fields/properties have been defined (see sections
1541 3.1.2.9 and 3.1.2.10). X clients are encouraged to discontinue use of the
1542 RESOLUTION property and are encouraged to use the appropriate X,Y resolution
1543 properties, as required.
1547 FONT is a string (of type ATOM) that gives the full XLFD name of the font-that
1548 is, the value can be used to open another instance of the same font.
1550 If not provided, the FONT property cannot be calculated.
1554 FACE_NAME is a human-understandable string (of type ATOM) that gives the full
1555 device-independent typeface name, including the owner, weight, slant, set, and
1556 so on but not the resolution, size, and so on. This property may be used as
1557 feedback during font selection.
1559 FACE_NAME cannot be calculated or approximated if not provided as a font
1564 FULL_NAME is the same as FACE_NAME. Its use is deprecated, but it is found on
1569 COPYRIGHT is a human-understandable string (of type ATOM) that gives the
1570 copyright information of the legal owner of the digital font data.
1572 This information is a required component of a font but is independent of the
1573 particular format used to represent it (that is, it cannot be captured as a
1574 comment that could later be thrown away for efficiency reasons).
1576 COPYRIGHT cannot be calculated or approximated if not provided as a font
1581 NOTICE is a human-understandable string (of type ATOM) that gives the copyright
1582 information of the legal owner of the font design or, if not applicable, the
1583 trademark information for the typeface FAMILY_NAME.
1585 Typeface design and trademark protection laws vary from country to country, the
1586 USA having no design copyright protection currently while various countries in
1587 Europe offer both design and typeface family name trademark protection. As with
1588 COPYRIGHT, this information is a required component of a font but is
1589 independent of the particular format used to represent it.
1591 NOTICE cannot be calculated or approximated if not provided as a font property.
1595 DESTINATION is an unsigned integer code (of type CARD32) that gives the font
1596 design destination, that is, whether it was designed as a screen proofing font
1597 to match printer font glyph widths (WYSIWYG), as an optimal video font
1598 (possibly with corresponding printer font) for extended screen viewing (video
1601 The font design considerations are very different, and at current display
1602 resolutions, the readability and legibility of these two kinds of screen fonts
1603 are very different. DESTINATION allows publishing clients that use X to model
1604 the printed page and video text clients, such as on-line documentation
1605 browsers, to query for X screen fonts that suit their particular requirements.
1607 The encoding is as follows:
1609 ┌────┬────────────┬───────────────────────────────────────────────────────────┐
1610 │Code│English │Description │
1612 ├────┼────────────┼───────────────────────────────────────────────────────────┤
1613 │0 │WYSIWYG │The font is optimized to match the typographic design and │
1614 │ │ │metrics of an equivalent printer font. │
1615 ├────┼────────────┼───────────────────────────────────────────────────────────┤
1616 │1 │Video text │The font is optimized for screen legibility and │
1618 └────┴────────────┴───────────────────────────────────────────────────────────┘
1622 FONT_TYPE is a human-understandable string (of type ATOM) that describes the
1623 format of the font data as they are read from permanent storage by the current
1624 font source. It is a static attribute of the source data. It can be used by
1625 clients to select a type of bitmap or outline font without regard to the
1626 rasterizer used to render the font.
1628 Predefined values are as follows:
1630 ┌──────────┬──────────────────────────────────────────────────────────────────┐
1631 │Value │When applicable │
1632 ├──────────┼──────────────────────────────────────────────────────────────────┤
1633 │ │Hand-tuned bitmap fonts. Some attempt has been made to optimize │
1634 │"Bitmap" │the visual appearance of the font for the requested size and │
1636 ├──────────┼──────────────────────────────────────────────────────────────────┤
1637 │ │All bitmap format fonts that cannot be described as "Bitmap", that│
1638 │"Prebuilt"│is, handtuned. For example, a bitmap format font that was │
1639 │ │generated mechanically using a scalable font rasterizer would be │
1640 │ │considered "Prebuilt", not "Bitmap". │
1641 ├──────────┼──────────────────────────────────────────────────────────────────┤
1642 │"Type 1" │Any Type 1 font. │
1643 ├──────────┼──────────────────────────────────────────────────────────────────┤
1644 │"TrueType"│Any TrueType font. │
1645 ├──────────┼──────────────────────────────────────────────────────────────────┤
1646 │"Speedo" │Any Speedo font. │
1647 ├──────────┼──────────────────────────────────────────────────────────────────┤
1648 │"F3" │Any F3 font. │
1649 └──────────┴──────────────────────────────────────────────────────────────────┘
1651 Other values may be registered with the X Consortium.
1655 FONT_VERSION is a human-understandable string (of type ATOM) that describes the
1656 formal or informal version of the font. None is a valid value.
1660 RASTERIZER_NAME is a human-understandable string (of type ATOM) that is the
1661 specific name of the rasterizer that has performed some rasterization operation
1662 (such as scaling from outlines) on this font.
1664 To define a RASTERIZER_NAME, the following format is recommended:
1666 RasterizerName OrganizationId Space Rasterizer
1668 OrganizationId STRING8—the X Registry ORGANIZATION name of the rasterizer
1669 ::= implementor or maintainer.
1670 the case-sensitive, human-understandable product name of the
1671 Rasterizer ::= rasterizer. Words within this name should be separated by a
1673 Space ::= OCTET−" " (SPACE)
1677 X Consortium Bit Scaler
1678 X Consortium Type 1 Rasterizer
1679 X Consortium Speedo Rasterizer
1683 If RASTERIZER_NAME is not defined, or is None, no rasterization operation has
1684 been applied to the FONT_TYPE.
1688 RASTERIZER_VERSION is a human-understandable string (of type ATOM) that
1689 represents the formal or informal version of a font rasterizer. The
1690 RASTERIZER_VERSION should match the corresponding product version number known
1691 to users, when applicable.
1695 For a font with a transformation matrix, RAW_ASCENT is the font ascent in 1000
1696 pixel metrics (see Metrics and Font Properties).
1700 For a font with a transformation matrix, RAW_DESCENT is the font descent in
1701 1000 pixel metrics (see Metrics and Font Properties).
1705 For a font with a transformation matrix, all font properties that represent
1706 horizontal or vertical sizes or displacements will be accompanied by a new
1707 property, named as the original except prefixed with "RAW_", that is computed
1708 as described in Metrics and Font Properties.
1712 AXIS_NAMES is a list of all the names of the axes for a polymorphic font,
1713 separated by a null (0) byte. These names are suitable for presentation in a
1714 user interface (see section 6).
1718 AXIS_LIMITS is a list of integers, two for each axis, giving the minimum and
1719 maximum allowable values for that axis of a polymorphic font (see Polymorphic
1724 AXIS_TYPES is like AXIS_NAMES, but can be registered as having specific
1725 semantics (see section 6).
1727 Built-in Font Property Atoms
1729 The following font property atom definitions were predefined in the initial
1730 version of the core protocol:
1732 ┌───────────────────────┬───────────────────┐
1733 │Font Property/Atom Name│Property Type │
1734 ├───────────────────────┼───────────────────┤
1736 ├───────────────────────┼───────────────────┤
1737 │NORM_SPACE │INT32 │
1738 ├───────────────────────┼───────────────────┤
1740 ├───────────────────────┼───────────────────┤
1742 ├───────────────────────┼───────────────────┤
1743 │SUPERSCRIPT_X │INT32 │
1744 ├───────────────────────┼───────────────────┤
1745 │SUPERSCRIPT_Y │INT32 │
1746 ├───────────────────────┼───────────────────┤
1747 │SUBSCRIPT_X │INT32 │
1748 ├───────────────────────┼───────────────────┤
1749 │SUBSCRIPT_Y │INT32 │
1750 ├───────────────────────┼───────────────────┤
1751 │UNDERLINE_POSITION │INT32 │
1752 ├───────────────────────┼───────────────────┤
1753 │UNDERLINE_THICKNESS │INT32 │
1754 ├───────────────────────┼───────────────────┤
1755 │STRIKEOUT_ASCENT │INT32 │
1756 ├───────────────────────┼───────────────────┤
1757 │STRIKEOUT_DESCENT │INT32 │
1758 ├───────────────────────┼───────────────────┤
1759 │FONT_ASCENT │INT32 │
1760 ├───────────────────────┼───────────────────┤
1761 │FONT_DESCENT │INT32 │
1762 ├───────────────────────┼───────────────────┤
1763 │ITALIC_ANGLE │INT32 │
1764 ├───────────────────────┼───────────────────┤
1766 ├───────────────────────┼───────────────────┤
1767 │QUAD_WIDTH │INT32 −^deprecated │
1768 ├───────────────────────┼───────────────────┤
1770 ├───────────────────────┼───────────────────┤
1771 │POINT_SIZE │INT32 │
1772 ├───────────────────────┼───────────────────┤
1773 │RESOLUTION │CARD32 −^deprecated│
1774 ├───────────────────────┼───────────────────┤
1776 ├───────────────────────┼───────────────────┤
1777 │FULL_NAME │ATOM −^deprecated │
1778 ├───────────────────────┼───────────────────┤
1779 │FAMILY_NAME │ATOM │
1780 ├───────────────────────┼───────────────────┤
1781 │DEFAULT_CHAR │CARD32 │
1782 └───────────────────────┴───────────────────┘
1784 Chapter 4. Matrix Transformations
1788 Metrics and Font Properties
1790 An XLFD name presented to the server can have the POINT_SIZE or PIXEL_SIZE
1791 field begin with the character "[". If the first character of the field is "[",
1792 the character must be followed with ASCII representations of four floating
1793 point numbers and a trailing "]", with white space separating the numbers and
1794 optional white space separating the numbers from the "[" and "]" characters.
1795 Numbers use standard floating point syntax but use the character "~" to
1796 represent a minus sign in the mantissa or exponent.
1798 The BNF for a matrix transformation string is as follows:
1800 MatrixString LeftBracket OptionalSpace Float Space Float Space Float Space
1801 ::= Float OptionalSpace RightBracket
1802 OptionalSpace "" | Space
1804 Space ::= SpaceChar | SpaceChar Space
1805 Float ::= Mantissa | Mantissa Exponent
1806 Mantissa ::= Sign Number | Number
1807 Sign ::= Plus | Tilde
1808 Number ::= Integer | Integer Dot Integer | Dot Integer
1809 Integer ::= Digit | Digit Integer
1810 Digit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
1811 Exponent ::= "e" SignedInteger | "E" SignedInteger
1812 SignedInteger Sign Integer | Integer
1814 LeftBracket OCTET − "[" (LEFT SQUARE BRACKET)
1816 RightBracket OCTET − "]" (RIGHT SQUARE BRACKET)
1818 SpaceChar ::= OCTET − " " (SPACE)
1819 Tilde ::= OCTET − "˜" (TILDE)
1820 Plus ::= OCTET − "+" (PLUS)
1821 Dot ::= OCTET − "." (FULL STOP)
1823 The string "[a b c d]" represents a graphical transformation of the glyphs in
1824 the font by the matrix
1830 All transformations occur around the origin of the glyph. The relationship
1831 between the current scalar values and the matrix transformation values is that
1832 the scalar value "N" in the POINT_SIZE field produces the same glyphs as the
1833 matrix "[N/10 0 0 N/10]" in that field, and the scalar value "N" in the
1834 PIXEL_SIZE field produces the same glyphs as the matrix "[N*RESOLUTION_X/
1835 RESOLUTION_Y 0 0 N]" in that field.
1837 If matrices are specified for both the POINT_SIZE and PIXEL_SIZE, they must
1838 bear the following relationship to each other within an implementation-specific
1841 PIXEL_SIZE_MATRIX = [Sx 0 0 Sy] * POINT_SIZE_MATRIX
1845 Sx = RESOLUTION_X / 72.27
1847 Sy = RESOLUTION_Y / 72.27
1849 If either the POINT_SIZE or PIXEL_SIZE field is unspecified (either "0" or
1850 wildcarded), the preceding formulas can be used to compute one from the other.
1852 Metrics and Font Properties
1854 In this section, the phrase "1000 pixel metrics" means the metrics that would
1855 be obtained if the rasterizer took the base untransformed design used to
1856 generate the transformed font and scaled it linearly to a height of 1000
1857 pixels, with no rotation component. Note that there may be no way for the
1858 application to actually request this font since the rasterizer may use
1859 different outlines or rasterization techniques at that size from the ones used
1860 to generate the transformed font.
1862 Notes on properties and metrics:
1864 The per-char ink metrics (lbearing, rbearing, ascent, and descent) represent
1865 the ink extent of the transformed glyph around its origin.
1867 The per-char width is the x component of the transformed character width.
1869 The font ascent and descent are the y component of the transformed font ascent
1872 The FONT property returns a name reflecting the matrix being used-that is, the
1873 name returned can be used to open another instance of the same font. The
1874 returned name is not necessarily an exact copy of the requested name. If, for
1875 example, the user requests
1877 -misc-fixed-medium-r-normal--0-[2e1 0 0.0 +10.0]-72-72-c-0-iso8859-1
1879 the resulting FONT property might be
1881 -misc-fixed-medium-r-normal--[19.9 0 0 10]-[20 0 0 10]-72-72-c-0-iso8859-1
1883 The FONT property will always include matrices in both the PIXEL_SIZE and the
1886 To allow accurate client positioning of transformed characters, the attributes
1887 field of the XCharInfo contains the width of the character in 1000 pixel
1888 metrics. This attributes field should be interpreted as a signed integer.
1890 There will always be 2 new font properties defined, RAW_ASCENT and RAW_DESCENT,
1891 that hold the ascent and descent in 1000 pixel metrics.
1893 All font properties that represent horizontal widths or displacements have as
1894 their value the x component of the transformed width or displacement. All font
1895 properties that represent vertical heights or displacements have as their value
1896 the y component of the transformed height or displacement. Each such property
1897 will be accompanied by a new property, named as the original except prefixed
1898 with "RAW_", that gives the value of the width, height, or displacement in 1000
1901 Chapter 5. Scalable Fonts
1903 The XLFD is designed to support scalable fonts. A scalable font is a font
1904 source from which instances of arbitrary size can be derived. A scalable font
1905 source might be one or more outlines together with zero or more hand-tuned
1906 bitmap fonts at specific sizes and resolutions, or it might be a programmatic
1907 description together with zero or more bitmap fonts, or some other format
1908 (perhaps even just a single bitmap font).
1910 The following definitions are useful for discussing scalable fonts:
1912 Well-formed XLFD pattern
1914 ● Well-formed XLFD pattern
1916 A pattern string containing 14 hyphens, one of which is the first character
1917 of the pattern. Wildcard characters are permitted in the fields of a
1918 well-formed XLFD pattern.
1920 ● Scalable font name
1922 A well-formed XLFD pattern containing no wildcards and containing the digit
1923 "0" in the PIXEL_SIZE, POINT_SIZE, and AVERAGE_WIDTH fields.
1927 The XLFD fields PIXEL_SIZE, POINT_SIZE, RESOLUTION_X, RESOLUTION_Y, and
1932 The result of replacing the scalable fields of a font name with values to
1933 yield a font name that could actually be produced from the font source. A
1934 scaling engine is permitted, but not required, to interpret the scalable
1935 fields in font names to support anamorphic scaling.
1939 The list of names that would be returned by an X server for a ListFonts
1940 protocol request on the pattern "*" if there were no protocol restrictions
1941 on the total number of names returned.
1943 The global list consists of font names derived from font sources. If a single
1944 font source can support multiple character sets (specified in the
1945 CHARSET_REGISTRY and CHARSET_ENCODING fields), each such character set should
1946 be used to form a separate font name in the list. For a nonscalable font
1947 source, the simple font name for each character set is included in the global
1948 list. For a scalable font source, a scalable font name for each character set
1949 is included in the list. In addition to the scalable font name, specific
1950 derived instance names may also be included in the list. The relative order of
1951 derived instances with respect to the scalable font name is not constrained.
1952 Finally, font name aliases may also be included in the list. The relative order
1953 of aliases with respect to the real font name is not constrained.
1955 The values of the RESOLUTION_X and RESOLUTION_Y fields of a scalable font name
1956 are implementation dependent, but to maximize backward compatibility, they
1957 should be reasonable nonzero values, for example, a resolution close to that
1958 provided by the screen (in a single-screen server). Because some existing
1959 applications rely on seeing a collection of point and pixel sizes, server
1960 vendors are strongly encouraged in the near term to provide a mechanism for
1961 including, for each scalable font name, a set of specific derived instance
1962 names. For font sources that contain a collection of hand-tuned bitmap fonts,
1963 including names of these instances in the global list is recommended and
1966 The X protocol request OpenFont on a scalable font name returns a font
1967 corresponding to an implementation-dependent derived instance of that font
1970 The X protocol request ListFonts on a well-formed XLFD pattern returns the
1971 following. Starting with the global list, if the actual pattern argument has
1972 values containing no wildcards in scalable fields, then substitute each such
1973 field into the corresponding field in each scalable font name in the list. For
1974 each resulting font name, if the remaining scalable fields cannot be replaced
1975 with values to produce a derived instance, remove the font name from the list.
1976 Now take the modified list, and perform a simple pattern match against the
1977 pattern argument. ListFonts returns the resulting list.
1979 For example, given the global list:
1981 -Linotype-Times-Bold-I-Normal--0-0-100-100-P-0-ISO8859-1
1982 -Linotype-Times-Bold-R-Normal--0-0-100-100-P-0-ISO8859-1
1983 -Linotype-Times-Medium-I-Normal--0-0-100-100-P-0-ISO8859-1
1984 -Linotype-Times-Medium-R-Normal--0-0-100-100-P-0-ISO8859-1
1986 a ListFonts request with the pattern:
1988 -*-Times-*-R-Normal--*-120-100-100-P-*-ISO8859-1
1992 -Linotype-Times-Bold-R-Normal--0-120-100-100-P-0-ISO8859-1
1993 -Linotype-Times-Medium-R-Normal--0-120-100-100-P-0-ISO8859-1
1995 ListFonts on a pattern containing wildcards that is not a well-formed XLFD
1996 pattern is only required to return the list obtained by performing a simple
1997 pattern match against the global list. X servers are permitted, but not
1998 required, to use a more sophisticated matching algorithm.
2000 Chapter 6. Polymorphic Fonts
2002 Fonts that can be varied in ways other than size or resolution are called
2003 polymorphic fonts. Multiple Master Type 1 font programs are one type of a
2004 polymorphic font. Current examples of axes along which the fonts can be varied
2005 are width, weight, and optical size; others might include formality or
2008 To support polymorphic fonts, special values indicating variability are defined
2009 for the following XLFD fields:
2019 The string "0" is the special polymorphic value. In the WEIGHT_NAME, SLANT, or
2020 SETWIDTH_NAME field, "0" must be the entire field. There may be multiple
2021 polymorphic values in the ADD_STYLE_NAME field. They are surrounded by "[" and
2022 "]" and separated by a Space, as "[0\00]". The polymorphic values may coexist
2023 with other data in the field. It is recommended that the polymorphic values be
2024 at the end of the ADD_STYLE_NAME field.
2026 The font-matching algorithms for a font with polymorphic fields are identical
2027 to the matching algorithms for a font with scalable fields.
2029 There are three new font properties to describe the axes of variation,
2030 AXIS_NAMES, AXIS_LIMITS, and AXIS_TYPES. AXIS_NAMES is a list of all the names
2031 of the axes for the font, separated by a null (0) byte. These names are
2032 suitable for presentation in a user interface. AXIS_LIMITS is a list of
2033 integers, two for each axis, giving the minimum and maximum allowable values
2034 for that axis. AXIS_TYPES is like AXIS_NAMES, but can be registered as having
2037 The axes are listed in the properties in the same order as they appear in the
2038 font name. They are matched with font name fields by looking for the special
2039 polymorphic values in the font name.
2043 The Adobe Myriad MM font program has width and weight axes. Weight can vary
2044 from 215 to 830, and width from 300 to 700.
2047 -Adobe-Myriad MM-0-R-0--0-0-0-0-P-0-ISO8859-1
2053 Adobe-Weight, Adobe-Width
2054 Sample derived instance:
2055 -Adobe-Myriad MM-412-R-575--*-120-100-100-P-*-ISO8859-1
2057 The Adobe Minion MM Italic font program has width, weight, and optical size
2061 -Adobe-Minion MM-0-I-0-[0]-0-0-0-0-P-0-ISO8859-1
2063 Weight, Width, Optical size
2065 345, 620, 450, 600, 6, 72
2067 Adobe-Weight, Adobe-Width, Adobe-OpticalSize
2068 Sample derived instance:
2069 -Adobe-Minion MM-550-I-480-[18]-*-180-100-100-P-*-ISO8859-1
2071 The Adobe Minion MM Swash Italic font program has the same axes and values.
2072 This shows how "[0]" in the ADD_STYLE_NAME field can coexist with other words.
2075 -Adobe-Minion MM-0-I-0-Swash[0]-0-0-0-0-P-0-ISO8859-1
2077 Weight, Width, Optical size
2079 345, 620, 450, 600, 6, 72
2081 Adobe-Weight, Adobe-Width, Adobe-OpticalSize
2082 Sample derived instance:
2083 -Adobe-Minion MM-550-I-480-Swash[18]-*-180-100-100-P-*-ISO8859-1
2085 The XYZ Abc font, a hypothetical font, has optical size and x-height axes. This
2086 shows how there can be more than one polymorphic value in the ADD_STYLE_NAME
2090 -XYZ-Abc-Medium-R-Normal-[0 0]-0-0-0-0-P-0-ISO8859-1
2092 Optical size, X-height
2096 XYZ-OpticalSize, XYZ-Xheight
2097 Sample derived instance:
2098 -XYZ-Abc-Medium-R-Normal-[14 510]-*-140-100-100-P-*-ISO8859-1
2100 If an axis allows negative values, a client requests a negative value by using
2101 "~" (TILDE) as a minus sign.
2103 Axis types can be registered with the X Consortium, along with their semantics.
2105 If a font name that contains the polymorphic value or a wildcard in a
2106 polymorphic field is presented to a font source, the font source is free to
2107 substitute any value that is convenient. However, font sources should try to
2108 use a value that would be considered normal or medium for the particular font.
2109 For example, if an optical size variable is unresolved, the font source should
2110 provide a value appropriate to the size of the font.
2112 The result of specifying an out-of-range value for a polymorphic field is
2113 undefined. The font source may treat this as a BadName error, treat the value
2114 as if it were the closest legal value, or extrapolate to try to accommodate the
2117 Chapter 7. Affected Elements of Xlib and the X Protocol
2119 The following X protocol requests must support the XLFD conventions:
2121 ● OpenFont - for the name argument
2123 ● ListFonts - for the pattern argument
2125 ● ListFontsWithInfo - for the pattern argument
2127 In addition, the following Xlib functions must support the XLFD conventions:
2129 ● XLoadFont - for the name argument
2131 ● XListFontsWithInfo - for the pattern argument
2133 ● XLoadQueryFont - for the name argument
2135 ● XListFonts - for the pattern argument
2137 Chapter 8. BDF Conformance
2141 XLFD Conformance Requirements
2142 FONT_ASCENT, FONT_DESCENT, and DEFAULT_CHAR
2148 The bitmap font distribution and interchange format adopted by the X Consortium
2149 (BDF V2.1) provides a general mechanism for identifying the font name of an X
2150 font and a variable list of font properties, but it does not mandate the syntax
2151 or semantics of the font name or the semantics of the font properties that
2152 might be provided in a BDF font. This section identifies the requirements for
2153 BDF fonts that conform to XLFD.
2155 XLFD Conformance Requirements
2157 A BDF font conforms to the XLFD specification if and only if the following
2158 conditions are satisfied:
2160 ● The value for the BDF item FONT conforms to the syntax and semantic
2161 definition of a XLFD FontName string.
2163 ● The FontName begins with the X FontNameRegistry prefix: "-".
2165 ● All XLFD FontName fields are defined.
2167 ● Any FontProperties provided conform in name and semantics to the XLFD
2168 FontProperty definitions.
2170 A simple method of testing for conformance would entail verifying that the
2171 FontNameRegistry prefix is the string "-", that the number of field delimiters
2172 in the string and coded field values are valid, and that each font property
2173 name either matches a standard XLFD property name or follows the definition of
2176 FONT_ASCENT, FONT_DESCENT, and DEFAULT_CHAR
2178 FONT_ASCENT, FONT_DESCENT, and DEFAULT_CHAR are provided in the BDF
2179 specification as properties that are moved to the XFontStruct by the BDF font
2180 compiler in generating the X server-specific binary font encoding. If present,
2181 these properties shall comply with the following semantic definitions.
2185 FONT_ASCENT is an integer value (of type INT32) that gives the recommended
2186 typographic ascent above the baseline for determining interline spacing.
2187 Specific glyphs of the font may extend beyond this. If the current position
2188 point for line n is at [X,Y], then the origin of the next line m = n + 1
2189 (allowing for a possible font change) is [X, Y + FONT_DESCENTn + FONT_ASCENTm].
2191 FONT_ASCENT can be approximated if not provided as a font property, according
2192 to the following algorithm:
2194 if (FONT_ASCENT undefined) then
2195 FONT_ASCENT = maximum ascent
2197 where maximum ascent is the maximum ascent (above the baseline) in pixels of
2198 any glyph in the font.
2202 FONT_DESCENT is an integer value (of type INT32) that gives the recommended
2203 typographic descent below the baseline for determining interline spacing.
2204 Specific glyphs of the font may extend beyond this. If the current position
2205 point for line n is at [X,Y], then the origin of the next line m = n+1
2206 (allowing for a possible font change) is [X, Y + FONT_DESCENTn + FONT_ASCENTm].
2208 The logical extent of the font is inclusive between the Y-coordinate values: Y
2209 - FONT_ASCENT and Y + FONT_DESCENT + 1.
2211 FONT_DESCENT can be approximated if not provided as a font property, according
2212 to the following algorithm:
2214 if (FONT_DESCENT undefined) then
2215 FONT_DESCENT = maximum descent
2217 where maximum descent is the maximum descent (below the baseline) in pixels of
2218 any glyph in the font.
2222 The DEFAULT_CHAR is an unsigned integer value (of type CARD32) that specifies
2223 the index of the default character to be used by the X server when an attempt
2224 is made to display an undefined or nonexistent character in the font. (For a
2225 font using a 2-byte matrix format, the index bytes are encoded in the integer
2226 as byte1 * 65536 + byte2.) If the DEFAULT_CHAR itself specifies an undefined or
2227 nonexistent character in the font, then no display is performed.
2229 DEFAULT_CHAR cannot be approximated if not provided as a font property.