http://www.w3.org/TR/html4/loose.dtd"> StdGUI Font Functions

StdGUI Font Functions

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUES
ENVIRONMENT
AUTHOR

NAME

StdGUI Font Functions

SYNOPSIS

int index_font(int p_index, char **p_name, int *p_styles);

FONT map_font(char *p_name, int p_style, int p_size);

FONT get_sysfont(void);

FONT get_appfont(void);

int get_font_info(FONT p_font, int *p_ascent, int *p_descent, char **p_spec);

int char_width(char *p_ch, FONT p_font);

int str_width(char *p_str, FONT p_font);

DESCRIPTION

The index_font() function returns the family name, in p_name, and available styles, in p_styles, of each available font on the host system.

The map_font() function returns a FONT instance for a specific font family, style and size (specific in p_name, p_style and p_size).

The get_sysfont() and get_appfont() functions return the system font (used for menus, buttons, etc.) and the application font (used for whatever the application needs) respectively.

The get_font_info() function returns information about a specific font instance (specified by p_font), returning the font’s ascender and descender heights (in p_ascent and p_descent) and a host specific font specification string (in p_spec).

The char_width() and str_width() functions return the set width of a character or string (p_ch or p_str)inthespecified font instance (p_font).

RETURN VALUES

The index_font() and get_font_info() functions return zero (0) on success, non-zero on failure.

The map_font(), get_sysfont() and get_appfont() functions return a valid font instance on success, or (FONT)(-1) on failure.

The char_width() and str_width() functions return a positive integer value on success, negative on failure.

ENVIRONMENT

The system and application fonts are specified by the GUI_SYS_FONT and GUI_APP_FONT environment variables, in the size:style:family format.

AUTHOR

Jeffrey Dutky

dutky@bellatlantic.net or jeff.dutky@gmail.com

http://members.bellatlantic.net/~dutky