Skip to content

ungerik/go-cairo

Folders and files

NameName
Last commit message
Last commit date
Jan 12, 2022
Nov 11, 2013
Mar 17, 2021
Aug 22, 2012
Aug 24, 2012
Aug 15, 2022
Mar 3, 2024
Mar 3, 2024
Mar 17, 2021
Mar 17, 2021
Oct 23, 2015
Mar 4, 2024

Repository files navigation

go-cairo

Go binding for the cairo graphics library

Based on Dethe Elza's version https://bitbucket.org/dethe/gocairo but significantly extended and updated.

Go specific extensions:

  • NewSurfaceFromImage(image.Image)
  • Surface.GetData() []byte
  • Surface.SetData([]byte)
  • Surface.GetImage() image.Image
  • Surface.SetImage(image.Image)

go-cairo also sports a sub package extimage with image.Image/draw.Image implementations for 32 bit ARGB and 24 bit RGB color models.

Overview:

Missing features

  • TextCluster
  • FontExtents
  • FontFace
  • FontOptions
  • ScaledFont
  • Glyph

Installation:

Install cairo:

For Debian and Debian derivatives including Ubuntu:

sudo apt-get install libcairo2-dev

For Fedora:

sudo yum install cairo-devel

For openSUSE:

zypper install cairo-devel

For Arch Linux: (also gcc and pkgconf are required)

sudo pacman -S cairo

For MacOS you may get errors finding cairo-pdf.h. To fix this run:

xcode-select --install

Install go-cairo and run go-cairo-example:

go get github.com/ungerik/go-cairo
go install github.com/ungerik/go-cairo/go-cairo-example && go-cairo-example

Copyrights: See LICENSE file

Bitdeli Badge

About

Go binding for the cairo graphics library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages