Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cairo renderer #7

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f4c136d
Add a cairo2 renderer to the build system
art-w Dec 9, 2014
501d6f7
Add a minimal cairo2 example
art-w Dec 9, 2014
70ee982
Vgr_cairo2: cost semantics
art-w Dec 9, 2014
b8adbaa
Vgr_cairo2: subset implementation based on Vgr_htmlc
art-w Dec 9, 2014
8432555
Vgr_cairo2: stroke and dash
art-w Dec 9, 2014
a07a50e
Vgr_cairo2: gradients
art-w Dec 10, 2014
9df466e
Vgr_cairo2: glyphs
art-w Dec 10, 2014
2dcc1e2
Add Vgr_cairo2 to the doc build
art-w Dec 10, 2014
d1fb37c
Vgr_cairo2: multiple images
art-w Dec 10, 2014
3a7212c
Vgr_cairo2: document the API
art-w Dec 10, 2014
98d1d60
Vgr_cairo2: coding convention
art-w Dec 10, 2014
10c33be
Vgr_cairo2: quadratic curves
art-w Dec 10, 2014
6655a88
Vgr_cairo2: correct sizing of minimal example
art-w Dec 10, 2014
d139b7d
Vgr_cairo2: add PNG and PSD targets
art-w Dec 10, 2014
cd7ab90
Vgr_cairo2: bugfix, gradients and arcs
art-w Dec 10, 2014
28e7923
Vgr_cairo2: bugfix, sRGB
art-w Dec 10, 2014
67be045
Vgr_cairo2: update minimal example to output PNG
art-w Dec 10, 2014
ed66626
Vgr_cairo2: output db examples to PDF
art-w Dec 10, 2014
e4c5aff
Rstored: allow renderers to have multiple file formats
art-w Dec 11, 2014
2efa3cb
Vgr_cairo2: rcairo2 has multiple formats
art-w Dec 11, 2014
407ed90
Add cairo2 to .merlin
art-w Dec 11, 2014
733bf8d
Vgr_cairo2: add PS and SVG formats
art-w Dec 11, 2014
ed63b24
Vgr_cairo2: update copyright
art-w Dec 11, 2014
bb03cdf
Rename to Vgr_cairo
art-w Dec 11, 2014
18de4d7
Vgr_cairo: update dependencies in README
art-w Dec 11, 2014
22fc3da
Vgr_cairo: documentation
art-w Dec 12, 2014
869524b
Vgr_cairo: resolution
art-w Dec 12, 2014
380c478
Vgr_cairo: update min_cairo example
art-w Dec 12, 2014
b687f64
Vgr_cairo: documentation, correct resolution
art-w Dec 12, 2014
451dbdc
Vgr_cairo: small adjustments
art-w Dec 15, 2014
a76eb2c
Vgr_cairo: bugfix, bold weight at 700
art-w Dec 15, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .merlin
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
EXT js
PKG gg js_of_ocaml
PKG gg js_of_ocaml cairo2
B _build/**
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ images are values that denote functions mapping points of the
cartesian plane to colors. The module provides combinators to define
and compose these values.

Renderers for PDF, SVG and the HTML canvas are distributed with the
Renderers for PDF, SVG, Cairo and the HTML canvas are distributed with the
module. An API allows to implement new renderers.

Vg depends only on [Gg][1]. The SVG renderer has no dependency, the
PDF renderer depends on [Uutf][2] and [Otfm][3], the HTML canvas
renderer depends on [js_of_ocaml][4]. Vg and its renderers are
distributed under the BSD3 license.
renderer depends on [js_of_ocaml][4], the Cairo renderer depends on
[cairo2][5]. Vg and its renderers are distributed under the BSD3
license.

[1]: http://erratique.ch/software/gg
[2]: http://erratique.ch/software/uutf
[3]: http://erratique.ch/software/otfm
[4]: http://ocsigen.org/js_of_ocaml/
[5]: https://forge.ocamlcore.org/projects/cairo/

Home page: http://erratique.ch/software/vg
Contact: Daniel Bünzli `<daniel.buenzl i@erratique.ch>`
Expand All @@ -28,8 +30,8 @@ Contact: Daniel Bünzli `<daniel.buenzl i@erratique.ch>`

Vg can be installed with `opam`:

opam install vg # SVG renderer only
opam install uutf otfm js_of_ocaml vg # all renderers
opam install vg # SVG renderer only
opam install uutf otfm js_of_ocaml cairo2 vg # all renderers

If you don't use `opam` consult the [`opam`](opam) file for
build instructions and a complete specification of the dependencies.
Expand Down Expand Up @@ -64,6 +66,8 @@ The resulting binaries are in `_build/test` :
- `min_htmlc.byte`, minimal example to render with the HTML canvas.
- `rsvg.native`, renders images of the Vg image database to SVG files.
- `rpdf.native`, renders images of the Vg image database to PDF files.
- `rcairo.native`, renders images of the Vg image database with Cairo
to PDF, PNG, PS or SVG files.
- `rhtmlc.html` and `rhtmlc.byte` can be processed with `js_of_ocaml`,
the resulting webapp renders images of the Vg image database with
the HTML canvas, PDF and SVG renderers.
Expand Down
9 changes: 8 additions & 1 deletion _tags
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

<src/vgr_pdf.{mli,ml}> : package(gg), package(uutf), package(otfm)

<src/vgr_cairo.{mli,ml}>: package(gg), package(cairo2)

<db/*.{mli,ml}> : package(gg)
<db/glyphs_pdf.{mli,ml}> : package(uutf)

Expand All @@ -25,6 +27,9 @@

<test/rsvg.{mli,ml,byte,native}> : package(gg), package(uutf), package(unix)

<test/rcairo.{mli,ml,byte,native}> : package(gg), package(uutf), \
package(unix), package(cairo2)

<test/rhtmlc.{mli,ml,byte}> : package(gg), package(otfm), package(uutf), \
package(js_of_ocaml), \
package(js_of_ocaml.syntax), syntax(camlp4o)
Expand All @@ -33,6 +38,8 @@

<test/min_svg.{ml,byte,native}> : package(gg)

<test/min_cairo.{ml,byte,native}> : package(gg), package(cairo2)

<test/min_htmlc.{ml,byte}> : package(gg), package(js_of_ocaml), \
package(js_of_ocaml.syntax), syntax(camlp4o)

Expand All @@ -42,4 +49,4 @@
<test/examples.{ml,byte,native}> : package(gg)

<test/vecho.{ml,byte,native}> : package(gg), package(uutf), package(otfm)
<test/fglyphs.{ml,byte,native}> : package(gg), package(uutf), package(otfm)
<test/fglyphs.{ml,byte,native}> : package(gg), package(uutf), package(otfm)
2 changes: 1 addition & 1 deletion build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ OCAMLBUILD=${OCAMLBUILD:="ocamlbuild -tag debug -classic-display \
action ()
{
case $1 in
default) $OCAMLBUILD vg.cmx vgr_pdf.cmx vgr_svg.cmx vgr_htmlc.cmx ;;
default) $OCAMLBUILD vg.cmx vgr_pdf.cmx vgr_svg.cmx vgr_htmlc.cmx vgr_cairo.cmx ;;
tests) $OCAMLBUILD rpdf.native rsvg.native; action rhtmlc ;;
rhtmlc) shift;
pkg/db-locs
Expand Down
1 change: 1 addition & 0 deletions doc/api.odocl
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Vg
Vgr_htmlc
Vgr_pdf
Vgr_svg
Vgr_cairo
3 changes: 2 additions & 1 deletion doc/dev-api.odocl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ Vg
Vgr_htmlc
Vgr_pdf
Vgr_svg
Vgr_cairo
Mui
Db
Db
3 changes: 2 additions & 1 deletion opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ tags: [ "pdf" "svg" "html-canvas" "declarative" "graphics" "org:erratique" ]
license: "BSD3"
ocaml-version: [>= "4.01.0"]
depends: [ "ocamlfind" "gg" {>= "0.9.0"} ]
depopts: [ "uutf" "otfm" "js_of_ocaml" ]
depopts: [ "uutf" "otfm" "js_of_ocaml" "cairo2" ]
build:
[
[ "ocaml" "pkg/git.ml" ]
[ "ocaml" "pkg/build.ml" "native=%{ocaml-native}%"
"native-dynlink=%{ocaml-native-dynlink}%"
"uutf=%{uutf:installed}%"
"otfm=%{otfm:installed}%"
"cairo2=%{cairo2:installed}%"
"jsoo=%{js_of_ocaml:installed}%" ]
]
11 changes: 11 additions & 0 deletions pkg/META
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,14 @@ package "htmlc" (
archive(native, plugin) = "vgr_htmlc.cmxs"
exists_if = "vgr_htmlc.cma"
)

package "cairo" (
version = "%%VERSION%%"
description = "Vg's Cairo renderer"
requires = "vg cairo2"
archive(byte) = "vgr_cairo.cma"
archive(byte, plugin) = "vgr_cairo.cma"
archive(native) = "vgr_cairo.cmxa"
archive(native, plugin) = "vgr_cairo.cmxs"
exists_if = "vgr_cairo.cma"
)
3 changes: 3 additions & 0 deletions pkg/build.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ let uutf = Env.bool "uutf"
let otfm = Env.bool "otfm"
let jsoo = Env.bool "jsoo"
let vgr_pdf = uutf && otfm
let cairo2 = Env.bool "cairo2"

let () = Pkg.describe "vg" ~builder:`OCamlbuild [
Pkg.lib "pkg/META";
Expand All @@ -14,11 +15,13 @@ let () = Pkg.describe "vg" ~builder:`OCamlbuild [
Pkg.lib ~cond:vgr_pdf ~exts:Exts.module_library "src/vgr_pdf";
Pkg.bin ~cond:vgr_pdf ~auto:true "test/vecho";
Pkg.lib ~cond:jsoo ~exts:Exts.module_library "src/vgr_htmlc";
Pkg.lib ~cond:cairo2 ~exts:Exts.module_library "src/vgr_cairo";
Pkg.doc "README.md";
Pkg.doc "CHANGES.md";
Pkg.doc "test/min_htmlc.html";
Pkg.doc "test/min_htmlc.ml";
Pkg.doc "test/min_pdf.ml";
Pkg.doc "test/min_svg.ml";
Pkg.doc "test/min_cairo.ml";
Pkg.doc "test/fglyphs.ml";
]
Loading