I added the error check and found that FLTK2 didn't found "Kochi Gothic"
font.
I tried to replace "fltk::Font *f = fltk::font("Kochi Gothic", 0);" with
other fonts that's surely installed in my system, such as "DejaVu Serif" and
other listed by fc-list. The result is the same - FLTK2 just don't recognize
them. But FLTK example can recognize these font. What can be the cause?
On Fri, Jul 17, 2009 at 6:07 AM, Greg Ercolano <[email protected]> wrote:

> Eric Liao wrote:
>
> > 2. Did you add error checking to the font calls in the test program I
> posted?
> >
> > I just copied your source code. No error checking was added. Besides, I
> > don't know how to do the error checking. If not bothering, please show
> > me how it is done.
>
>
>        By this I mean, check the return value of fltk::font()
>        to see if it's valid.
>
>        So for instance, below this line:
>
>                 fltk::Font *f = fltk::font("Kochi Gothic", 0);
>
>        ..check if 'f' is NULL, eg:
>
>                if ( f == NULL ) {
>                    printf("Font error\n");
>                    exit(1);
>                }
>
>        If with that change, you run the program and it simply exits
>        with "Font error", then the question would be /why/ is fltk::font()
>        failing the font lookup.. and at that point you'd have to dip into
>        FLTK's source code for that function, fltk::font() in
> src/list_fonts.cxx,
>        copy that code into your own app, and start looking for the failure.
>  _______________________________________________
> fltk-dev mailing list
> [email protected]
> http://lists.easysw.com/mailman/listinfo/fltk-dev
>
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to