Sf_Width - Texas Instruments TI-89 Developer's Manual

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

Appendix A: System Routines — Display

sf_width

Declaration:
UCHAR sf_width (UCHAR ch )
Category(ies):
Display
Description:
Return the width in pixels of a small font character.
Inputs:
ch — Character to get width of.
Outputs:
Width of given character in the small font.
Assumptions:
Note that the small font (4x6) is the only proportional font; all the other
fonts (large and huge) are fixed width.
Side Effects:
None
On AMS 2.00 and higher.
Availability:
TI-89 / TI-92 Plus
The small font is generally used more on the TI-89 than on the TI-92 Plus.
Plus Differences:
It allows for more characters to fit on a line since it is proportional.
See Also:
DrawStrWidth, DrawStrWidthP
Example:
The DrawStrWidth function uses sf_width to compute the width of small
(4x6) font characters.
/* Return the length of the given string in pixels.
For the 8x10/6x8 font this is just 8/6 times the length of the string,
but the 4x6 font is proportional.
*/
WORD DrawStrWidth( const char *Str, BYTE FontType )
{
register BYTE c;
register WORD Width;
switch( FontType ) {
case F_4x6:
Width = 0;
while (c = *Str++)
Width += sf_width (c);
return Width;
case F_6x8:
return (6 * strlen((char *) Str));
case F_8x10: return (strlen(Str) << 3);
}
}
TI-89 / TI-92 Plus Developer Guide
/* proportional font */
Not for Distribution
445
Beta Version January 26, 2001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents