EW_FontRequest

EW_FontRequest

ew

1998 12-05


CLASS

EW_FontRequest - font description for a load request


SYNOPSIS

Class EW_FontRequest is a generic description of a font, specifying size and general style parameters. The system can use this description to attempt a close match from fonts available from the specific window system.


The resulting size and style from a loaded may not be as requested. The font matching system may make comprimises based on internal priorities. The call to
EW_Window::LoadFont(EW_Font *fontdata,EW_FontRequest *request) will fill information in the fontdata structure and potentially alter request based on the comprimises required to find a font. One can read the values in request after the call to find out what was actually loaded.


PUBLIC MEMBER FUNCTIONS



void SetHeight(long set)

long GetHeight(void)
Set/Get the height of the font in pixels.



void SetStyle(long set)

long GetStyle(void)
Set/Get the style of the font. Currently supported OR'ed options are as follows. Enumeration values are given for clarity; they are subject to change.



void AddHint(char *fontname)
Specify a the name of a font to be searched for before the built-in choices. Hints get preferencial selection, but do not override the built-in's if they are a particularly bad match. Hints added earliest get a slight preference. Any number of hints can be added. The concept is to add names for similar fonts from different platforms. Names that don't exist on a platform will just be ignored. Under X, the hint is tried as is and also assuming that it is just the family-weight-slant fragment. Note that style settings may or may not have an effect on hinted fonts. Under Win32, the name is just used directly. Currently, only TrueType fonts are permitted.



EW_StringList *GetHintList(void)
Return the list of hints that have been added. The call GetHintList()->Clear() can be used to reset the list.



EW_FONT_FIXED 0 fixed width
EW_FONT_PROPORTIONAL 1 variable width
EW_FONT_ITALIC 2 italic font
EW_FONT_BOLD 4 bold font


FILES

ew/text.h Font/text header file


SEE ALSO

EW_intro(3), EW_Window(3), EW_Font(3)