# Font Selector dialog

The Font Selector dialog is a dialog which simplifies the selection of X fonts. It is accessed by clicking on the relevant font button within any widget resource panel, for example, the Font button on the Display page of the Label resource panel.

The Font Selector dialog has basically four areas: a menubar at the top, an X Font list to the left and underneath the menubar, a Font Object area to the right of the X Font list and a Sample Text area located below the X Fonts and Font Object areas.

The Sample Text area gives a visual representation of your currently selected font, so you can try out various fonts and get a feel of what looks best for your application.

At the simplest use of the dialog, you can select a font directly from the X Font scrolling list, or type a font name directly into the selection field at the bottom of the dialog.

The Apply button will transfer your selection into the font resource field of the dialog from which you called the Font Selector dialog.

Since the number of fonts supported by any X configuration can be very large, you can cut down the number of items within the X Font list using the menubar to selectively filter according to various criteria. You can always revert to the full list by pressing the All fonts button at the bottom of the panel.

A more sophisticated use of the dialog is for creating FontLists. In Motif, a FontList is a set of fonts that can be used to display a compound string. You can create a tag or alias for a particular font within a FontList and associate segments of a compound string with the tag, the idea being that the segment will be displayed in the font represented by the tag. UIL pre-defines some FontList tags but you can also define your own: they take the form of simple text strings.

In order to create such FontLists, the panel has the Font Object area. Font objects may be regarded as global variables. They are a means of binding a list of fonts to a name (my_font). You can then specify anywhere in WorkShop Visual that you can specify a font. The Design Window will display the appropriate font. If you change the binding - the association between the font object name and an X font list - then all occurrences of the font object in your Design Window will be updated to reflect the change.

To set up a Font Object, type the name of the object into the Font Object field. Select a font you wish it to be bound to from the list of fonts. You can then specify a FontList tag in either of two ways: by typing the name into the FontList tag field, or by selecting a pre-defined FontList tag from the menus. Press the Bind button to associate the font with the FontList tag for the given object name.

Note that, in Microsoft Windows mode, you must use Font Objects when specifying the font of a widget as the font must be persistent on Microsoft Windows.

To use an existing Font Object, either select it from the Font Object list, or type in the Selection field at the bottom of the dialog. You can also type directly into font resource fields without having to use the Font Selector dialog.

To redefine a Font Object, select both the object and an associated FontList tag, choose a new font and press the Bind button. All occurrences of the Font Object will be updated in the design.

To delete a Font Object, select it and press the Delete button. The Font Object must, however, not be referenced within your design.

To delete a FontList tag, select it and press the Delete button. You will not be allowed to delete the last FontList tag in a Font Object.

NOTES

User-defined FontList tags do not seem to work correctly in UIL. Use pre-defined tags if you are going to generate UIL: click on the UIL button to get a menu of these tags.

WorkShop Visual provides an XmString Editor which simplifies the creation of compound strings.

If you are going to use the Internationalization facilities of X11R5 and Motif, then you may need to build Font sets. These are similar to FontLists, can be used in much the same way and contexts and are also bound to a FontList tag. A Font set, however, contains a number of fonts as required by the current locale, usually specified through the LANG environment variable.

To create a Font set, turn on the Font set toggle when binding a font to a FontList tag. The FontList tag will now consist of both your supplied name and some additional 'registration' information for the font you are binding. There are some restrictions: a Font set may not contain two fonts with the same registration data. The X Toolkit will warn if a Font set contains fonts which do not satisfy the locale specification.

For more information concerning X fonts and Font sets, you are referred to X Toolkit and OSF/Motif Reference manuals.

See also:

- XmString Editor
- Microsoft Windows Mode
- About WorkShop Visual