module Vgr_htmlc:sig
..end
References.
Release 0.8.0 — Daniel Bünzli <daniel.buenzl i@erratique.ch>
val target : ?resolution:Gg.v2 -> Dom_html.canvasElement Js.t -> [ `Other ] Vg.Vgr.target
target resolution c
is a render target for rendering to the canvas
element c
.
resolution
, specifies the rendering resolution in samples per
meters. If unspecified 11811 pixels per meters (300 ppi) is used in both
dimensions.
Multiple images. Multiple images render on the target is supported.
Each new render clears the HTML canvas.
Text rendering uses the HTML canvas CSS font selection mechanism. As there is no control over glyph rendering in the HTML canvas, the glyph API is unsupported.
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 the CSS stylesheet. Make sure
that the fonts you use are embedded and loaded in your DOM via
@font-face
.
At the moment the renderer also needs to work around a particular
browser bug which means that glyph cuts are currently limited to
non-outline area cuts in I.const
images.
The following render warnings are reported.
`Unsupported_cut ((`O o), i)
, outline area cuts can be performed
only on (possibly transformed) I.const
, I.axial
and I.radial
primitive images.`Unsupported_glyph_cut (a, i)
, glyph cuts can be performed only
on bare I.const
primitive images and outline area glyph cuts are
currently unsupported.`Textless_glyph_cut i
if no text
argument is specified in a glyph
cut.`Other _
if dashes are rendered but unsupported by the browser.The following limitations should be taken into account.