Go CLI that turns the markdown currency of this stack (Redmine notes, Discourse posts, briefing output) into typeset PDFs: two embedded typst templates (report with title page/TOC/headers, dense brief), front-matter (title/subtitle/author/date/classification/template), GFM tables, and bar charts rendered in pure Go (go-chart) from fenced chart data blocks. Engine is a prebuilt typst 0.15.1 container pinned by digest and run --network none; PDF bytes to stdout or -o. Exit codes 0/1/2. All dev in docker (dev.sh/Makefile); unit tests + golden typst fixtures plus a host-side smoke against the real engine container. Generated with Crush Assisted-by: Crush:glm-5.2
40 lines
944 B
Go
40 lines
944 B
Go
// Copyright 2010 The draw2d Authors. All rights reserved.
|
|
// created: 13/12/2010 by Laurent Le Goff
|
|
|
|
package drawing
|
|
|
|
// Transformer apply the Matrix transformation tr
|
|
type Transformer struct {
|
|
Tr Matrix
|
|
Flattener Flattener
|
|
}
|
|
|
|
// MoveTo implements the path builder interface.
|
|
func (t Transformer) MoveTo(x, y float64) {
|
|
u := x*t.Tr[0] + y*t.Tr[2] + t.Tr[4]
|
|
v := x*t.Tr[1] + y*t.Tr[3] + t.Tr[5]
|
|
t.Flattener.MoveTo(u, v)
|
|
}
|
|
|
|
// LineTo implements the path builder interface.
|
|
func (t Transformer) LineTo(x, y float64) {
|
|
u := x*t.Tr[0] + y*t.Tr[2] + t.Tr[4]
|
|
v := x*t.Tr[1] + y*t.Tr[3] + t.Tr[5]
|
|
t.Flattener.LineTo(u, v)
|
|
}
|
|
|
|
// LineJoin implements the path builder interface.
|
|
func (t Transformer) LineJoin() {
|
|
t.Flattener.LineJoin()
|
|
}
|
|
|
|
// Close implements the path builder interface.
|
|
func (t Transformer) Close() {
|
|
t.Flattener.Close()
|
|
}
|
|
|
|
// End implements the path builder interface.
|
|
func (t Transformer) End() {
|
|
t.Flattener.End()
|
|
}
|