NAME
OpenFont -- Get a pointer to a system font.
SYNOPSIS
font = OpenFont(textAttr)
D0 A0
struct textfont *openfont(struct textattr *);
FUNCTION
This function searches the system font space for the graphics
text font that best matches the attributes specified. The
pointer to the font returned can be used in subsequent
setfont and closefont calls. it is important to match this
call with a corresponding closefont call for effective
management of ram fonts.
INPUTS
textAttr - a textattr or ttextattr structure that describes the
text font attributes desired.
RESULT
font is zero if the desired font cannot be found. If the named
font is found, but the size and style specified are not
available, a font with the nearest attributes is returned.
BUGS
Prior to V39 this function would return a textfont pointer
for any font which matched exactly in Y size, regardless of
differences in DPI, or DotSize.
As part of fixing this bug it is REQUIRED that you use pass the
same textattr (or ttextattr) to this function that was used when
opendiskfont() was called.
OpenFont(), and opendiskfont() use weightamatch() to measure
how well two fonts match. WeightTAMatch() was a public function
in graphics.library V36-V37; it is now a system PRIVATE function
as of V39.
SEE ALSO
closefont() setfont()
diskfont.library/opendiskfont graphics/text.h
intuition/intuition.h