Portability | GHC |
---|---|
Stability | unstable |
Maintainer | stephen.tetley@gmail.com |
Data types for stroke and label styles corresponding to the
styles provided by PostScript / SVG (StrokeAttr
, etc.).
Data types for annotating Primitives with their drawing style
(PathProps
, etc.). Wumpus represents pictures as trees and
decorates all elements (paths, text-labels) with their drawing
style. This is boardly similar to how SVG handles attributes.
For PostScript output, Wumpus renders attribute changes as
graphics state updates.
- data StrokeAttr = StrokeAttr {}
- data LineCap
- data LineJoin
- data DashPattern
- data FontAttr = FontAttr {}
- data FontFace = FontFace {}
- data SVGFontStyle
- data PathProps
- data LabelProps = LabelProps {}
- data EllipseProps
- default_stroke_attr :: StrokeAttr
- defaultFont :: Int -> FontAttr
- wumpus_default_font :: FontAttr
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 attributes
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.
Drawing styles for Primitives
Note when drawn filled and drawn stroked the same polygon will have (slightly) different size:
- A filled shape fills within the boundary of the shape
- A stroked shape draws a pen line around the boundary of the shape. The actual size depends on the thickness of the line (stroke width).
data LabelProps Source
Font rendering properties for a PrimLabel.
Eq LabelProps | |
Ord LabelProps | |
Show LabelProps | |
Format LabelProps |
data EllipseProps Source
Ellipses and circles are always closed.
Eq EllipseProps | |
Show EllipseProps | |
Format EllipseProps |
Defaults
default_stroke_attr :: StrokeAttrSource
Default stroke attributes.
defaultFont :: Int -> FontAttrSource
defaultFont
: font_size -> FontAttr
Constructor for the default font, which is Courier
(aliased
to Courier New
for SVG) at the supplied size.
Note - the font uses the Standard encoding - this is common to fonts but uses different indices to the more common Latin1.
For instance 232 is Lslash not egrave.
Both GhostScript and the standard AFM Core 14 metrics supplied by Adobe use Standard Encoding but include further characters (e.g. egrave) in the non-indexed higher-region.
wumpus_default_font :: FontAttrSource
Constant for the default font (Courier
) at 14 point.