Documentation
¶
Overview ¶
Package rendercard 渲染卡片
Index ¶
Constants ¶
View Source
const (
// DefaultWidth 默认宽度
DefaultWidth = 1272.0
)
Variables ¶
View Source
var ( // ErrNilTextFont ... ErrNilTextFont = errors.New("nil TextFont") // ErrNilTitleFont ... ErrNilTitleFont = errors.New("nil TitleFont") )
Functions ¶
func Transparency ¶ added in v0.0.2
Transparency 更改透明度 magnification 倍率值
Types ¶
type Card ¶ added in v0.0.4
type Card struct { // Width 宽度,默认600 Width int // Height 高度,默认由Title+Text内容决定 Height int // BackgroundImage 背景图 BackgroundImage string // TitleFont 标题字体 TitleFont string // TextFont 正文字体 TextFont string // Title 标题内容 Title string // CanTitleShown 是否显示标题 CanTitleShown bool // IsTextSplitPerElement true为每个元素按行显示,false按空格分割显示; IsTextSplitPerElement bool // TitleAlign 标题布局[Left|Center|Right],默认Left TitleAlign Alignment // Text 正文内容 Text []string }
Card 卡片配置
type Title ¶ added in v0.0.4
type Title struct { // Line 行数 Line int // IsEnabled 状态 IsEnabled bool // LeftTitle 左侧标题 LeftTitle string // LeftSubtitle 左侧副标题 LeftSubtitle string // RightTitle 右侧标题 RightTitle string // RightSubtitle 右侧副标题 RightSubtitle string // ImagePath 图片路径 ImagePath string // TitleFont 标题字体路径 TitleFont string // TextFont 正文字体路径 TextFont string // OffsetX 文字X坐标偏移 向右为正方向 OffsetX float64 // OffsetX 文字Y坐标偏移 向下为正方向 OffsetY float64 }
Title 标题配置
Click to show internal directories.
Click to hide internal directories.