FONT

IUP - Portable User Interface

FONT (up to 2.x)

Character font of the text shown in the element. See FONT definition since IUP 3.0.

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 pixels

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.

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. 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.

Affects

All elements with an associated text.

Note

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.