cairod ~master
cairo bindings and wrappers for the D programming language.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
cairoD
This is a D2 binding and wrapper for the cairo graphics library.
Currently cairoD targets cairo version 1.10.2.
Homepage: https://github.com/cairoD/cairoD
API Documentation: https://cairod.github.io/cairoD/api/cairo/cairo.html
Examples
The cairoD library ships with some examples in the examples directory. Some of these examples are ported from cairographics.org, some are original. To build these examples, simply use dub:
dub run
On windows you have to manually copy the DLLs into the bin directory. Run
dub build
This will build the example and copy the executable to the bin directory. Then copy all DLLs from /lib/32 or /lib/64 into the bin directory and run the example.exe manually.
Some examples can directly present the results in a GTK2 or GTK3 window. Simply use the correct dub configurations:
dub run --config=gtk2
dub run --config=gtk3
Building
You can use [dub] to make this library a dependency for your project.
Windows support
cairoD can be used on windows, but it requires cairo DLLs and matching import libraries. We provide a set of DLLs and import libraries in the lib directory. Copy the lib folder into your dub project and then use this dub configuration to support all windows compilers:
"libs-windows-x86-dmd": ["lib/32/mars/cairo"],
"libs-windows-x86-gdc": ["lib/32/msvc_mingw/cairo"],
"libs-windows-x86-ldc": ["lib/32/msvc_mingw/cairo"],
"libs-windows-x86_64": ["lib/64/cairo"],
"copyFiles-windows-x86": ["lib/32/*.dll"],
"copyFiles-windows-x86_64": ["lib/64/*.dll"]
Note:
cairoD currently uses the windows-headers package for the Win32Surface. Use the CairoWindowsDruntime
version if you want to use the windows bindings shipped with D version 2.070+.
Customizing the cairoD configuration
The cairo library provides certain features as optional extensions. CairoD does not provide access to these extensions by default. To enable the extensions, pass the matching version to your D compiler or specify the versions in your dub.json file:
"dependencies": {
"cairod": {"version": "~>0.0.1"}
},
"versions": ["CairoPNG"]
The following versions are available:
version name | Cairo C feature | Description |
---|---|---|
CairoPNG | CAIROHASPNG_FUNCTIONS | Enable loading/saving of PNG files |
CairoPSSurface | CAIROHASPS_SURFACE | Enable cairo.ps module |
CairoPDFSurface | CAIROHASPDF_SURFACE | Enable cairo.pdf module |
CairoSVGSurface | CAIROHASSVG_SURFACE | Enable cairo.svg module |
CairoFTFont | CAIROHASFT_FONT | Enable cairo.ft module (FreeType fonts) |
CairoWin32Surface | CAIROHASWIN32_SURFACE | Enable cairo.win32 module (rendering) |
CairoWin32Font | CAIROHASWIN32_FONT | Enable cairo.win32 module (fonts) |
CairoXlibSurface | CAIROHASXLIB_SURFACE | Enable cairo.xlib module |
CairoXCBSurface | CAIROHASXCB_SURFACE | Enable cairo.xcb module |
CairoDirectFBSurface | CAIROHASDIRECTFB_SURFACE | Enable cairo.directfb module |
CairoWindowsDruntime | - | Use core.sys.windows instead of windows-headers |
Links
- Cairo homepage.
License
Distributed under the Boost Software License, Version 1.0.
See the accompanying file LICENSE10.txt or view it online.
- Registered by Johannes Pfau
- ~master released 7 years ago
- cairoD/cairoD
- github.com/cairoD/cairoD
- BSL-1.0
- Copyright © 2011-2015, Johannes Pfau
- Authors:
- Dependencies:
- derelict-ft
- Versions:
-
0.0.1-alpha.3+1.10.2 2016-Feb-03 0.0.1-alpha.2+1.10.2 2015-Dec-20 0.0.1-alpha.1+1.10.2 2015-Dec-20 ~master 2017-May-01 - Download Stats:
-
-
15 downloads today
-
53 downloads this week
-
393 downloads this month
-
157402 downloads total
-
- Score:
- 4.1
- Short URL:
- cairod.dub.pm