Another possibility for conditional code would be to read the x_dpi resolution setting, and if it's less than a certain amount, the substitute code could kick in
Here is my guess of what it might look like in C++
#if x_dpi < 150 // (or whatever the correct call is for less than)
cairo_surface_set_fallback_resolution (surface, (x_dpi/72.0) * 300, (y_dpi/72.0) * 300);
#endif
Another possibility for conditional code would be to read the x_dpi resolution setting, and if it's less than a certain amount, the substitute code could kick in
Here is my guess of what it might look like in C++
#if x_dpi < 150 // (or whatever the correct call is for less than) set_fallback_ resolution (surface, (x_dpi/72.0) * 300, (y_dpi/72.0) * 300);
cairo_surface_
#endif