Versions in this module Expand all Collapse all v1 v1.0.3 Aug 25, 2021 v1.0.2 Aug 25, 2021 v1.0.1 Aug 25, 2021 Changes in this version + const DefaultDPI + var DefaultCaptionStyle = func() *Style + var DefaultFooterStyle = func() *Style + var NoBorder = func() *Border type Cell + IgnoreInlineStyle bool type Font + DPI int type Option + func WithDPI(dpi int) Option + type Table struct + func NewTable(ti *TableImage, rows []Row, caption *Cell, footer *Cell) (*Table, error) + func (r Table) CellBounds(rowIdx int, cellIdx int) image.Rectangle + func (r Table) DrawCaption(img *image.RGBA, pt image.Point) + func (r Table) DrawFooter(img *image.RGBA, pt image.Point) + func (r Table) Rows() []Row + func (r Table) RowsSize() image.Point + func (r Table) RowsStartPoint() image.Point + func (r Table) Size() image.Point type Text + BgColor string + Color string + Padding int + Pos [2]int + func TextFromText(value string, txt Text, fontFace font.Face) Text + func (t Text) SameStyle(t2 Text) bool + type Word []Text + func (w Word) Width() int v1.0.0 Aug 24, 2021 Changes in this version + const DefaultBorderWidth + const DefaultColor + const DefaultFontSize + const DefaultLineHeight + const DefaultPadding + const DefaultWrapWords + var DefaultBorder = func() *Border + var DefaultLine = func() Line + var DefaultStyle = func() *Style + var ZeroPadding = Padding + func ColorFromHex(hexColor string) color.RGBA + func Save(filepath string, img *image.RGBA, imageType ImageType) error + func Write(w io.Writer, img *image.RGBA, imageType ImageType) error + type Align int + const CENTER + const LEFT + const RIGHT + const UnknownAlign + type Border struct + Bottom Line + Left Line + Right Line + Top Line + func (b *Border) ChangeColor(color string) + func (b *Border) ChangeWidth(width int) + func (b Border) Draw(img *image.RGBA, bounds image.Rectangle) + func (b Border) Padding() Padding + func (b Border) Size() image.Point + type Cell struct + Image *Image + Style *Style + Text string + func (c Cell) Draw(img *image.RGBA, bounds image.Rectangle) + func (c Cell) GetImage(cache ImageCache) error + func (c Cell) ImageSize() image.Point + func (c Cell) InnerBounds(bounds image.Rectangle) image.Rectangle + func (c Cell) Size() image.Point + func (c Cell) Wrap(xOffset int) ([]Text, int) + type DefaultImageCache map[string]image.Image + func (c DefaultImageCache) Get(k string) (image.Image, error) + func (c DefaultImageCache) Set(k string, img image.Image) error + type Font struct + Data *draw2d.FontData + Font *truetype.Font + Size float64 + func (f *Font) Load(cache draw2d.FontCache) error + type Image struct + Align Align + Data image.Image + Inline bool + Padding *Padding + Size image.Point + URL string + VAlign VAlign + func (i *Image) Download() error + func (i *Image) UpdateSize() + func (i Image) BoundSize() image.Point + func (i Image) PaddingLeft() int + func (i Image) PaddingTop() int + func (i Image) PaddingX() int + func (i Image) PaddingY() int + func (i Image) Scale() float64 + type ImageCache interface + Get func(k string) (image.Image, error) + Set func(k string, img image.Image) error + type ImageType int + const JPEG + const PNG + type Line struct + Color string + Width int + func (l Line) ChangeColor(color string) Line + func (l Line) ChangeWidth(width int) Line + func (l Line) Draw(img *image.RGBA, bounds image.Rectangle) + type Option interface + func WithAlign(align Align) Option + func WithBgColor(bgColor string) Option + func WithBorder(border *Border) Option + func WithBorderColor(color string) Option + func WithBorderWidth(width int) Option + func WithColor(color string) Option + func WithFont(font *truetype.Font) Option + func WithFontCache(cache draw2d.FontCache) Option + func WithFontData(font *draw2d.FontData) Option + func WithFontFolder(fontFolder string) Option + func WithFontSize(size float64) Option + func WithLineHeight(height float64) Option + func WithMargin(margin *Padding) Option + func WithPadding(padding *Padding) Option + func WithStyle(style *Style) Option + func WithVAlign(align VAlign) Option + type Padding struct + Bottom int + Left int + Right int + Top int + func NewPadding(padding int) *Padding + func NewPaddingX(x int) *Padding + func NewPaddingXY(x int, y int) *Padding + func NewPaddingY(y int) *Padding + func (p Padding) Add(p2 Padding) Padding + func (p Padding) Size() image.Point + type Row struct + Cells []Cell + Style *Style + type Rows struct + func NewRows(ti *TableImage, rows []Row) (*Rows, error) + func (r Rows) CellBounds(rowIdx int, cellIdx int) image.Rectangle + func (r Rows) Rows() []Row + func (r Rows) Size() image.Point + type Style struct + Align Align + BgColor string + Border *Border + Color string + Font *Font + LineHeight float64 + Margin *Padding + MaxWidth int + Padding *Padding + VAlign VAlign + func (s *Style) Inherit(s1 *Style, cache draw2d.FontCache) error + func (s *Style) LoadFont(cache draw2d.FontCache) error + func (s Style) BorderPadding() Padding + func (s Style) BorderSize() image.Point + func (s Style) InnerBounds(bounds image.Rectangle) image.Rectangle + func (s Style) InnerEnd() image.Point + func (s Style) InnerStart() image.Point + type TableImage struct + func New(options ...Option) (*TableImage, error) + func (ti *TableImage) BorderSize() image.Point + func (ti *TableImage) CacheImage(k string, img image.Image) error + func (ti *TableImage) Draw(rows []Row) (*image.RGBA, error) + func (ti *TableImage) GetImage(k string) (image.Image, error) + func (ti *TableImage) RowsStartPoint() image.Point + func (ti *TableImage) Size(rows *Rows) image.Point + type Text struct + Value string + Width int + type VAlign int + const BOTTOM + const MIDDLE + const TOP + const UnknownVAlign