Documentation
¶
Index ¶
- Variables
- func CoverGen(opts ...Option)
- type Option
- func WithAX(ax float64) Option
- func WithAY(ay float64) Option
- func WithAnchoredAX(ax float64) Option
- func WithAnchoredAY(ay float64) Option
- func WithAnchoredX(x int) Option
- func WithAnchoredY(y int) Option
- func WithCoverRGB(rgb []int) Option
- func WithDPI(dpi float64) Option
- func WithFontFilePath(path string) Option
- func WithFontRGB(rgb []int) Option
- func WithFontSize(size float64) Option
- func WithHeight(height int) Option
- func WithImagePath(path string) Option
- func WithLineSpacing(lineSpacing float64) Option
- func WithMaxWordWidth(width float64) Option
- func WithResizeHeight(height int) Option
- func WithResizeWidth(width int) Option
- func WithSavingFileName(savingFileName string) Option
- func WithTitle(title string) Option
- func WithWidth(width int) Option
- func WithX(x float64) Option
- func WithY(y float64) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var OptionsDefault = Options{ Title: "LgoLgo", SavingFileName: "LgoLgo", FontFilePath: "font/syqh.ttf", ImagePath: "img/gopher.png", CoverRGB: []int{47, 54, 66}, FontRGB: []int{238, 241, 247}, FontSize: 76, DPI: 72, LineSpacing: 1.1, Width: 1343, ResizeWidth: 1000, MaxWordWidth: 660.0, Height: 734, ResizeHeight: 500, X: 800.0, AX: 0.5, AnchoredX: 200, AnchoredAX: 0.5, Y: 300.0, AY: 0.6, AnchoredY: 220, AnchoredAY: 0.5, }
OptionsDefault is the default options.
Functions ¶
Types ¶
type Option ¶
type Option struct {
F func(o *Options)
}
Option is the only struct that can be used to set Options.
func WithFontFilePath ¶
WithFontFilePath sets font file path.
func WithLineSpacing ¶
WithLineSpacing sets line spacing.
func WithMaxWordWidth ¶
WithMaxWordWidth sets max word width.
func WithResizeHeight ¶
WithResizeHeight sets image's height.
func WithSavingFileName ¶
WithSavingFileName sets title.
type Options ¶
type Options struct {
// Title sets article title.
//
// Default: LgoLgo
Title string
// SavingFileName sets file name.
//
// Default: LgoLgo
SavingFileName string
// FontFilePath sets font file path.
//
// Default: font/syqh.ttf
FontFilePath string
// ImagePath sets image path
//
// Default: img/gopher.png
ImagePath string
// CoverRGB sets cover's RGB255.
//
// Default: []int{47, 54, 66}
CoverRGB []int
// FontRGB sets font's RGB255.
//
// Default: []int{238, 241, 247}
FontRGB []int
// FontSize sets font size.
//
//Default: 76
FontSize float64
// DPI sets font's DPI.
//
// Default: 72
DPI float64
// LineSpacing sets line spacing.
//
// Default: 1.1
LineSpacing float64
// Width sets cover width.
//
// Default: 1343
Width int
// ResizeWidth sets image width.
//
// Default: 1000
ResizeWidth int
// MaxWordWidth sets max word's width.
//
// Default: 660.0
MaxWordWidth float64
// Height sets height.
//
// Default: 734
Height int
// ResizeHeight sets image height.
//
// Default: 500
ResizeHeight int
// X sets font's X coordinate.
//
// Default: 800.0
X float64
// AX sets font's AX.
//
// Default: 0.5
AX float64
// AnchoredX sets image's X coordinate.
//
// Default: 200
AnchoredX int
// AnchoredAX set image's AX.
//
// Default: 0.5
AnchoredAX float64
// Y sets font's Y coordinate.
//
// Default: 300.0
Y float64
// AY sets font's AY.
//
// Default: 0.6
AY float64
// AnchoredY sets image's Y coordinate.
//
// Default: 220
AnchoredY int
// AnchoredAY set image's AY.
//
// Default: 0.5
AnchoredAY float64
}
func NewOptions ¶
Click to show internal directories.
Click to hide internal directories.

