Tscope5
textio5.c

load a custom font

#include <tscope5.h>
int main()
{
TS5_FONT *oldfont, *newfont1, *newfont2, *newfont3;
newfont1 = ts5_read_font("/usr/local/share/tscope5_data/Courier New Bold.ttf", 20.0);
oldfont = ts5_set_font(newfont1);
ts5_printf(0.0, -60.0, "custom font: Courier New Bold 20");
ts5_set_font(oldfont);
newfont2 = ts5_read_font ("/usr/local/share/tscope5_data/Arial Bold Italic.ttf", 30.0);
ts5_set_font(newfont2);
ts5_printf(0.0, -20.0, "custom font: Arial Bold Italic 30");
newfont3 = ts5_read_font ("/usr/local/share/tscope5_data/Times New Roman.ttf", 40.0);
ts5_set_font(newfont3);
ts5_printf(0.0, 20.0, "custom font: Times New Roman 40");
ts5_set_font(oldfont);
ts5_printf(0.0, 60.0, "back to the old font");
ts5_free_font(newfont1);
ts5_free_font(newfont2);
ts5_free_font(newfont3);
return 0;
}