SVGDocument

Renders 2D commands in a SVG file. For comparisons between PDF and SVG.

Constructors

this
this(float pageWidthMm, float pageHeightMm)

Undocumented in source.

Members

Functions

beginPath
void beginPath(float x, float y)

Undocumented in source. Be warned that the author may not have intended to support it.

bytes
const(ubyte)[] bytes()

Undocumented in source. Be warned that the author may not have intended to support it.

closePath
void closePath()

Undocumented in source. Be warned that the author may not have intended to support it.

drawImage
void drawImage(Image image, float x, float y)

Undocumented in source. Be warned that the author may not have intended to support it.

drawImage
void drawImage(Image image, float x, float y, float width, float height)

Undocumented in source. Be warned that the author may not have intended to support it.

fill
void fill()

Undocumented in source. Be warned that the author may not have intended to support it.

fillAndStroke
void fillAndStroke()

Undocumented in source. Be warned that the author may not have intended to support it.

fillRect
void fillRect(float x, float y, float width, float height)

Undocumented in source. Be warned that the author may not have intended to support it.

fillStyle
void fillStyle(Brush brush)

Undocumented in source. Be warned that the author may not have intended to support it.

fillText
void fillText(string text, float x, float y)

Undocumented in source. Be warned that the author may not have intended to support it.

fontFace
void fontFace(string fontFace)

Undocumented in source. Be warned that the author may not have intended to support it.

fontSize
void fontSize(float size)

Undocumented in source. Be warned that the author may not have intended to support it.

fontStyle
void fontStyle(FontStyle fontStyle)

Undocumented in source. Be warned that the author may not have intended to support it.

fontWeight
void fontWeight(FontWeight fontWeight)

Undocumented in source. Be warned that the author may not have intended to support it.

getXMLHeader
string getXMLHeader()

Undocumented in source. Be warned that the author may not have intended to support it.

lineTo
void lineTo(float dx, float dy)

Undocumented in source. Be warned that the author may not have intended to support it.

lineWidth
void lineWidth(float width)

Undocumented in source. Be warned that the author may not have intended to support it.

measureText
TextMetrics measureText(string text)

Undocumented in source. Be warned that the author may not have intended to support it.

newPage
void newPage()

Start a new page, finish the previous one.

pageHeight
float pageHeight()

Undocumented in source. Be warned that the author may not have intended to support it.

pageWidth
float pageWidth()

Undocumented in source. Be warned that the author may not have intended to support it.

restore
void restore()

Restore the graphical contect: transformation matrices.

rotate
void rotate(float angle)

Undocumented in source. Be warned that the author may not have intended to support it.

save
void save()

Undocumented in source. Be warned that the author may not have intended to support it.

scale
void scale(float x, float y)

Undocumented in source. Be warned that the author may not have intended to support it.

stroke
void stroke()

Undocumented in source. Be warned that the author may not have intended to support it.

strokeRect
void strokeRect(float x, float y, float width, float height)

Undocumented in source. Be warned that the author may not have intended to support it.

strokeStyle
void strokeStyle(Brush brush)

Undocumented in source. Be warned that the author may not have intended to support it.

textAlign
void textAlign(TextAlign alignment)

Undocumented in source. Be warned that the author may not have intended to support it.

textBaseline
void textBaseline(TextBaseline baseline)

Undocumented in source. Be warned that the author may not have intended to support it.

translate
void translate(float dx, float dy)

Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From IRenderingContext2D

pageWidth
float pageWidth()

Number of units in a page. Return: Page width in millimeters.

pageHeight
float pageHeight()

Number of units in a page. Return: Page height in millimeters.

save
void save()

Push state on state stack. What this states contains: - transformation matrices

restore
void restore()

Pop state stack and restore state

newPage
void newPage()

Start a new page, finish the previous one. This invalidates any transformation. The origin (0, 0) becomes again the top-left point of each page.

scale
void scale(float x, float y)

Changes the transformation matrix to apply a scaling transformation with the given characteristics.

translate
void translate(float dx, float dy)

Changes the transformation matrix to apply a translation transformation with the given characteristics.

rotate
void rotate(float angle)

Changes the transformation matrix to apply a rotation transformation with the given characteristics. The angle is in radians, the direction is clockwise. Params: angle The rotation angle, in radians.

drawImage
void drawImage(Image image, float x, float y)

Draws an image at the given position.

drawImage
void drawImage(Image image, float x, float y, float width, float height)

Draws an image at the given position, with the given width and height. Both width and height must be provided.

fillStyle
void fillStyle(Brush brush)

Changes the current fill brush. Params: color Any HTML color string.

strokeStyle
void strokeStyle(Brush brush)

Changes the current stroke brush. Params: color Any HTML color string.

fillRect
void fillRect(float x, float y, float width, float height)
strokeRect
void strokeRect(float x, float y, float width, float height)

Undocumented in source.

fillText
void fillText(string text, float x, float y)

Draw filled text.

beginPath
void beginPath(float x, float y)

The context always has a current default path. There is only one current path, it is not part of the drawing state. Resets the current path, and move the cursor to (x, y).

lineWidth
void lineWidth(float width)

Change the width of a line. The whole path has the same line width.

lineTo
void lineTo(float dx, float dy)

Add a subpath forming a line. Its exact width is set when the path is drawn with fill, stroke or fillAndStroke.

fill
void fill()

Fills the subpaths of the current path or the given path with the current fill style. Uses the last set fill style, line width for the whole path.

stroke
void stroke()

Strokes the subpaths of the current path or the given path with the current stroke style. Uses the last set fill style, line width for the whole path.

fillAndStroke
void fillAndStroke()

Both fills and strokes the subpaths of the current path, in a more efficient way than calling fill and stroke separately. Uses the last set fill style, line width for the whole path.

closePath
void closePath()

Close the path, returning to the initial first point. TODO: specify exactly what it does.

fontFace
void fontFace(string fontFace)

Changes font face (default = Helvetica)

fontWeight
void fontWeight(FontWeight fontWeight)

Changes font weight (Default = FontWeight.normal)

fontStyle
void fontStyle(FontStyle fontStyle)

Changes font style (default = FontStyle.normal)

fontSize
void fontSize(float sizeInPt)

Changes font size in points (default = 11pt) Warning: not millimeters.

textAlign
void textAlign(TextAlign alignment)

Changes text alignment (default = TextAlign.start)

textBaseline
void textBaseline(TextBaseline baseline)

Changes text baseline (default = TextBaseline.alphabetic)

measureText
TextMetrics measureText(string text)

Returns a TextMetrics struct that contains information about the measured text (such as its width, for example).

Meta