Just wondering aloud, to those that know the answer..
why is it again that Fl::set_font() does not return an error
if the font is not found?
Do the underlying functions not know themselves?
It seems possible OP's Fl::set_font() call is failing in FLTK1.3.x
for some reason.
Leowang: Double check your FLTK 1.3.x build has XFT enabled
(anti aliased fonts).
BTW, looking at your program, I'd suggest the following changes
to keep things simple (and #include's are not trimmed out):
#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(480, 272);
Fl::set_font(FL_HELVETICA, "WenQuanYi Zen Hei");
Fl_Box *box = new Fl_Box(20,40,260,100,"************");
box->box(FL_UP_BOX);
box->labeltype(FL_SHADOW_LABEL);
window->end();
window->show(argc, argv);
return Fl::run();
}
..where the set_font() call is right at the top, and assign the font
to FL_HELVETICA (FLTK's default font), just to rule out any problems
with font assignment.
From looking at your newsgroup posting, I'm sure your chinese
UTF8 string did not make it through my mail reader, so it would
be good if you show us the HEX equivalents for the string, so that
it will preserve the codes even through newsgroup postings and email.
By that I mean, like the songnames[] array in this program:
http://www.seriss.com/people/erco/fltk/utf8-japanese-songs.cxx
If you have a small one line file containing just the chinese
characters in your string, you can use od(1) to dump the file as
hex codes:
od --format=x1 < yourfile
..and then paste that here so we can work that into the test program
and try to help you that way.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk