XMFONTLISTADD(3)

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

πŸ’– XmFontListAdd β€” the font list glow-up page πŸ’–

okay bestie, welcome to the <Xm/Xm.h> zone, this is XmFontListAdd from the library call section of the manual and she is vintage. Like, thrifted-vintage. Not new-vintage. We'll get to that. πŸŽ€


✨ SYNOPSIS ✨

#include <Xm/Xm.h>
XmFontList XmFontListAdd(
XmFontList oldlist,
XFontStruct *font,
XmStringCharSet charset);

🌸 DESCRIPTION 🌸

so basically XmFontListAdd makes you a brand new font list, and that new list is the contents of oldlist plus the new font list element it's adding. iconic behavior. πŸ’…

but here's the part you need to hear, and I need you to actually listen: this function deallocates oldlist after it's extracted the info it needs. so after you call it, do not reference oldlist ever again. not once. not casually. it's gone, girl. 🫢

NOTE: this function is obsolete and only exists for compatibility with previous releases. she has been replaced by XmFontListAppendEntry. so if you're writing new code... bestie. use the other one. 😭
  • oldlist β€” a pointer to the font list that's getting a new entry added to it. πŸ¦‹
  • font β€” a pointer to a font structure, and that's what the new font list gets generated from. this is the structure that the XLib XLoadQueryFont function hands you back. 🌈
  • charset β€” the character set identifier for the font. this can be XmSTRING_DEFAULT_CHARSET, but heads up: that value does not comply with the AES, and it may get removed in future versions of Motif. πŸ’€ and if the value is XmSTRING_DEFAULT_CHARSET, the routine derives the character set from the current language environment. iykyk.

⭐ RETURN ⭐

  • if oldlist is NULL β†’ you get back NULL. 🫠
  • if font or charset is NULL β†’ you get back oldlist. πŸ™ˆ
  • otherwise β†’ you get a new font list. slay. πŸ‘‘


and that's the whole vibe, babe β€” this page lives under the XmFontListAdd(library call) banner in the good old library call manual, so go forth, respect the deprecation notice, and never touch a deallocated oldlist again. periodt. πŸ’œβœ¨