{"id":17975359,"url":"https://github.com/chris00/ocaml-cairo","last_synced_at":"2025-04-09T15:09:49.576Z","repository":{"id":9988436,"uuid":"12018610","full_name":"Chris00/ocaml-cairo","owner":"Chris00","description":"Binding to Cairo, a 2D Vector Graphics Library.","archived":false,"fork":false,"pushed_at":"2024-11-08T19:34:40.000Z","size":4168,"stargazers_count":55,"open_issues_count":10,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-09T15:09:38.932Z","etag":null,"topics":["cairo","cairo-drawing","drawing","dune","ocaml","ocaml-bindings","stroke","tutorial"],"latest_commit_sha":null,"homepage":null,"language":"OCaml","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/Chris00.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-08-10T09:29:30.000Z","updated_at":"2024-12-10T19:25:25.000Z","dependencies_parsed_at":"2025-01-01T11:06:23.077Z","dependency_job_id":"c25fb1e5-8849-4b14-8308-00b4b71e56a7","html_url":"https://github.com/Chris00/ocaml-cairo","commit_stats":{"total_commits":345,"total_committers":10,"mean_commits":34.5,"dds":0.06666666666666665,"last_synced_commit":"1a347fb5d7cc887121bc335ecd3dfc68a79f0318"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chris00%2Focaml-cairo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chris00%2Focaml-cairo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chris00%2Focaml-cairo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chris00%2Focaml-cairo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chris00","download_url":"https://codeload.github.com/Chris00/ocaml-cairo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055282,"owners_count":21040157,"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":["cairo","cairo-drawing","drawing","dune","ocaml","ocaml-bindings","stroke","tutorial"],"created_at":"2024-10-29T17:19:25.906Z","updated_at":"2025-04-09T15:09:49.561Z","avatar_url":"https://github.com/Chris00.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Continuous Integration](https://github.com/Chris00/ocaml-cairo/actions/workflows/main.yml/badge.svg)\n\nOCaml interface to Cairo\n========================\n\nThis is an OCaml binding for the\n[Cairo](http://www.cairographics.org/) library, a 2D graphics library\nwith support for multiple output devices.\n\nYou can read the API of\n[Cairo](http://chris00.github.io/ocaml-cairo/doc/cairo2/Cairo/),\n[Cairo_gtk](http://chris00.github.io/ocaml-cairo/doc/cairo2-gtk/Cairo_gtk/),\nand\n[Cairo_pango](http://chris00.github.io/ocaml-cairo/doc/cairo2-pango/Cairo_pango/)\nonline.\n\nPrerequisites\n-------------\n\nYou need the development files of Cairo (see the\n[conf-cairo](https://github.com/ocaml/opam-repository/blob/master/packages/conf-cairo/conf-cairo.1/opam#L7)\npackage)\nand the OCaml package\n``lablgtk2`` (in the [OPAM](https://opam.ocaml.org/) package\n``lablgtk``).\n\nCompilation \u0026 Installation\n--------------------------\n\nThe easier way to install this library — once the prerequisites are set\nup — is to use [opam](http://opam.ocaml.org/):\n\n    opam install cairo2\n\nIf you would like to compile from the sources, install [Dune][]\n\n    opam install dune\n\nand do:\n\n    dune build @install\n\nor just `make`.  You can then install it with:\n\n\tdune install\n\n[Dune]: https://github.com/ocaml/dune\n\nExamples\n--------\n\nYou can read a version of the\n[Cairo tutorial](http://chris00.github.io/ocaml-cairo/) using\nthis module.  The code of this tutorial is available in the\n``examples/`` directory.  To compile it, just do\n\n    dune build @examples\n\nAll the examples below are available (with some comments) by clicking\non images in the [tutorial](http://cairo.forge.ocamlcore.org/tutorial/).\n\n### Basic examples\n\n- [stroke.ml](examples/stroke.ml) shows how to draw (stroke) a simple\n  rectangle on a PNG surface.\n- [stroke.ml](examples/stroke.ml) shows how to fill a simple\n  rectangle on a PNG surface.\n- [showtext.ml](examples/showtext.ml) illustrates how to select a font\n  and draw some text on a PNG surface.\n- [paint.ml](examples/paint.ml) shows how to paint the current source\n  everywhere within the current clip region.\n- [mask.ml](examples/mask.ml) shows how to apply a radial transparency\n  mask on top of a linear gradient.\n- [setsourcergba.ml](examples/setsourcergba.ml) produces\n\n  ![Source RGBA](http://cairo.forge.ocamlcore.org/tutorial/setsourcergba.png)\n\n- [setsourcegradient.ml](examples/setsourcegradient.ml) shows how to use\n  radial and linear patterns.  It generates:\n\n  ![Gradient](http://cairo.forge.ocamlcore.org/tutorial/setsourcegradient.png)\n\n- [path_close.ml](examples/path_close.ml) shows how to draw a closed\n  path.  It produces the PNG:\n\n  ![close path](http://cairo.forge.ocamlcore.org/tutorial/path-close.png)\n\n- [textextents.ml](examples/textextents.ml) displays graphically the various\n  dimensions one can request about text.  It generates the PNG:\n\n  ![text](http://cairo.forge.ocamlcore.org/tutorial/textextents.png)\n\n- [text_extents.ml](examples/text_extents.ml) exemplifies drawing\n  consecutive UTF-8 strings in a PDF file.  Some helping lines are\n  also added to show the text extents.\n\n- [tips_ellipse.ml](examples/tips_ellipse.ml) shows the action of\n  dilation on the line width and how to properly draw ellipses.\n  It generates the PNG:\n\n  ![ellipse](http://cairo.forge.ocamlcore.org/tutorial/tips_ellipse.png)\n\n- [tips_letter.ml](examples/tips_letter.ml) illustrates the wrong way\n  of centering characters based on their individual extents:\n\n  ![letters](http://cairo.forge.ocamlcore.org/tutorial/tips_letter.png)\n\n  Instead, one should combine them with the font extents as shown in\n  [tips_font.ml](examples/tips_font.ml) to have:\n\n  ![fonts](http://cairo.forge.ocamlcore.org/tutorial/tips_font.png)\n\n\n### Examples generating the images of the tutorial\n\n- [diagram.ml](examples/diagram.ml) draw the images of the section\n  [Cairo's Drawing Model](http://cairo.forge.ocamlcore.org/tutorial/#drawing_model):\n\n  ![destination](http://cairo.forge.ocamlcore.org/tutorial/destination.png)\n  ![source](http://cairo.forge.ocamlcore.org/tutorial/source.png)\n  ![the mask](http://cairo.forge.ocamlcore.org/tutorial/the-mask.png)\n  ![stroke](http://cairo.forge.ocamlcore.org/tutorial/stroke.png)\n  ![fill](http://cairo.forge.ocamlcore.org/tutorial/fill.png)\n  ![show text](http://cairo.forge.ocamlcore.org/tutorial/showtext.png)\n  ![paint](http://cairo.forge.ocamlcore.org/tutorial/paint.png)\n  ![mask](http://cairo.forge.ocamlcore.org/tutorial/mask.png)\n\n- [draw.ml](examples/draw.ml) generates the various images in\n  [Drawing with Cairo](http://cairo.forge.ocamlcore.org/tutorial/#drawing_with_cairo), namely:\n\n  ![Source RGBA](http://cairo.forge.ocamlcore.org/tutorial/setsourcergba.png)\n  ![Gradient](http://cairo.forge.ocamlcore.org/tutorial/setsourcegradient.png)\n  ![moveto](http://cairo.forge.ocamlcore.org/tutorial/path-moveto.png)\n  ![lineto](http://cairo.forge.ocamlcore.org/tutorial/path-lineto.png)\n  ![arcto](http://cairo.forge.ocamlcore.org/tutorial/path-arcto.png)\n  ![curveto](http://cairo.forge.ocamlcore.org/tutorial/path-curveto.png)\n  ![close path](http://cairo.forge.ocamlcore.org/tutorial/path-close.png)\n  ![text](http://cairo.forge.ocamlcore.org/tutorial/textextents.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris00%2Focaml-cairo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchris00%2Focaml-cairo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris00%2Focaml-cairo/lists"}