Documentation ¶
Index ¶
- func NewPen(color color.Color, w Measure) pen
- func NewRectangle(x0, y0, x1, y1 Measure) image.Rectangle
- func SetDPI(newDpi float64)
- type Alignment
- type Canvas
- type ColumnOption
- type ColumnSpan
- type DrawColumns
- type DrawStruct
- func ColSpan(d DrawStruct, span int) DrawStruct
- func Empty() DrawStruct
- func Fixed(x, y Measure) DrawStruct
- func FixedY(y Measure) DrawStruct
- func Lines(d ...DrawStruct) DrawStruct
- func Padding(l, t, r, b Measure, d DrawStruct) DrawStruct
- func Padding4(pad Measure, d DrawStruct) DrawStruct
- func PaddingLeftRight(pad Measure, d DrawStruct) DrawStruct
- func PaddingTopBottom(pad Measure, d DrawStruct) DrawStruct
- func Table(columns []TableColumn, data ...TableRow) DrawStruct
- func Text(s string, options ...TextOption) DrawStruct
- type DrawText
- type Measure
- type PaddingStruct
- type TableColumn
- type TableRow
- type TextOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRectangle ¶
NewRectangle allows you to create a rectangle using length measures:
Millimeters, Inches, Pixels
example
NewRectangle(ZeroPixel(), ZeroPixel(), Inches(1.0), Inches(1.0)) // box with sides 1 inch
Types ¶
type ColumnOption ¶
type ColumnOption interface {
// contains filtered or unexported methods
}
type ColumnSpan ¶
type ColumnSpan interface {
// contains filtered or unexported methods
}
type DrawColumns ¶
type DrawColumns interface { WriteTo(Canvas, image.Rectangle) image.Point // contains filtered or unexported methods }
func Cols ¶
func Cols(d ...DrawStruct) DrawColumns
type DrawStruct ¶
func ColSpan ¶
func ColSpan(d DrawStruct, span int) DrawStruct
func Empty ¶
func Empty() DrawStruct
func Fixed ¶
func Fixed(x, y Measure) DrawStruct
func FixedY ¶
func FixedY(y Measure) DrawStruct
func Lines ¶
func Lines(d ...DrawStruct) DrawStruct
func Padding ¶
func Padding(l, t, r, b Measure, d DrawStruct) DrawStruct
PaddingLeftRight allows to adjust the padding on each side of the object border
func Padding4 ¶
func Padding4(pad Measure, d DrawStruct) DrawStruct
PaddingLeftRight adds padding on all sides to the drawing object
func PaddingLeftRight ¶
func PaddingLeftRight(pad Measure, d DrawStruct) DrawStruct
PaddingLeftRight adds left and right padding to the drawing object
func PaddingTopBottom ¶
func PaddingTopBottom(pad Measure, d DrawStruct) DrawStruct
PaddingLeftRight adds left and right padding to the drawing object
func Table ¶
func Table(columns []TableColumn, data ...TableRow) DrawStruct
type Measure ¶
type Measure interface {
// contains filtered or unexported methods
}
Measure is a universal unit of measurement on canvas. Use this:
Millimeters, Inches, Pixels
func Millimeters ¶
Millimeters - measures the distance in millimeters
type PaddingStruct ¶
type PaddingStruct interface {
// contains filtered or unexported methods
}
type TableColumn ¶
type TableColumn interface {
// contains filtered or unexported methods
}
func Column ¶
func Column(caption string, pie float64, options ...ColumnOption) TableColumn
type TextOption ¶
type TextOption interface {
// contains filtered or unexported methods
}
func OptionAlignment ¶
func OptionAlignment(a Alignment) TextOption
OptionAlignment lets you set horizontal alignment
AlignLeft, AlignRight, AlignCenter
func OptionCentered ¶
func OptionCentered() TextOption
OptionCentered means that the text needs to be vertically aligned in the center
func OptionFont ¶
func OptionFont(font *truetype.Font, fontSize float64, usePen pen) TextOption
OptionFont contains font settings
Click to show internal directories.
Click to hide internal directories.