Hi Steve,

On 7/9/09, 長泰 張 <[email protected]> wrote:
> Hi Alan
>
> I just found a problem around src/x11/Font_xlfd:538last week
> Below is my solution
>
> void fltk::setfont(Font* font, float psize) {
>   FontSize* f = current;
>   IFont* t = (IFont*)font;
>
>   // only integers supported right now (this can be improved):
>   psize = int(psize+.5);
>   unsigned size = unsigned(psize);
>   // See if the current font is correct:
>   if(f && f->encoding && encoding_) {                      <<-- Suggest to
> add some check
>   if (font == current_font_ && psize == current_size_ &&   <<-- May crash
> here
>       (f->encoding==encoding_ ||
>            (!encoding_ || !strcmp(f->encoding, encoding_))))
>     return;
>   }
>   current_font_ = font; current_size_ = psize;
>

Great! Your work around fixed the issue!

Thank you very much,

Alan

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to