XMFONTLIST(3)

πŸ“¦
version 2.3.8 Β· 3 versions
, in arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– XmFontList πŸ’–

okay bestie, so this is XmFontList(library call) β€” the manual page for the XmFontList data type. it's giving font-list core energy and we're gonna get into it. πŸŽ€


✨ NAME ✨

XmFontList β€” the data type for a font list. that's it, that's the whole name, she's simple and iconic like that. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <Xm/Xm.h>

like, that's the whole vibe. one include and you're in. πŸ¦‹


πŸ’… DESCRIPTION πŸ’…

so XmFontList is literally the data type for a font list. no cap. and a font list is made up of font list entries. each entry holds either a font, or a font set (which is just a little group of fonts, bestie, a font friend group if you will 🫢), and each entry gets identified with a tag. the tag is optional though β€” she's flexible. and if that tag is NULL, it just gets set to XmFONTLIST_DEFAULT_TAG. automatic. slay.

and okay, important lore: the value of XmFONTLIST_DEFAULT_TAG is XmFONTLIST_DEFAULT_TAG_STRING. write that down. ✨


🌈 how a font list entry actually gets picked 🌈

when a compound string gets displayed, the font list element tag of the compound string segment gets matched up with a font list entry tag in the font list, and whichever entry matches is the one that displays the compound string. it's a whole matchmaking situation, honestly. here's the algorithm, in order:

  • the first font list entry whose tag matches the tag of the compound string segment gets used. first come, first served, periodt.
  • if no match was found, and the tag of the compound string segment is XmFONTLIST_DEFAULT_TAG, then the first font list entry whose tag matches the tag that would result from creating an entry with XmSTRING_DEFAULT_CHARSET gets used. for example β€” and this is the example from the page, not me making stuff up β€” if creating an entry with XmSTRING_DEFAULT_CHARSET would result in the tag ISO8859-1, then the compound string segment tag XmFONTLIST_DEFAULT_TAG matches the font list entry tag ISO8859-1. okay? okay. πŸ’–
  • if no match was found, and the tag of the compound string segment matches the tag that would result from creating a segment with XmSTRING_DEFAULT_CHARSET, then the first font list entry whose tag is XmFONTLIST_DEFAULT_TAG gets used. (yes, this is the mirror-image of the one above. she contains multitudes. πŸ™ˆ)
  • if still no match has been found? the first entry in the font list gets used. default behavior, we love a fallback. πŸ’€

🧚 the interface 🧚

the font list interface consists of the routines listed in Related Information. go look, bestie, I'm not retyping them here, they get their own section. ⭐


πŸ“ font lists in resource files πŸ“

font lists get specified in resource files with this syntax, and you know I'm pasting it exactly:

resource_spec:  font_entry [, font_entry ]+

so the resource value string is one or more font list entries, separated by commas. classic. each font_entry identifies a font or a font set, plus an optional font list entry tag.

now here's the tea on tags β€” the separator is different depending on what you're doing:

  • a tag specified for a single font follows the font name and is separated by = (equals sign).
  • otherwise, in a font set, the tag is separated by a colon.
  • the colon is required whether a tag is specified or not. mandatory. no skipping. 🚨

a font entry uses this syntax to specify a single font:

font_name [ '=' tag ]

for example, this entry specifies a 10 point Times Italic font without a font list entry tag β€” and yes, that semicolon at the end of the line in the original is just punctuation, the * is part of the value:

*fontList:  -Adobe-Times-Medium-I-Normal--10*

a font entry containing a font set is similar, except a semicolon separates multiple font names, and the specification ends with a colon followed by an optional tag:

font_name [ ';' font_name ]+ ':' [ tag ]

and for the record: a font_name is an X Logical Font Description (XLFD) string, and tag is any set of characters from ISO646IRV except space, comma, colon, equal sign and semicolon. those five are banned from tag duty, bestie, do not try it. 😭

here's an example of a font set entry β€” it consists of three fonts (except for charsets), and an explicit font list entry tag:

*fontList: -Adobe-Courier-Bold-R-Normal--25-180-100-100-M-150;-JIS-Fixed-Medium-R-Normal--26-180-100-100-C-240;-JIS-Fixed-Medium-R-Normal--26-180-100-100-C-120:MY_TAG
heads up: note that the XmRenderTable is another data type that can be used for font lists. refer to the XmRenderTable(3) for details. so if you're out here thinking font lists are the only option β€” they're not, she has competition. πŸ”₯

the whole friend group, all here, all linked:


and that's the whole page, bestie!! this one lives in the library call manual, it's titled XmFontList(library call) at the top and it signs off with XmFontList(library call) at the bottom too β€” full circle, main character energy, we love to see it. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά go read your font lists, ily, bye!! πŸ‘‘πŸŒˆβ­