> > > But in fltk-1.3, it can't set as above, I use=20 > > o->labelfont((Fl_Font)(FONT_NAME));, but it will has segm=20 > > fault when run the test programme. > >=20 > > How to add a font in fltk-1.3? > > Before we go on, there are two font demos distributed in the test folder > of the fltk-1.3 tarball, so you should probably play about with those a > bit first, to see how much of it works on your setup (I'm thinking there > may be odd features in your platform, which seems to be non-standard in > some ways?) > Anyway, try the two demos "utf8" and "fonts" to see how that goes, and > you can look at their sources to see how they do what they do... > > As to your specific query: You maybe need to set the font first? > > Try something like: > > Fl::set_font(my_fnt, " name of font"); > : > : > o->labelfont(my_fnt); > : > : > > etc... > > > > SELEX Galileo Ltd > Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS= > 14 3EL > A company registered in England & Wales. Company no. 02426132 > ******************************************************************** > This email and any attachments are confidential to the intended > recipient and may also be privileged. If you are not the intended > recipient please delete it from your system and notify the sender. > You should not copy it or use it for any purpose nor disclose or > distribute its contents to any other person. > ******************************************************************** >
Hi Ian, As you said, I need to set a font first which can support Chinese. I have tried your method, but still has segm fault. My code is as follows: 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; 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