But if I look intoinclude/FL/fl_config.h94 /*
95 * FLTK_HAVE_CAIRO
96 *
97 * Do we have Fl_Cairo_Window support?
98 */
99
100 /* #undef FLTK_HAVE_CAIRO */
101
102
103 /*
104 * FLTK_HAVE_CAIROEXT
105 *
106 * Do we have the Cairo library available and want extended Cairo use in FLTK ?
107 * This implies to link cairo.lib in all FLTK based apps.
108 */
109
110 /* #undef FLTK_HAVE_CAIROEXT */It looks that I can not use any function which gives me the cairo context.What I am doing wrong?
I want to switch of antialiasing for some of my drawing operations.The fl_antialias() function did not change the behaviour. I simply can call it with 1 or 0 and I can't see any changes. Not for lines, not for text.My idea was to get the current cairo context and use the cairo functions:cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE); - Disables anti-aliasing for paths and shapes.cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_NONE); - Disables anti-aliasing for text.But to get these functions to work, I need the cairo context.But if FLTK_HAVE_CAIRO is not set, I can't get any context, as non of the cairo support function is available.BTW:How to get cairo context in fltk 1.5... currently I am digging through the headers...
'Klaus Rudolph' via fltk.general wrote:
I want to run a single binary on linux with X11 and also with wayland if this is possible.My understanding was, that this IS possible.
Read through the fltk 1.5 README.Cairo.txt for info, as that
will go into the details you need to know about this.
Note in particular the comments in that file regarding these
other cmake variables you appear to not be using currently:
FLTK_OPTION_CAIRO_WINDOW -- lets you make a window that can use cairo drawing calls directly
FLTK_OPTION_CAIRO_EXT -- lets you access cairo context
FLTK_GRAPHICS_CAIRO -- enables cairo for all fltk drawing under X11 (instead of using x11 functions to draw)
Disclaimer: Those are my hastily written summary comments; best to read the paragraphs describing each of those carefully, as it goes into x11 vs wayland specifics and describes it better.
fl_wl_gc() reports the same error
I have configured fltk 1.5 with:
cmake . -B mybuild -D FLTK_GRAPHICS_CAIRO=ON -D CMAKE_BUILD_TYPE=Debug -D FLTK_BUILD_EXAMPLES=ON -D CMAKE_INSTALL_PREFIX:PATH=/home/krud/external_repos/fltk-1.5.x_cairo/myinstall
[..]
But if I look into include/FL/fl_config.h
/* #undef FLTK_HAVE_CAIRO */
[..]
/* #undef FLTK_HAVE_CAIROEXT */
(Albrecht: is that a typo in the README? I think that :PATH bit might be incorrect)$ grep CMAKE_INSTALL_PREFIX README.CMake.txt
../README.CMake.txt:-D CMAKE_INSTALL_PREFIX:PATH=...
'Klaus Rudolph' via fltk.general wrote:
I have configured fltk 1.5 with:cmake . -B mybuild -D FLTK_GRAPHICS_CAIRO=ON -D CMAKE_BUILD_TYPE=Debug -D FLTK_BUILD_EXAMPLES=ON -D CMAKE_INSTALL_PREFIX:PATH=/home/krud/external_repos/fltk-1.5.x_cairo/myinstall
Regarding that.. again, not an expert on this, but I think there might be a typo:
-D CMAKE_INSTALL_PREFIX:PATH=/home/krud/external_repos/fltk-1.5.x_cairo/myinstall
That bit with the ":' (between PREFIX and PATH) seems wrong, and should probably just be an underbar instead, e.g.
-D CMAKE_INSTALL_PREFIX_PATH=/home/krud/external_repos/fltk-1.5.x_cairo/myinstall
This may in fact be a bug in one of our README files, e.g.(Albrecht: is that a typo in the README? I think that :PATH bit might be incorrect)$ grep CMAKE_INSTALL_PREFIX README.CMake.txt
../README.CMake.txt:-D CMAKE_INSTALL_PREFIX:PATH=...
Regarding that.. again, not an expert on this, but I think there might be a typo:
-D CMAKE_INSTALL_PREFIX:PATH=/home/krud/external_repos/fltk-1.5.x_cairo/myinstall
That bit with the ":' (between PREFIX and PATH) seems wrong, and should probably just be an underbar instead, e.g.
-D CMAKE_INSTALL_PREFIX_PATH=/home/krud/external_repos/fltk-1.5.x_cairo/myinstall
This may in fact be a bug in one of our README files, e.g.(Albrecht: is that a typo in the README? I think that :PATH bit might be incorrect)$ grep CMAKE_INSTALL_PREFIX README.CMake.txt
../README.CMake.txt:-D CMAKE_INSTALL_PREFIX:PATH=...
On 11/15/25 10:22, 'Albrecht Schlosser' via fltk.general wrote:
No, it's not a typo. CMake uses a ':TYPE' notation for all its variables. Usually you don't need to specify it, but often it is better to do it (for clarity).
As also mentioned in all my other questions:My requirement is:I want to run a single binary on linux with X11 and also with wayland if this is possible.My understanding was, that this IS possible.
Maybe we can go the other way around:How can I compile fltk 1.5 to have FLTK_HAVE_CAIRO is set.I already set -D FLTK_GRAPHICS_CAIRO=ONAnd this already switched transparent colors on. So from my side it looks like that cairo is in use. But maybe only partly?
It is all a bit hard to understand from a "user only" perspective. I am not very familiar with all the wayland/X11 specific things and how compiling fltk results in a more or less compatible version. I am still in hope that I had not to deal so much with all the differences between both of them myself.
I know, I already asked several questions regarding the specific X11 vs. wayland stuff. But I can't catch the point how to get it run? Sorry!
-- Use Wayland Yes (can also run as X11 client) -- All drawing uses Cairo Yes2. If you want to use Cairo drawing inside your FLTK window (or widget) you must also set `FLTK_OPTION_CAIRO_WINDOW:BOOL=ON` (I intentionally included optional ':BOOL' here). This will set the macro `FLTK_HAVE_CAIRO = 1` in fl_config.h which indicates that you can use Cairo for your own drawing calls (on all platforms, not only on Linux/Unix). If you did this you'll see a line like the following in the build summary:
-- Fl_Cairo_Window support Yes (standard)3. Forget option FLTK_OPTION_CAIRO_EXT for now, it's for special cases and usually not necessary. If you enable it, even a simple hello-world program on Windows and macOS will depend on (and must be linked with) Cairo libraries which is not usually what you want.
I want to switch of antialiasing for some of my drawing operations.The fl_antialias() function did not change the behaviour. I simply can call it with 1 or 0 and I can't see any changes. Not for lines, not for text.
On my system ( linux/fedora 6.17.7-200.fc42.x86_64 )I had installedwayland-devel.x86_64 1.24.0-1.fc42but to get cmake happy to find wayland libs it also needs:wayland-protocols-devel.noarch 1.45-1.fc42
Did fl_draw() not draw with cairo?How can I set antialiasing off for text for fl_draw in this case? Not important, as I can draw with cairo directly, but maybe interesting for others two.