{"id":15113379,"url":"https://github.com/gitgnu/gnu_guile-cairo","last_synced_at":"2026-02-09T01:30:45.063Z","repository":{"id":84520598,"uuid":"90386038","full_name":"gitGNU/gnu_guile-cairo","owner":"gitGNU","description":null,"archived":false,"fork":false,"pushed_at":"2017-05-05T14:44:26.000Z","size":594,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T01:14:26.473Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gitGNU.png","metadata":{"files":{"readme":"README","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-05T14:44:22.000Z","updated_at":"2019-12-22T21:48:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"74e12a64-c408-41c9-9720-1e60b471bbf6","html_url":"https://github.com/gitGNU/gnu_guile-cairo","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitGNU%2Fgnu_guile-cairo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitGNU%2Fgnu_guile-cairo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitGNU%2Fgnu_guile-cairo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitGNU%2Fgnu_guile-cairo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitGNU","download_url":"https://codeload.github.com/gitGNU/gnu_guile-cairo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247103307,"owners_count":20884023,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-26T01:04:40.735Z","updated_at":"2026-02-09T01:30:45.014Z","avatar_url":"https://github.com/gitGNU.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Guile-Cairo README\nLast updated 23 April 2011.\n\n\nAbout Guile-Cairo\n=================\n\nGuile-Cairo wraps the Cairo graphics library for Guile Scheme.\n\n\nA pasteable introduction to using Guile-Cairo\n=============================================\n\n;; Paste this into your guile interpreter!\n\n;; This wrapset defines a module `(cairo)'\n\n(use-modules (cairo))\n\n;; Cairo procedures all start with `cairo-'\n\n(cairo-version-string)\n;; =\u003e \"1.10.2\"\n\n;; For most useful things, you have to make a surface first\n\n(define surf (cairo-image-surface-create 'argb32 140 100))\n\n;; Given a surface, you can create a cairo context, and start drawing\n\n(define cr (cairo-create surf))\n\n;; You then need to make a source\n\n(cairo-select-font-face cr \"Bitstream Vera Sans\" 'normal 'normal)\n(cairo-scale cr 100 100)\n(define pat (cairo-pattern-create-linear 0 0 1 1))\n(cairo-pattern-add-color-stop-rgba pat 1 1 0 0 1)\n(cairo-pattern-add-color-stop-rgba pat 0 0 0 1 1)\n(cairo-set-source cr pat)\n\n;; Then you make your mask\n\n(cairo-set-font-size cr 0.4)\n(cairo-move-to cr 0.0 0.6)\n(cairo-show-text cr \"(cairo)\")\n\n;; Finally you can write the surface out to a file if you want\n\n(cairo-surface-write-to-png surf \"/tmp/guile-cairo.png\")\n\n;; Functions that write out to files always take the filename as their\n;; last argument, which is optional. If you leave it out, guile-cairo\n;; will write to the current output port. So this is another way of\n;; doing the same thing:\n\n(with-output-to-file \"/tmp/guile-cairo.png\"\n  (lambda () (cairo-surface-write-to-png surf)))\n\n;; Enumerated types are represented as symbols. The available set of\n;; symbols for any given type can be retrieved at runtime\n\n(cairo-format-get-values)\n;; =\u003e (argb32 rgb24 a8 a1)\n\n;; That's it!\n\n\nNotes\n=====\n\nGuile-Cairo wraps almost all of Cairo's procedures. Notable exceptions\ninclude functions that read or write from streams instead of files and\nraw access to image data.\n\nGuile-Cairo wraps all of Cairo's types. As mentioned above, enumerated\nvalues are represented by symbols, but functions accept integers as\nwell. Struct types like cairo_rectangle_t are represented as vectors.\nConstructors of the form cairo-make-rectangle are provided, as well as\naccessors like cairo-rectangle:x.\n\n\nUsing Guile-Cairo's C interface\n===============================\n\nThese days Cairo forms a part of many software stacks; its types are\nseen in the APIs of a number of other libraries. Guile-Cairo provides an\ninterface to represent all cairo C types as scheme values.\n\nTo build against this library in your C program, first you will need to\nget the CFLAGS and LDFLAGS to link against libguile-cairo. Autoconf\nusers should use:\n\nPKG_CHECK_MODULES(GUILE_CAIRO, guile-cairo \u003e= 1.3.0)\nAC_SUBST(GUILE_CAIRO_CFLAGS)\nAC_SUBST(GUILE_CAIRO_LDFLAGS)\n\nIn your C files you should then:\n\n  #include \u003cguile-cairo.h\u003e\n\nThe type wrapping functions are all in the form scm_to_TYPE and\nscm_from_TYPE, where TYPE could be cairo_surface, for example. For\nvector types there is also scm_fill_TYPE, which expects you to have an\nalready-allocated structure to fill. Additionally there are\nscm_take_TYPE functions that will take ownership of the pointer in\nquestion, for example for constructors and for non-refcounted opaque\nobjects like cairo_font_options_t.\n\n\nCopying Guile-Cairo\n===================\n\nDistribution of Guile-Cairo is under the LGPL. See the COPYING file for\nmore information.\n\n\nContact info\n============\n\n  Mailing List: guile-user@gnu.org\n  Homepage:     http://www.non-gnu.org/guile-cairo/\n  Download:     http://www.non-gnu.org/guile-cairo/download/\n\n\nBuild dependencies\n==================\n\n* Guile 1.8.0 or newer\n  http://www.gnu.org/software/guile/\n* Cairo 1.2.0 or newer\n  http://cairographics.org/\n\n\nInstallation quickstart\n=======================\n\nInstall using the standard autotools incantation:\n  ./configure --prefix=/opt/guile-cairo \u0026\u0026 make \u0026\u0026 make install.\n\nBuild from CVS or Arch using ./autogen.sh --prefix=/opt/guile-cairo \u0026\u0026 make.\n\nYou can run without installing, just run './env guile'.\n\n\nCopying this file\n=================\n\nCopyright (C) 2007,2011 Andy Wingo \u003cwingo pobox.com\u003e\n\nCopying and distribution of this file, with or without modification, are\npermitted in any medium without royalty provided the copyright notice\nand this notice are preserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitgnu%2Fgnu_guile-cairo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitgnu%2Fgnu_guile-cairo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitgnu%2Fgnu_guile-cairo/lists"}