On 4 Jan 2009, at 15:51, Fabien Costantini wrote: > liaojifang wrote: >> I have found that If I delete free(fnt)(Fl_x.cxx:fl_set_spot()),It >> didn't have crashes . >> >> as follows: >> >> #if USE_XFT >> #warning XFT support here >> fnt = NULL;//fl_get_font_xfld(font, size); >> if (!fnt) fnt = "-misc-fixed-*"; >> fs = XCreateFontSet(fl_display, fnt, &missing_list, >> &missing_count, &def_string); >> //free(fnt); >> #else >> fnt = fl_get_font_xfld(font, size); >> if (!fnt) fnt = "-misc-fixed-*"; >> fs = XCreateFontSet(fl_display, fnt, &missing_list, >> &missing_count, &def_string); >> free(fnt); >> #endif > > Thanks liao, this is a bug because when setting fnt to a static > constant string, fnt should _not_ be released not only where you > modified it but also in the else code for non xft use... > I'll have a look in my ubuntu setup to fix that.
It is worse than a bug - I just never got around to writing the bit of code that is needed there (and I still have not.) Really, we need code that will correctly set a suitable font for the IM to use... >> >> another question, I cross compile FLTK, and download a program to >> my target machine, the chinese font can't display instead of >> "??",should I download some font too? >> > There have been some previous discussion discussing about this in > the development forum (i think) not so long ago, I remember that > greg gave some hints ... Yes - you need to ensure that the target machine has fonts capable of displaying the glyphs you are using. The easiest way to do that (initially) would be to make sure you use the same font on your target as you use on your development host. Longer term, some mechanism for querying the fonts available (on some random previously unseen target, for example) and then querying each font for glyph coverage would be useful. It is fairly easy to do this on most of our supported hosts (XFT, Xlib, OSX, win32), but there is no standard way to do it that works across all platforms, so target specific code is often required. There are no fltk methods for doing this. I wonder if there should be? -- Ian _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

