SVGFonts-1.6.0.1: Fonts from the SVG-Font format

Copyright(c) 2011 Tillmann Vogt
LicenseBSD3
MaintainerTillmann Vogt <tillk.vogt@googlemail.com>
Stabilitystable
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Graphics.SVGFonts.ReadPath

Description

Parsing the SVG path command, see http://www.w3.org/TR/SVG/paths.html#PathData :

Synopsis

Documentation

pathFromString :: Fractional n => String -> Either String [PathCommand n] #

Convert a SVG path string into a list of commands

data PathCommand n #

Constructors

M_abs !(n, n)

Establish a new current point (with absolute coords)

M_rel !(n, n)

Establish a new current point (with coords relative to the current point)

Z

Close current subpath by drawing a straight line from current point to current subpath's initial point

L_abs !(n, n)

A line from the current point to (n, n) which becomes the new current point

L_rel !(n, n) 
H_abs !n

A horizontal line from the current point (cpx, cpy) to (x, cpy)

H_rel !n 
V_abs !n

A vertical line from the current point (cpx, cpy) to (cpx, y)

V_rel !n 
C_abs !(n, n, n, n, n, n)

Draws a cubic Bézier curve from the current point to (x,y) using (x1,y1) as the ^control point at the beginning of the curve and (x2,y2) as the control point at the end of the curve.

C_rel !(n, n, n, n, n, n) 
S_abs !(n, n, n, n)

Draws a cubic Bézier curve from the current point to (x,y). The first control point is assumed to be the reflection of the second control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not an C, c, S or s, assume the first control point is coincident with the current point.) (x2,y2) is the second control point (i.e., the control point at the end of the curve).

S_rel !(n, n, n, n) 
Q_abs !(n, n, n, n)

A quadr. Bézier curve from the curr. point to (x,y) using (x1,y1) as the control point

Q_rel !(n, n, n, n)

Nearly the same as cubic, but with one point less

T_abs !(n, n)

T_Abs = Shorthand/smooth quadratic Bezier curveto

T_rel !(n, n) 
A_abs

A = Elliptic arc (not used)

A_rel 

Instances