NAME
SetFont -- Set the text font and attributes in a RastPort.
SYNOPSIS
SetFont(rp, font)
A1 A0
void SetFont(struct RastPort *, struct TextFont *);
FUNCTION
This function sets the font in the RastPort to that described by font, and updates the text attributes to reflect that change. This function clears the effect of any previous soft styles.
INPUTS
rp - the RastPort in which the text attributes are to be changed font - pointer to a TextFont structure returned from OpenFont or OpenDiskFont
RESULT
NOTES This function had previously been documented that it would accept a null font. This practice is discouraged. o Use of a RastPort with a null font with text routines has always been incorrect and risked the guru. o Keeping an obsolete font pointer in the RastPort is no more dangerous than keeping a zero one there. o SetFont(rp, 0) causes spurious low memory accesses under some system software releases.
As of V36, the following Amiga font variants are no longer directly supported: fonts with NULL tf_CharSpace and non-NULL tf_CharKern. fonts with non-NULL tf_CharSpace and NULL tf_CharKern. fonts with NULL tf_CharSpace and NULL tf_CharKern with a tf_CharLoc size component greater than tf_XSize. Attempts to SetFont these one of these font variants will cause the system to modify your font to make it acceptable.
BUGS Calling SetFont() on in-code TextFonts (ie fonts not OpenFont()ed) will result in a loss of 24 bytes from the system as of V36. This can be resolved by calling StripFont.
SEE ALSO
OpenFont StripFont diskfont.library/OpenDiskFont graphics/text.h