All Projects → Chris00 → ocaml-cairo

Chris00 / ocaml-cairo

Licence: LGPL-3.0 license
Binding to Cairo, a 2D Vector Graphics Library.

Programming Languages

ocaml
1615 projects
c
50402 projects - #5 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to ocaml-cairo

cairo
Package cairo provides full Go bindings for Cairo, a 2D graphics library.
Stars: ✭ 28 (-28.21%)
Mutual labels:  drawing, cairo
SwiftUI-Shapes
Commonly Used Shapes and Utilities In SwiftUI
Stars: ✭ 52 (+33.33%)
Mutual labels:  drawing
slope
C/Gtk+ data visualization library.
Stars: ✭ 91 (+133.33%)
Mutual labels:  cairo
lambda-layer-canvas-nodejs
AWS Lambda Layer with node-canvas and its dependencies packaged, provides a Cairo backed Mozilla Web Canvas API implementation
Stars: ✭ 36 (-7.69%)
Mutual labels:  cairo
Drawing
Drawing and fill color
Stars: ✭ 37 (-5.13%)
Mutual labels:  drawing
OutlineTextView
Android TextView with outline
Stars: ✭ 59 (+51.28%)
Mutual labels:  stroke
visioStencils
My 2,700 visio 🎨 shapes, stencils, symbols, and icons collection to visually represent IT infrastructure
Stars: ✭ 43 (+10.26%)
Mutual labels:  drawing
mapus
A map tool with real-time collaboration 🗺️
Stars: ✭ 2,687 (+6789.74%)
Mutual labels:  drawing
durdraw
Animated Unicode, ANSI and ASCII Art Editor for Linux/Unix/macOS
Stars: ✭ 55 (+41.03%)
Mutual labels:  drawing
live-chart
A real-time charting library for Vala and GTK3 based on Cairo
Stars: ✭ 47 (+20.51%)
Mutual labels:  cairo
grafx2
Mirror of GrafX2. Official repo is on gitlab.
Stars: ✭ 108 (+176.92%)
Mutual labels:  drawing
Cairo
Swift library for Cairo
Stars: ✭ 33 (-15.38%)
Mutual labels:  cairo
KGySoft.Drawing
KGy SOFT Drawing is a library for advanced image, icon and graphics handling.
Stars: ✭ 27 (-30.77%)
Mutual labels:  drawing
ape
The smart contract development tool for Pythonistas, Data Scientists, and Security Professionals
Stars: ✭ 339 (+769.23%)
Mutual labels:  cairo
pixelino
Pixel-drawing app for iOS ✍️
Stars: ✭ 45 (+15.38%)
Mutual labels:  drawing
ludigraphix.github.io
Documentation for Ludigraphix
Stars: ✭ 21 (-46.15%)
Mutual labels:  drawing
huion-linux-drivers
Linux user-space drivers for Huion Graphic Tablets
Stars: ✭ 154 (+294.87%)
Mutual labels:  drawing
DrawBot
Repository for DrawBot. The Discord Art bot!
Stars: ✭ 11 (-71.79%)
Mutual labels:  drawing
handwriting.js
A simple API access to the handwriting recognition service of Google IME
Stars: ✭ 89 (+128.21%)
Mutual labels:  stroke
lambda-dti
Interpreter of the ITGL with dynamic type inference
Stars: ✭ 18 (-53.85%)
Mutual labels:  dune

Continuous Integration

OCaml interface to Cairo

This is an OCaml binding for the Cairo library, a 2D graphics library with support for multiple output devices.

You can read the API of Cairo, Cairo_gtk, and Cairo_pango online.

Prerequisites

You need the development files of Cairo (see the conf-cairo package) and the OCaml package lablgtk2 (in the OPAM package lablgtk).

Compilation & Installation

The easier way to install this library — once the prerequisites are set up — is to use opam:

opam install cairo2

If you would like to compile from the sources, install Dune

opam install dune

and do:

dune build @install

or just make. You can then install it with:

dune install

Examples

You can read a version of the Cairo tutorial using this module. The code of this tutorial is available in the examples/ directory. To compile it, just do

dune build @examples

All the examples below are available (with some comments) by clicking on images in the tutorial.

Basic examples

  • stroke.ml shows how to draw (stroke) a simple rectangle on a PNG surface.

  • stroke.ml shows how to fill a simple rectangle on a PNG surface.

  • showtext.ml illustrates how to select a font and draw some text on a PNG surface.

  • paint.ml shows how to paint the current source everywhere within the current clip region.

  • mask.ml shows how to apply a radial transparency mask on top of a linear gradient.

  • setsourcergba.ml produces

    Source RGBA

  • setsourcegradient.ml shows how to use radial and linear patterns. It generates:

    Gradient

  • path_close.ml shows how to draw a closed path. It produces the PNG:

    close path

  • textextents.ml displays graphically the various dimensions one can request about text. It generates the PNG:

    text

  • text_extents.ml exemplifies drawing consecutive UTF-8 strings in a PDF file. Some helping lines are also added to show the text extents.

  • tips_ellipse.ml shows the action of dilation on the line width and how to properly draw ellipses. It generates the PNG:

    ellipse

  • tips_letter.ml illustrates the wrong way of centering characters based on their individual extents:

    letters

    Instead, one should combine them with the font extents as shown in tips_font.ml to have:

    fonts

Examples generating the images of the tutorial

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].