FONT

IUP - Portable User Interface

FONT

Character font of the text shown in the element.

Value

Font name. Please refer to the Character Fonts table for a list of the fonts existing in IUP drivers.  It also accepts values on the native format.

In Windows, the native format is as a string with the following format:

"name:attributes:size"

name: The name the user will see (Times New Roman, MS Sans Serif, etc.).
attributes: Can be empty, or a list separated by commas with the following names: BOLD ITALIC UNDERLINE STRIKEOUT
size: Size in points

Examples:

"Times New Roman::10"
"Ms Sans Serif:ITALIC:20"
"Courier New:BOLD,STRIKEOUT:15"

Default: "Tahoma" for Windows 2000 and Windows XP, "MS Sans Serif" for others. Size default is 8, or 10 if the resolution is greatter than 100 DPI.

The native handle can be obtained using the "HFONT" attribute.

In Motif, the native format uses the X-Windows font string format. You can use program xfontsel to select a font and obtain the string. Size here is in pixels. For example:

"-*-times-medium-r-*-*-10-*"
"-*-sans serif-*-o-*-*-19-*"
"-*-courier-*-r-*-*-14-*"

Default: "-misc-fixed-bold-r-normal-*-13-*" if not defined in a user resource file.

The native handle can be obtained using the "XMFONTLIST" and "XFONTSTRUCT" attributes.

In GTK, the native format uses Pango Font Description strings. The string contains the font name, the style and the size. Size is in points. Style can be a combination of: Italic,  Small-Caps, [Ultra-Light|Light|Medium|Semi-Bold|Bold|Ultra-Bold|Heavy], [Ultra-Condensed|Extra-Condensed|Condensed|Semi-Condensed|Semi-Expanded|Expanded|Extra-Expanded|Ultra-Expanded]. For Example:

"Helvetica Italic 10"
"Times Bold 14"

Default: "Sans 10".

The native handle can be obtained using the "PANGOFONTDESC" attribute.

Affects

All elements with an associated text.

Notes

To set a font, the user can use one of the font options provided in the Character Fonts table, or directly use the name of a native font in the driver. Attention: when consulting this attribute, the user will always be returned the name of the driver font being used, not the name of the IUP font. To get the name of the IUP font, the user must use the IupUnMapFont function.

See Also

TITLE, IupMapFont, IupUnMapFont.