config

package
v0.0.0-...-16935a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const DefaultTemplate = "example/template.png"

Variables

This section is empty.

Functions

func Defaulting

func Defaulting(cnf *DrawingConfig, tplImg string)

Types

type BoxTextsOption

type BoxTextsOption struct {
	TextOption
	BgHexColor string    `json:"bgHexColor,omitempty"`
	BoxPadding *Padding  `json:"boxPadding,omitempty"`
	BoxSpacing *int      `json:"boxSpacing,omitempty"`
	BoxAlign   box.Align `json:"boxAlign,omitempty"`
}

type DrawingConfig

type DrawingConfig struct {
	Template string               `json:"template,omitempty"`
	Title    *MultiLineTextOption `json:"title,omitempty"`
	Category *TextOption          `json:"category,omitempty"`
	Info     *TextOption          `json:"info,omitempty"`
	Tags     *BoxTextsOption      `json:"tags,omitempty"`
}

func LoadConfig

func LoadConfig(filename string) (*DrawingConfig, error)

type MultiLineTextOption

type MultiLineTextOption struct {
	TextOption
	MaxWidth    int  `json:"maxWidth,omitempty"`
	LineSpacing *int `json:"lineSpacing,omitempty"`
}

type Padding

type Padding struct {
	Top    int `json:"top"`
	Right  int `json:"right"`
	Bottom int `json:"bottom"`
	Left   int `json:"left"`
}

type Point

type Point struct {
	X int `json:"px"`
	Y int `json:"py"`
}

type TextOption

type TextOption struct {
	Start      *Point           `json:"start,omitempty"`
	FgHexColor string           `json:"fgHexColor,omitempty"`
	FontSize   float64          `json:"fontSize,omitempty"`
	FontStyle  fontfamily.Style `json:"fontStyle,omitempty"`
	Separator  string           `json:"separator,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL