I'm trying to start learning how to use the FLTK GUI toolkit to create a basic text editor, and I had a problem with this simple Hello World from the documentation tutorial.
#include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/Fl_Box.H> int main(int argc, char **argv) { Fl_Window *window = new Fl_Window(340,180); Fl_Box *box = new Fl_Box(20,40,300,100,"Hello, World!"); box->box(FL_UP_BOX); box->labelfont(FL_BOLD+FL_ITALIC); box->labelsize(36); box->labeltype(FL_SHADOW_LABEL); window->end(); window->show(argc, argv); return Fl::run(); }
The program compiles without problems, but the text is displayed in a very small font, which is neither bold nor italic when it should be. Changing the value of labels () does not affect the font.
I started the program. / fonts specified in the test folder of the FLTK distribution, and most of the fonts displayed are in the same unspeakable default font. Only a few fonts appear in bold and italics and vary in size.
I downloaded MS TrueType fonts and recreated my font cache, but this did not solve the problem. I have a Linux Mint with XFCE running in a virtual machine. I am also new to programming and Linux, so please bear with me! I tried to solve this all day, not finding what I was doing wrong. Can you help me?
source share