-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Parsing the path command of SVG -- -- Parsing the path command of SVG @package SVGPath @version 1.1 -- | parsing the SVG path command, see -- http://www.w3.org/TR/SVG/paths.html#PathData : module Graphics.SVG.ReadPath -- | convert a SVG path string into a list of commands pathFromString :: String -> IO [PathCommand] data PathCommand -- | Establish a new current point (with absolute coords) M_abs :: Tup -> PathCommand -- | Establish a new current point (with coords relative to the current -- point) M_rel :: Tup -> PathCommand -- | Close current subpath by drawing a straight line from current point to -- current subpath's initial point Z :: PathCommand -- | A line from the current point to Tup which becomes the new current -- point L_abs :: Tup -> PathCommand L_rel :: Tup -> PathCommand -- | A horizontal line from the current point (cpx, cpy) to (x, cpy) H_abs :: X -> PathCommand H_rel :: X -> PathCommand -- | A vertical line from the current point (cpx, cpy) to (cpx, y) V_abs :: Y -> PathCommand V_rel :: Y -> PathCommand -- | Draws a cubic Bzier 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_abs :: (X1, Y1, X2, Y2, X, Y) -> PathCommand C_rel :: (X1, Y1, X2, Y2, X, Y) -> PathCommand -- | Draws a cubic Bzier 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_abs :: (X2, Y2, X, Y) -> PathCommand S_rel :: (X2, Y2, X, Y) -> PathCommand -- | A quadr. Bzier curve from the curr. point to (x,y) using (x1,y1) as -- the control point Q_abs :: (X1, Y1, X, Y) -> PathCommand -- | Nearly the same as cubic, but with one point less Q_rel :: (X1, Y1, X, Y) -> PathCommand -- | T_Abs = Shorthand/smooth quadratic Bezier curveto T_abs :: Tup -> PathCommand T_rel :: Tup -> PathCommand -- | A = Elliptic arc (not used) A_abs :: PathCommand A_rel :: PathCommand -- | convert path-commands to outline points commandsToPoints :: [PathCommand] -> F2 -> F2 -> [[F2]] ctp :: [PathCommand] -> [F2] -> F2 -> Bool -> F2 -> F2 -> [[F2]] -- | bSubcurve uses bezier subdivision. (inspired by Hersch, Font -- Rasterization: the State of the Art (freely available)) It divides an -- arc into two arcs recursively until the arc is either completely -- between two vertical raster lines or completely between two horizontal -- raster lines or the line is at most 1 pixel long. This function -- computes outline points (tex==False) as well as border points for -- rasterisation (tex==True) by using an x-, y-resoultion raster. dx, dy -- is the width and height of a pixel of this raster. bSubCurve :: Bool -> (X, Y) -> [F2] -> [F2] instance Show PathCommand