Cairo
More info
- Creator
- Keith Packard and Carl Worth
- Released
- Type
- 2D vector graphics library
- License
- LGPL 2.1 or MPL 1.1
- Website
- cairographics.org
The 2D graphics library with PDF's imaging model that gave GTK, Firefox and half the Linux desktop anti-aliased vectors, whether the target was an X screen, a PDF file or an image in memory.
Keith Packard and Carl Worth started in 2002 on a library called Xr, meant as a convenient layer over XRender. When backends for things other than X arrived in 2003, the name became Cairo. The model is borrowed from PostScript and PDF: paths that are filled or stroked, curves, gradients, clipping and Porter–Duff compositing, always anti-aliased. The same code draws to an X pixmap, a Win32 or Quartz surface, a PDF, PostScript or SVG file or a plain image buffer, and that last option made it the obvious way to produce graphics on a server with no screen. The software rasteriser was split out in 2007 as pixman, which the X server shares.
Version 1.0 arrived in 2005, and GTK 2.8 switched to Cairo for all its drawing the same year; Pango layered text on top through pangocairo, with glyphs from Xft and Fontconfig. Firefox 3 moved its entire rendering engine onto Cairo in 2008, and Inkscape, Poppler and WebKitGTK followed. Being the first vector library that gave the same result on screen and in print without fuss was a bigger deal than it sounds. GTK 4 has drawn through the GPU with GSK since 2020, but Cairo remains as the fallback path and in every PDF a Linux machine has ever printed.