Portability | GHC |
---|---|
Stability | unstable |
Maintainer | stephen.tetley@gmail.com |
Data types for stroke and label attributes.
Wumpus represents pictures as trees - a leaf represents a path or text label. All attributes of a path or text label (colour, stroke width, font, ...) are stored in the leaf. So a picture is a leaf labelled tree.
By contrast, PostScript maintains a global graphics state. A PostScript program is free to modify the graphics state anywhere in the program and subsequent elements are all drawn according to the modified graphics state.
When Wumpus renders Pictures as PostScript it maintains a
limited graphics state with just current colour and current
font. This is so Wumpus can avoid repeating setrgbcolor
and
findfont
operations in the generated PostScript if
subsequent elements share the same values.
- data GraphicsState = GraphicsState {}
- data StrokeAttr = StrokeAttr {}
- data LineCap
- data LineJoin
- data DashPattern
- data FontAttr = FontAttr {}
- data FontFace = FontFace {}
- data SVGFontStyle
- zeroGS :: GraphicsState
- default_stroke_attr :: StrokeAttr
Data types
data GraphicsState Source
Graphics state used by the rendering monads.
This type is hidden by the top-level module Wumpus.Core
.
Stroke attributes
data StrokeAttr Source
Stroke attributes for drawing paths.
StrokeAttr | |
|
Line cap - default in output is butt.
Line join - default in output is miter.
data DashPattern Source
Dash pattern - either a solid line or a list of on-off pairs together with an offset into the dashes.
Font
Font face and size. Equivalent fonts have different names
in PostScript and SVG. A PostScript font name includes the
font style (e.g. Times-BoldItalic
) whereas an SVG font has
a name (the font-family
attribute) and a style.
For PostScript, the following fonts are expected to exist on most platforms:
Times-Roman Times-Italic Times-Bold Times-BoldOtalic Helvetica Helvetica-Oblique Helvetica-Bold Helvetica-Bold-Oblique Courier Courier-Oblique Courier-Bold Courier-Bold-Oblique Symbol
See the PostScript Language Reference Manual.
data SVGFontStyle Source
SVG font styles - potentially a style may generate both
font-weight
and font-style
attributes in the SVG output.
Initial graphic state
The initial graphics state
default_stroke_attr :: StrokeAttrSource
Default stroke attributes.