úÎT•QÏ      !"# !"#  !"#(A container for SVG documents. See the   function for creating them,  and the  function for accessing them. The $2 instance prints this as a complete XML document. %Gets the top-level "svg" element. 7A dots-per-inch measurement for dealing with graphics. -(To get dots per millimetre, divide by 25.4) 3A size (width and height) measured in millimetres. A wrapper around &" for measurements in millimetres. The $ instance appends "mm" to the value.  Creates an  item from an XML element. If the element is named "svg", this function will return a ' result. B If the element is named anything else, this function will return (.  Parses a )1 containing a complete XML document into an SVG. ?This function can fail in two ways: it will fail either if the ) is not F a complete valid XML document, or if the top-level element is not an "svg"  element. #Gets the size of the SVG document. QIn an ideal world, this size would be some measurement in centimetres, etc. that - would be trivial to convert to millimetres. NUnfortunately, some programs (most notably Inkscape) record the document size P in pixels, which is very unhelpful when trying to get the size of the document 1 for printing, etc. Therefore you must supply a  parameter for converting P this pixel size into millimetres. On my system, Inkscape uses a DPI of 90 but V I am not sure if this is system-specific or a constant that is used on all machines. MThe method will fail if either the width or height attributes are missing at / the top-level, or they cannot be parsed using  . Parses a coordinate/length value from an SVG file. &All valid units are supported, except "em" and "ex" which depend on the size  of the current font. The X parameter is needed in order to convert user coordinate units (pixels) to millimetres. NThis method assumes that no transformation is currently in place on the size. M It is primarily intended for parsing the size of the document, where there $ can be no transformations present. *KPlaces the given XML content (which is assumed to be a valid SVG fragment) W at the given (x, y) coordinates by wrapping them in an appropriate SVG transformation  (<g>$ element with transform attribute). ZNote that if you place the resulting element inside a transformation, that transformation N will of course apply to this element as is standard in SVG. So if you place Q something at (20, 20) then wrap that in a scale transformation with factor 0.1, " it will end up placed at (2, 2). 9Gets all the namespaces from the header of the SVG file. *Makes a blank SVG file of the given size.       +,-./0JAn item to be tiled, with an SVG image for the front, and an optional SVG N for the back. If the two images are different sizes, the smallest size that P can accommodate both is used for tiling. This means that if you have a larger M back image, the front will have enough space left to match up with the back  (and vice versa). 6The label is currently only used for error reporting. bThe settings for tiling: the paper size, margin (same on all sides) and gap (between tiled items) 123Tiles the given items. RThis function takes a list of front (and optional back) SVG images, then arranges A them using the given paper size, margin and gaps between items. G The return is a list of front images (with back images where needed). QThis method is intended to be used to put multiple small SVG items onto a single  page for printing. PThe layout algorithm is very simple. It places the first item in the top-left, L then attempts to fill the rest of the row with the next items in the list. N Once a row is full, it moves down to make more rows, until the page is full. O Thus, list items will always appear in the order they are given, and you can Q potentially get some wasted space, especially if the items vary wildly in size, # and are not sorted by size first. JThis method can fail because it cannot get the sizes of the items to tile  using  8, because there are conflicts between the namespaces of K the files, or because there are one or more items in the list that cannot % fit on a single page by themselves. 45   IParses a paper size which can either be a known name or a detailed size. Paper sizes such as "a4"E are not part of the SVG specification; this helper is provided here J in case you want help getting a paper size from a command-line argument. OThis recognises two styles of paper size. One is a literal name from the list  below, and the other is " width*height"' (no spaces around the asterisk) where < width and height are valid SVG sizes that can be parsed by   (using  a DPI of 90). The g list of literal sizes, recognised case-insensitive (most of which are from the ISO 216 standard), is:  "a4", " a4portrait": 210mm*297mm  " a4landscape": 297mm*210mm  "a3", " a3portrait": 297mm*420mm  " a3landscape": 420mm*297mm  "letter": 215.9mm*279.4mm 6       !"#$%&'()$*+$*,$-./01123456789: svgutils-0.1 Data.SVG.SVG Data.SVG.TileData.SVG.PaperData.SVG.Internal.FailSVG getSVGElementDPISizemmWidthmmHeightMMmakeSVGparseSVG getSVGSize parseCoordplaceAt namespaces makeBlankSVGTileItem tileLabel tileFronttileBack TileSettings tilePaperSize tileMargintileGapignoreNamespaceConflictstileSVGsparsePaperSizeFailMOKFailrunFail maybeFail maybeReadbaseGHC.ShowShowghc-prim GHC.TypesDouble Data.MaybeJustNothingGHC.BaseString splitUnitsTiledRowInfo_curX_curY _rowHeightsizeAfterMargin getTileSizemaxSize mergeAttrs makeTileSVG