FONT


Functions

bool isFONT (SatAddr src)
 is object a FONT?
int FONTnibbles (SatAddr src)
 The size of a FONT in nibbles.
SatAddr FONTitem (SatAddr src, int idx)
 Return the Saturn address of a character's FONT entry.
int FONTgetId (SatAddr src)
 Get the font ID.
bool FONTsetId (SatAddr src, int id)
 Set the FONT id.
int FONTgetNameLen (SatAddr src)
 Get the number of characters in the font's name.
bool FONTsetName (SatAddr src, const char *name)
 Change the name of a FONT. Note that new name must be the same length as existing name.
bool FONTdecode (SatAddr src, int *id, char *name, int *height, char *graphics)
 Decode a FONT into it's parts.
SatAddr FONTencode (int id, const char *name, int height, const char *graphics, SatAddr dst)
 Create a new FONT.
SatAddr makeFONT (int nameLen)
 Make a blank font with room for "nameLen" characters in the name.

Function Documentation

bool FONTdecode ( SatAddr  src,
int *  id,
char *  name,
int *  height,
char *  graphics 
)

Decode a FONT into it's parts.

Parameters:
src The Saturn Address of a FONT object
id if non-null, then the FONT's id number will be stored here.
name if non-null, then the font name will be copied here as a null-terminated string. Name must point to enough space to hold the name. You can get the number of characters in the name with FONTgetNameLen() ahead of time and pass this value plus 1 (for the terminating NULL byte. ALternatively, since the name can never exceed 255 characters, just pass a 256 character buffer.
height If non-null, the FONT's height in pixels will be stored here.
graphics If non-null, the FONT's graphic data will be copied here. Graphics must point to sufficient space to hold the data, which can be up to 2kb.
Returns:
true on success, false if src isn't a FONT.

SatAddr FONTencode ( int  id,
const char *  name,
int  height,
const char *  graphics,
SatAddr  dst 
)

Create a new FONT.

Parameters:
id The FONT id, which must be between 0 and 255
name A null-terminated string containing the font's name. Must be less than 255 characters.
height The font's height in pixels. \param graphics. The graphical data. See "Saturn Assembly Language Programming" for details on the format of FONT graphics.
dst Where to store the resulting FONT. If zero then a new FONT will be created in TEMPOB. Otherwise dst must point to the right amount of space to hold the FONT object.
Returns:
The address of the new font, or 0 if the id, name length, or height is out of range, or if dst is zero and it can't allocate sufficient space for the FONT.

int FONTgetId ( SatAddr  src  ) 

Get the font ID.

Parameters:
src The Saturn Address of a FONT object
Returns:
The FONT'd id number, or -1 if src isn't a FONT

int FONTgetNameLen ( SatAddr  src  ) 

Get the number of characters in the font's name.

Parameters:
src The Saturn Address of a FONT object
Returns:
The number of characters in the fon't name, or -1 if src isn't a FONT

SatAddr FONTitem ( SatAddr  src,
int  idx 
)

Return the Saturn address of a character's FONT entry.

This returns the address of the font entry corresponding to ASCII char ch. Once you have the entry, you can read or change it with sat_peek() and sat_poke(). See section 56.17 in "Saturn Assembly Language Programming" for details of a FONT entry.

Parameters:
src The Saturn address of the FONT
ch The ASCII character
Returns:
Saturn address of the font entry. If src isn't a FONT or if ch is not an ASCII character, then it returns 0

int FONTnibbles ( SatAddr  src  ) 

The size of a FONT in nibbles.

Parameters:
src Saturn address of the FONT.
Returns:
The size of the FONT in nibbles.

bool FONTsetId ( SatAddr  src,
int  id 
)

Set the FONT id.

Parameters:
src The Saturn Address of a FONT object
id The new ID, which must be between 0 and 255.
Returns:
true on success, false if src isn't a FONT or if id is out of range.

bool FONTsetName ( SatAddr  src,
const char *  name 
)

Change the name of a FONT. Note that new name must be the same length as existing name.

Parameters:
src The Saturn Address of a FONT object
name a null-terminated string that is the new name. This must be the same length as the old name. In other words strlen(name) must equal FONTgetNameLen(src)
Returns:
true on success, or false if src isn't a FONT or name doesn't point to a null terminated string with the same length as the existing FONT name.

bool isFONT ( SatAddr  src  ) 

is object a FONT?

Parameters:
src Saturn address of an object
Returns:
true if the object at src is a FONT

SatAddr makeFONT ( int  nameLen  ) 

Make a blank font with room for "nameLen" characters in the name.

Parameters:
nameLen The length of the name in characters
Returns:
the address of the new font, or zero if nameLen is too large or if no space can be allocated.


Generated on Sat Apr 3 16:38:31 2010 for HPObjects by  doxygen 1.5.0