Tscope5
Main Page
Related Pages
Files
Examples
textio3.c
get text dimension
#include <tscope5.h>
void
print_some_text()
{
double
w, h;
w =
ts5_printf
(0.0, 35.0,
"this piece of text "
);
h =
ts5_get_font_size
();
ts5_printf
(0.0, 0.0,
"is %5.2f pixels long"
, w);
ts5_printf
(0.0, -35.0,
"and %5.2f pixels high"
, h);
double
x =
ts5_relative_to_absolute_coordinate_x
(0.9);
double
y =
ts5_relative_to_absolute_coordinate_y
(-0.8);
ts5_draw_mouse_button
(x, y);
}
int
main()
{
ts5_install_display
();
ts5_printf
(0.0, 105.0,
"standard font"
);
print_some_text();
ts5_clear_display
();
ts5_set_font_type
(TS5_ARIAL);
ts5_set_font_style
(TS5_BOLD);
ts5_set_font_size
(35);
ts5_printf
(0.0, 105.0,
"Arial 35 Bold font"
);
print_some_text();
return
0;
}