Tscope5
|
Go to the source code of this file.
Functions | |
Text input/output functions | |
The text input-output functions all take the smallest possible number of parameters to put something on the screen: two coordinates and a format string. The vertical coordinates are interpreted differently by the two coordinate systems.
The format string is the same as the standard C printf and scanf function families. Both standard C strings and Unicode strings can be used. Drawing parameters are set with the graphics parameter functions. | |
double | ts5_printf (double x, double y, const char *format,...) |
void | ts5_printf_justify (double x1, double x2, double y, const double diff, const char *format,...) |
double | ts5_printf_ustr (double x, double y, const TS5_USTR *ustr) |
void | ts5_printf_justify_ustr (double x1, double x2, double y, const double diff, const TS5_USTR *ustr) |
int | ts5_scanf (double x, double y, const char *format,...) |
double | ts5_get_text_width (const char *format,...) |
double | ts5_get_text_width_ustr (TS5_USTR *ustr) |
Loading custom fonts | |
In Tscope5 three fonts are available as standard (courier, arial and times). If these do not suit your needs any TrueType font that is installed on your computer can be loaded manually. | |
TS5_FONT * | ts5_read_font (const char *fontfile, double size) |
TS5_FONT * | ts5_set_font (TS5_FONT *font) |
void | ts5_free_font (TS5_FONT *font) |
Definition in file textio.c.
double ts5_printf | ( | double | x, |
double | y, | ||
const char * | format, | ||
... | |||
) |
Write text to the active bitmap.
x | Horizontal position of the text. |
y | Vertical position of the text. |
format | Printf style format string. |
void ts5_printf_justify | ( | double | x1, |
double | x2, | ||
double | y, | ||
const double | diff, | ||
const char * | format, | ||
... | |||
) |
Write justified text to the active bitmap.
x1 | Horizontal start position of the text. |
x2 | Horizontal end position of the text. |
y | Vertical position of the text. |
diff | Maximum amount of space. If the amount of spare space is greater than the diff value, left justified text will be written. |
format | Printf style format string. |
double ts5_printf_ustr | ( | double | x, |
double | y, | ||
const TS5_USTR * | ustr | ||
) |
void ts5_printf_justify_ustr | ( | double | x1, |
double | x2, | ||
double | y, | ||
const double | diff, | ||
const TS5_USTR * | ustr | ||
) |
Write justified UTF-8 encoded text to the active bitmap.
x1 | Horizontal start position of the text. |
x2 | Horizontal end position of the text. |
y | Vertical position of the text. |
diff | Maximum amount of space. If the amount of spare space is greater than the diff value, left justified text will be written. |
ustr | Unicode string. |
int ts5_scanf | ( | double | x, |
double | y, | ||
const char * | format, | ||
... | |||
) |
double ts5_get_text_width | ( | const char * | format, |
... | |||
) |
double ts5_get_text_width_ustr | ( | TS5_USTR * | ustr | ) |
TS5_FONT* ts5_read_font | ( | const char * | fontfile, |
double | size | ||
) |
Load a user defined font.
fontfile | Path to the file that describes the true type font. |
size | Size the font will be rendered in. |
True type fonts can be found in /Library/fonts on mac.
TS5_FONT* ts5_set_font | ( | TS5_FONT * | font | ) |