Safe Haskell | None |
---|---|
Language | Haskell98 |
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 {}
- initialGraphicsState :: GraphicsState
- mkProcessor :: Processor
- processOp :: Monad m => Operator -> Processor -> PdfE m Processor
Documentation
Processor maintains graphics state
Processor | |
|
data GraphicsState Source
Graphics state
GraphicsState | |
|
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 :: GraphicsState Source
Empty graphics state
mkProcessor :: Processor Source
Create processor in initial state