Supporting Scalable Fonts in the XLFD Public Review Draft (Send comments to fonts@expo.lcs.mit.edu) The following changes to the X Logical Font Description Conventions are to support naming of scalable fonts and instances of scalable fonts. DEFINITIONS Font source: An object or set of objects from which fonts are realized. A font source might be a bitmap font, or it might be one or more outlines together with zero or more hand-tuned bitmap fonts at specific sizes and resolutions, or a programmatic description together with zero or more bitmap fonts, or some other format. Wildcards: The characters "*" and "?". Well-formed XLFD pattern: A pattern containing 14 hyphens, one of which is the the first character of the pattern. Wildcards are permitted. Scalable fontname: A well-formed XLFD pattern containing no wildcards and containing "0" in the PIXEL_SIZE, POINT_SIZE, and AVERAGE_WIDTH fields. Scalable fields: The XLFD fields PIXEL_SIZE, POINT_SIZE, RESOLUTION_X, RESOLUTION_Y, and AVERAGE_WIDTH. Derived instance: The result of replacing the scalable fields of a fontname with values to yield a fontname that could actually be produced from the font source. A scaling engine is permitted, but not required, to interpret the scalable fields in fontnames to support anamorphic scaling. Global list: The list of names that would be returned by a ListFonts on the pattern "*" if there were no protocol restrictions on the total number of names returned. SEMANTICS OpenFont on any pattern is equivalent to invoking ListFonts with that pattern and using the first fontname returned. OpenFont on a scalable fontname returns a font corresponding to an implementation-dependent derived instance of that fontname. The global list consists of fontnames derived from font sources. If a single font source can be used to generate multiple XLFD CharSets, each such CharSet should be used to form a separate fontname (or set of fontnames) in the list. For a nonscalable font source, the simple fontname (one for each CharSet) is included in the global list. For a scalable font source, the scalable fontname is included in the list. In addition to the scalable fontname, specific derived instance names for the scalable font can also be included in the list. The relative order of derived instances with respect to the scalable fontname is not constrained. Finally, fontname aliases can also be included in the list. The relative order of aliases with respect to the "real" fontname is not constrained. The values of the RESOLUTION_X and RESOLUTION_Y fields of a scalable fontname are implementation dependent, but to maximize backward compatibility they should be reasonable non-zero values, e.g., a resolution close to that provided by the screen (in a single-screen server). To maximize backward compatibility, server vendors are strongly encouraged in the near term to provide a mechanism for including derived instances of scalable fonts in the global list, since some existing applications rely on seeing a collection of point/pixel sizes for reasonable operation. For font sources that contain a collection of hand-tuned bitmap fonts, including the names of these instances in the global list is recommended and sufficient. ListFonts on a pattern containing wildcards that is not a well-formed XLFD pattern returns (a prefix of) the list obtained by performing a simple pattern match against the global list. Servers are permitted, but not required, to do something more "intelligent". ListFonts on a well-formed XLFD pattern returns the following. Start with the global list. If the actual pattern argument has values containing no wildcards in scalable fields, then substitute each such field into the corresponding field in each scalable fontname in the list. For each resulting fontname, if the remaining scalable fields cannot be replaced with values to produce a derived instance, remove the fontname from the list. Now take the modified list, and perform a simple pattern match against the pattern argument. ListFonts returns the resulting list.