make

fun make(bounds: Rect, out: WStream): Canvas

Returns a new canvas that will generate SVG commands from its draw calls, and send them to the provided stream. Ownership of the stream is not transfered, and it must remain valid for the lifetime of the returned canvas.

The canvas may buffer some drawing calls, so the output is not guaranteed to be valid or complete until the canvas instance is deleted.

Return

new Canvas

Parameters

bounds

defines an initial SVG viewport (viewBox attribute on the root SVG element).

out

stream SVG commands will be written to


fun make(left: Float, top: Float, right: Float, bottom: Float, out: WStream, convertTextToPaths: Boolean, prettyXML: Boolean): Canvas

Returns a new canvas that will generate SVG commands from its draw calls, and send them to the provided stream. Ownership of the stream is not transfered, and it must remain valid for the lifetime of the returned canvas.

The canvas may buffer some drawing calls, so the output is not guaranteed to be valid or complete until the canvas instance is deleted.

Return

new Canvas

Parameters

left

left coordinate of an initial SVG viewport (viewBox attribute on the root SVG element).

top

top coordinate of an initial SVG viewport (viewBox attribute on the root SVG element).

right

right coordinate of an initial SVG viewport (viewBox attribute on the root SVG element).

bottom

bottom coordinate of an initial SVG viewport (viewBox attribute on the root SVG element).

out

stream SVG commands will be written to

convertTextToPaths

emit text as s

prettyXML

add newlines and tabs in output


fun make(bounds: Rect, out: WStream, convertTextToPaths: Boolean, prettyXML: Boolean): Canvas

Returns a new canvas that will generate SVG commands from its draw calls, and send them to the provided stream. Ownership of the stream is not transfered, and it must remain valid for the lifetime of the returned canvas.

The canvas may buffer some drawing calls, so the output is not guaranteed to be valid or complete until the canvas instance is deleted.

Return

new Canvas

Parameters

bounds

defines an initial SVG viewport (viewBox attribute on the root SVG element).

out

stream SVG commands will be written to

convertTextToPaths

emit text as s

prettyXML

add newlines and tabs in output