On 05.01.2010, at 12:00, leowang wrote:
> 
> int main(int argc, char **argv) {
> Fl_Window *window = new Fl_Window(480, 272);
>  Fl_Box *box = new Fl_Box(20,40,260,100,"ÄãºÃ");
>  box->box(FL_UP_BOX);
>  box->labelsize(36);
>  Fl_Font my_fnt;

Oh, um, no, my_ft is an index into the font table. It has not been documented 
well at all, but you need to take an existing font index, or allocate font 
indices one by one.

So this would be coreect:

Fl_Font my_fnt = FL_FREE_FONT;
Fl::set_font(my_fnt, "Courier");

the next font index that you can use is:

Fl_Font my_other_fnt = FL_FREE_FONT+1;
Fl::set_font(my_other_fnt, "Slacker");

but maybe this is a much better solution: all your fonts default to 
FL_HELVETICA, so you could simply change font FL_HELVETICA to contain the 
required characters:

Fl::set_font(FL_HELVETICA, "MyBetterFont");

no need to call "labelfont()" anymore.

>  Fl::set_font(my_fnt, "WenQuanYi Zen Hei");
>  box->labelfont(my_fnt);
>  box->labeltype(FL_SHADOW_LABEL);
>  window->end();
>  window->show(argc, argv);
>  return Fl::run();
> }
> _______________________________________________
> fltk mailing list
> fltk@easysw.com
> http://lists.easysw.com/mailman/listinfo/fltk

_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to