Fox wrote:
> Thanks for your answer. But, what is "Xfs"? How to use it?
> Where can find the documentation?
man xfs
man Xft
If you enable xft for FLTK (eg. "configure --enable-xft ; make")
and use fl_draw() to draw the text as Roman Kantor recommended,
which bypasses the uchar limit of regular widget labels.
Even with FLTK 1.x, fonts can apparently get as large as an int
will allow (32767).
In this case, I've set the font size to 500:
http://seriss.com/people/erco/fltk/tmp/bigfont.jpg
Here's the code I used to make the above screenshot to get you started,
which was made with fltk 1.1.x on fedora3, FLTK built --enable-xft:
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Box.H>
#include <FL/fl_draw.H>
class BigFont : public Fl_Box {
int _fontsize;
public:
BigFont(int X,int Y,int W,int H,const char *L=0):Fl_Box(X,Y,W,H,L) {
_fontsize = 18;
}
void fontsize(int val) { // sets the big font size
_fontsize = val;
redraw();
}
int fontsize() const { // get the big font size
return(_fontsize);
}
void draw() { // draw the box and big font
draw_box();
fl_font(labelfont(), fontsize());
fl_color(labelcolor());
if ( label() ) fl_draw(label(), x(), y()+_fontsize);
}
};
int main(int argc, char *argv[])
{
Fl_Double_Window win(1000, 1000, "FLTK large font");
BigFont bf(10, 10, 500-20, 500-20);
bf.label("ABC");
bf.fontsize(600);
win.end();
win.resizable(bf);
win.show();
return(Fl::run());
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk