Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Process content stream operators maintaining graphics state
It is pretty experimental
Synopsis
- data Processor = Processor {}
- data GraphicsState = GraphicsState {}
- type GlyphDecoder = Name -> ByteString -> [(Glyph, Double)]
- data Glyph = Glyph {}
- data Span = Span {
- spGlyphs :: [Glyph]
- spFontName :: Name
- initialGraphicsState :: GraphicsState
- mkProcessor :: Processor
- processOp :: Operator -> Processor -> Either String Processor
Documentation
Processor maintains graphics state
Processor | |
|
data GraphicsState Source #
Graphics state
GraphicsState | |
|
Instances
Show GraphicsState Source # | |
Defined in Pdf.Content.Processor showsPrec :: Int -> GraphicsState -> ShowS # show :: GraphicsState -> String # showList :: [GraphicsState] -> ShowS # |
type GlyphDecoder = Name -> ByteString -> [(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