Someone was asking me about drawing smooth (antialiased) lines
        in FLTK, and decided to try out FLTK with Cairo support.

        I was surprised it only took minutes to install + rebuild fltk
        against it on linux, and it built a working "test/cairo_test" program.
        The binary for cairo_test is surprisingly small (392k); unless the
        DLLs it loads are large, I'd say that ain't bloated at all.

        For those that haven't tread the path, here's some breadcrumbs;


                o There's a test/cairo_test program to test fltk+cairo

                o Assuming the cairo development libs are installed
                  (the single command 'yum install cairo-devel' in my case)
                  you just need to rebuild fltk with "configure --enable-cairo"

                o Once rebuilt, the test/cairo_test program should show a 
rendering
                  that uses the cairo library (gradients, smooth antialiased 
lines, etc)
                
        Only had one small link hitch; apparently the link flag "-lpixman-1"
        in the FLTK Makefile is no longer needed.

        Here's how I went from just fltk to fltk+cairo on centos 5.5:

yum install cairo-devel

        ..then to rebuild fltk:

cd /usr/local/src/fltk-1.3.x-svn
make distclean
./configure --enable-cairo
make

        I got this small error during the build of cairo_test:

[..]
Linking cairo_test...
/usr/bin/ld: cannot find -lpixman-1
collect2: ld returned 1 exit status
make[1]: *** [cairo_test] Error 1

        ..but this was solved by changing this line in the Makefile:

-CAIROLIBS      = -lcairo -lpixman-1
+CAIROLIBS      = -lcairo

        ..as apparently -lpixman is no longer needed.
        Another 'make' and fltk built the rest of the way, no errors,
        and the test/cairo_test program ran OK.
_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to