functions both allocate and return a font list that the application must free when it is done using it. These routines exist
for backwards compatibility purposes only, so you should not use them with Motif 1.2.
20.4.2 Retrieving Font Lists
You can retrieve a font list directly from a widget using XtVaGetValues() no matter whether the font list is
specified in a resource file or created programatically. The following code fragment demonstrates this technique:
XmFontList fontlist;
XtVaGetValues (widget, XmNfontList, &fontlist, NULL);
The font list returned by XtVaGetValues() is a pointer to internal data, so it should be considered read−only. You
should not alter this font list or free it. This is in direct contrast to how Motif uses XtVaGetValues() for
compound strings, where a copy of the string is returned. If you need to manipulate the font list, you can make a copy
of it using XmFontListCopy().
Once you have obtained a font list from a widget, you can use it to specify the font list for another widget, as shown in
the following code:
XtVaSetValues (another_widget, XmNfontList, fontlist, NULL);
Since the font list was obtained through a call to XtVaGetValues(), we do not free it after setting the
XmNfontList resource.
20.4.3 Querying Font Lists
The XmFontList type is opaque to the programmer, so if you need to get information about a font list, you have to
use Motif−specific functions that access font list information. This internal information can be useful if you need the
font handles or ...