package vg
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=ccd0d0f61cdbdb3420b5f4d747fe6e6b95e487738f70163a6e26396b1eeb9a42118306bc9c2c9afc9256171d57f81fbdf08ec558625eb5d723230aa0e9564fb6
doc/vg/Vgr_svg/index.html
Module Vgr_svg
SVG renderer.
References.
- Erik Dahlström et al. Scalable Vector Graphics (SVG) 1.1, 2011.
SVG render targets
val target :
?xml_decl:bool ->
?xmp:string ->
unit ->
Vg.Vgr.dst_stored Vg.Vgr.targettarget xml_decl xmp () is an SVG render target for rendering to the stored destination given to Vg.Vgr.create.
xml_decl, iftrue(default) the XML declaration is output.xmpis an optional UTF-8 encoded XML XMP metadata packet describing the SVG document (see ISO 16684-1 or the equivalent Adobe spec.). The convenience functionVg.Vgr.xmpcan be used to generate a packet.
Multiple images. Multiple image renders on the target are not supported. Invalid_argument is raised by Vg.Vgr.render if multiple images are rendered.
Text rendering
Warning. The following is subject to change in the future.
Currently text rendering uses SVG's CSS font selection mechanism and doesn't support the glyph API.
Given a glyph cut:
Vg.I.cut_glyphs ~text ~blocks ~advances font glyphs
The blocks, advances and glyphs parameters are ignored. text must be provided and is used to define the text to render. font is used to select the font in a CSS stylesheet.
Render warnings and limitations
The following render warnings are reported.
`Unsupported_cut (`O o, i), outline area cuts can be performed only on (possibly transformed)Vg.I.const,Vg.I.axialandVg.I.radialimages.`Unsupported_glyph_cut (a, i), glyph cuts can be performed only on (untransformed)Vg.I.const,Vg.I.axialandVg.I.radialimages.`Textless_glyph_cut iif notextargument is specified in a glyph cut.
The following limitations should be taken into account.
- Generated SVG files do specify that gradient interpolation must be done in linear sRGB space, however many SVG viewers do not respect that directive (e.g. most browsers).