Documentation
¶
Overview ¶
Package export holds what the writers of PDF and PostScript files share: the pen that writes the segments of Canvas paths as the operators of both, and the readings of a document's paints and instructions.
Index ¶
- func ClampShadow(v float64) float64
- func F64(in bdf.Instr, i int) float64
- func Fine(v float64) string
- func IsSVG(b []byte) bool
- func Mat(m affine.Matrix) string
- func Num(v float64) string
- func Nums(vs ...float64) string
- func U64(in bdf.Instr, i int) uint64
- type Pen
- func (p *Pen) ArcTo(x1, y1, x2, y2, r float64)
- func (p *Pen) Close()
- func (p *Pen) CubeTo(c1x, c1y, c2x, c2y, x, y float64)
- func (p *Pen) Ellipse(cx, cy, rx, ry, rot, a0, a1 float64, ccw bool)
- func (p *Pen) LineTo(x, y float64)
- func (p *Pen) MoveTo(x, y float64)
- func (p *Pen) Path(bp *bdf.Path)
- func (p *Pen) QuadTo(cx, cy, x, y float64)
- func (p *Pen) Rect(x, y, w, h float64)
- func (p *Pen) RoundRect(x, y, w, h, r float64)
- type Source
- type Stop
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClampShadow ¶
ClampShadow bounds a number of a shadow (its blur, its offsets).
func Fine ¶
Fine writes a number that is multiplied by a size (a scale of a matrix, a width of a glyph, a component of a color), with more decimals than Num (six).
func Mat ¶
Mat writes a matrix as the operands of a cm, a text, font, pattern or image matrix: its scales finely, its offsets as places.
Types ¶
type Pen ¶
type Pen struct {
B *bytes.Buffer
M affine.Matrix
// Drawn says the path has segments; Box is the box of their points,
// when Boxed.
Drawn bool
Box [4]float64
Boxed bool
// contains filtered or unexported fields
}
Pen writes the segments of a path as the operators m, l, c and h (of a PDF content stream, or of the procedures of psbdf's prolog), with the rules of Canvas paths: a segment without a subpath starts one, and a closed subpath is followed by one that starts where it started. It keeps the box of the points it writes; with no buffer it only keeps the box. It is an sfnt.Pen, for the outlines of glyphs in font units under its transform.
func NewPen ¶
NewPen makes a pen that writes to b (nil: keeps the box only) through the transform m.
func (*Pen) ArcTo ¶
ArcTo adds a line and an arc of radius r tangent to the lines from the current point to (x1, y1) and from there to (x2, y2).
func (*Pen) Ellipse ¶
Ellipse adds an elliptical arc with Canvas semantics: a line from the current point to the start of the arc, angles measured clockwise from the x axis (y down) and rotated by rot.
type Source ¶
type Source struct {
Doc *bdf.Document
// SkipRoles are the roles of the layers that are not written.
SkipRoles []string
// Warnings are the warnings of the writing, each once.
Warnings []string
// Seen holds the objects written before (see Enter).
Seen map[bdf.Hash]struct{}
// contains filtered or unexported fields
}
Source is the document a writer writes, with what it has decoded of it and the warnings of the writing. A writer embeds it.
func (*Source) Object ¶
func (s *Source) Object(h bdf.Hash) *bdf.ObjectPart
Object is an object of the document, decoded once; nil (with a warning) for one that is missing or cannot be read.
func (*Source) Path ¶
Path is a path of an object: inline, or of a path collection of the document, decoded once; nil (with a warning) for one there is not.