Font Handling (XForms (Forms Library) - Version 1.2 (Rev. 4) A Graphical User Interface Toolkit for X)

Next: Drawing Functions, Previous: Getting the Size, Up: Part IV Drawing Objects [Contents][Index]

### 28.6 Font Handling

Sometimes it can be useful to get the X font structure for a particular size and style as used in the Forms Library. For this purpose, the following routine exists:

    [const] XFontStruct *fl_get_fontstruct(int style, int size);

The structure returned can be used in, say, setting the font in a particular `GC`:

    XFontStruct *xfs = fl_get_fontstruct(FL_TIMESBOLD_STYLE, FL_HUGE_SIZE);
    XSetFont(fl_get_display(), mygc, xfs->fid);

The caller is not allowed to free the structure returned by `fl_get_fontstruct()`, it’s just a pointer to an internal structure!