Copyright | (c) 2015 Christopher Chalmers |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | diagrams-discuss@googlegroups.com |
Safe Haskell | None |
Language | Haskell2010 |
Interface to PGF. See the manual http://www.ctan.org/pkg/pgf for details.
- renderWith :: (RealFloat n, Typeable n) => Surface -> Bool -> Bool -> V2 n -> Render n -> Builder
- type RenderM n m = RWS RenderInfo Builder (RenderState n) m
- type Render n = RenderM n ()
- initialState :: (Typeable n, Floating n) => RenderState n
- scope :: Render n -> Render n
- epsilon :: Fractional n => n
- style :: forall n. Lens' (RenderState n) (Style V2 n)
- bp :: RealFloat a => a -> Render n
- pt :: RealFloat a => a -> Render n
- mm :: RealFloat a => a -> Render n
- px :: RealFloat a => a -> Render n
- ln :: Render n -> Render n
- raw :: Builder -> Render n
- rawString :: String -> Render n
- pgf :: Builder -> Render n
- bracers :: Render n -> Render n
- brackets :: Render n -> Render n
- path :: RealFloat n => Path V2 n -> Render n
- trail :: RealFloat n => Trail V2 n -> Render n
- segment :: RealFloat n => Segment Closed V2 n -> Render n
- usePath :: Bool -> Bool -> Render n
- lineTo :: RealFloat n => V2 n -> Render n
- curveTo :: RealFloat n => V2 n -> V2 n -> V2 n -> Render n
- moveTo :: RealFloat n => P2 n -> Render n
- closePath :: Render n
- clip :: Render n
- stroke :: Render n
- fill :: Render n
- asBoundingBox :: Render n
- setDash :: RealFloat n => Dashing n -> Render n
- setLineWidth :: RealFloat n => n -> Render n
- setLineCap :: LineCap -> Render n
- setLineJoin :: LineJoin -> Render n
- setMiterLimit :: RealFloat n => n -> Render n
- setLineColor :: (RealFloat a, Color c) => c -> Render a
- setLineOpacity :: RealFloat n => n -> Render n
- setFillColor :: Color c => c -> Render n
- setFillRule :: FillRule -> Render n
- setFillOpacity :: RealFloat a => a -> Render n
- setTransform :: RealFloat n => Transformation V2 n -> Render n
- applyTransform :: RealFloat n => Transformation V2 n -> Render n
- baseTransform :: RealFloat n => Transformation V2 n -> Render n
- applyScale :: RealFloat n => n -> Render n
- resetNonTranslations :: Render n
- linearGradient :: RealFloat n => Path V2 n -> LGradient n -> Render n
- radialGradient :: RealFloat n => Path V2 n -> RGradient n -> Render n
- colorSpec :: RealFloat n => n -> [GradientStop n] -> Render n
- shadePath :: RealFloat n => Angle n -> Render n -> Render n
- opacityGroup :: RealFloat a => a -> Render n -> Render n
- image :: RealFloat n => DImage n External -> Render n
- embeddedImage :: RealFloat n => DImage n Embedded -> Render n
- embeddedImage' :: RealFloat n => ByteString -> Int -> Int -> T2 n -> Render n
- renderText :: [Render n] -> Render n -> Render n
- setTextAlign :: RealFloat n => TextAlignment n -> [Render n]
- setTextRotation :: RealFloat n => Angle n -> [Render n]
- setFontWeight :: FontWeight -> Render n
- setFontSlant :: FontSlant -> Render n
Documentation
renderWith :: (RealFloat n, Typeable n) => Surface -> Bool -> Bool -> V2 n -> Render n -> Builder Source #
initialState :: (Typeable n, Floating n) => RenderState n Source #
Starting state for running the builder.
Environments
epsilon :: Fractional n => n Source #
ε = 0.0001 is the limit at which lines are no longer stroked.
Lenses
units
bp :: RealFloat a => a -> Render n Source #
Render n length with bp (big point = 1 px at 72 dpi) units.
RenderM commands
Paths
Use the defined path a clip for everything that follows in the current scope. Stacks.
asBoundingBox :: Render n Source #
Uses the current path as the bounding box for whole picture.
Strokeing Options
setDash :: RealFloat n => Dashing n -> Render n Source #
Sets the dash for the current scope. Must be done before stroking.
setLineWidth :: RealFloat n => n -> Render n Source #
Sets the line width in current scope. Must be done before stroking.
setLineCap :: LineCap -> Render n Source #
Sets the line cap in current scope. Must be done before stroking.
setLineJoin :: LineJoin -> Render n Source #
Sets the line join in current scope. Must be done before stroking.
setMiterLimit :: RealFloat n => n -> Render n Source #
Sets the miter limit in the current scope. Must be done before stroking.
setLineColor :: (RealFloat a, Color c) => c -> Render a Source #
Sets the stroke colour in current scope. If colour has opacity < 1, the scope opacity is set accordingly. Must be done before stroking.
setLineOpacity :: RealFloat n => n -> Render n Source #
Sets the stroke opacity for the current scope. Should be a value between 0 and 1. Must be done before stroking.
Fill Options
setFillColor :: Color c => c -> Render n Source #
Sets the fill colour for current scope. If an alpha colour is used, the fill opacity is set accordingly. Must be done before filling.
setFillRule :: FillRule -> Render n Source #
Set the fill rule to winding or even-odd for current scope. Must be done before filling.
setFillOpacity :: RealFloat a => a -> Render n Source #
Sets the stroke opacity for the current scope. Should be a value between 0 and 1. Must be done before stroking.
Transformations
setTransform :: RealFloat n => Transformation V2 n -> Render n Source #
Resets the transform and sets it. Must be set before the path is used.
applyTransform :: RealFloat n => Transformation V2 n -> Render n Source #
Applies a transformation to the current scope. This transformation only effects coordinates and text, not line withs or dash spacing. (See applyDeepTransform). Must be set before the path is used.
baseTransform :: RealFloat n => Transformation V2 n -> Render n Source #
Base transforms are applied by the document reader.
applyScale :: RealFloat n => n -> Render n Source #
Shading
images
embeddedImage' :: RealFloat n => ByteString -> Int -> Int -> T2 n -> Render n Source #
Text
setTextAlign :: RealFloat n => TextAlignment n -> [Render n] Source #
Returns a list of values to be put in square brackets like
pgftext[left,top]{txt}
.
setFontWeight :: FontWeight -> Render n Source #
Set the font weight by rendering bf
. Nothing is done for normal
weight.
setFontSlant :: FontSlant -> Render n Source #
Set the font slant by rendering bf
. Nothing is done for normal weight.