Safe Haskell | None |
---|
Pdf.Toolbox.Content.Processor
Description
Process content stream operators maintaining graphics state
It is pretty experimental
- data Processor = Processor {
- prState :: GraphicsState
- prStateStack :: [GraphicsState]
- prGlyphDecoder :: GlyphDecoder
- prGlyphs :: [[Glyph]]
- data GraphicsState = GraphicsState {}
- type GlyphDecoder = Name -> Str -> [(Glyph, Double)]
- data Glyph = Glyph {
- glyphCode :: Int
- glyphTopLeft :: Vector Double
- glyphBottomRight :: Vector Double
- glyphText :: Maybe Text
- initialGraphicsState :: GraphicsState
- mkProcessor :: Processor
- processOp :: Monad m => Operator -> Processor -> PdfE m Processor
Documentation
Processor maintains graphics state
Constructors
Processor | |
Fields
|
data GraphicsState Source
Graphics state
Constructors
GraphicsState | |
Fields
|
Instances
type GlyphDecoder = Name -> Str -> [(Glyph, Double)]Source
Given font name and string, it should return list of glyphs and their widths.
Note: it should not try to position or scale glyphs to user space, bounding boxes should be defined in glyph space.
Note: glyph width is a distance between the glyph's origin and the next glyph's origin, so it generally can't be calculated from bounding box
Note: the Processor
actually doesn't cares about glyph's
bounding box, so you can return anything you want
Glyph
initialGraphicsState :: GraphicsStateSource
Empty graphics state
mkProcessor :: ProcessorSource
Create processor in initial state