1) Install Cairo for Mac. You can install it by darwinports. You should change the Portfile to enable cairo for configuration. The file located at /opt/local/var/macports/sources/rsync.macports.org/release/ports/graphics/cairo on my machine. Maybe there is another better way to do it, for example Port Variants.

2) check out the cairo demo code.
cvs -d :pserver:anoncvs@cvs.cairographics.org:/cvs/cairo co cairo-demo<br />
3) Then there is a project named QuartzCaiorTest. Change the main.c to
use the new API

//surface = cairo_quartz_surface_create(context, width, height);
surface =  cairo_quartz_surface_create_for_cg_context(context, width, height);

4) run “make” within project directory.

cairo

The counterpart of Google on vector graphic library is Skia. It is also can built on Mac OS:https://skia.org/user/quick/macos.