Documentation ¶
Index ¶
- type AvatarBuilder
- func (ab *AvatarBuilder) GenerateImage(s string) ([]byte, error)
- func (ab *AvatarBuilder) GenerateImageAndSave(s string) (string, error)
- func (ab *AvatarBuilder) GenerateImageAndSavePNG(s string, outname string) error
- func (ab *AvatarBuilder) GetFontWidth() int
- func (ab *AvatarBuilder) SetAvatarSize(w int, h int)
- func (ab *AvatarBuilder) SetBackgroundColor(c color.Color)
- func (ab *AvatarBuilder) SetBackgroundColorHex(hex uint32)
- func (ab *AvatarBuilder) SetFontSize(size float64)
- func (ab *AvatarBuilder) SetFrontgroundColor(c color.Color)
- func (ab *AvatarBuilder) SetFrontgroundColorHex(hex uint32)
- type FontCenterCalculator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvatarBuilder ¶
func NewAvatarBuilder ¶
func NewAvatarBuilder(fontFile string, calc FontCenterCalculator) *AvatarBuilder
func (*AvatarBuilder) GenerateImage ¶
func (ab *AvatarBuilder) GenerateImage(s string) ([]byte, error)
func (*AvatarBuilder) GenerateImageAndSave ¶
func (ab *AvatarBuilder) GenerateImageAndSave(s string) (string, error)
func (*AvatarBuilder) GenerateImageAndSavePNG ¶
func (ab *AvatarBuilder) GenerateImageAndSavePNG(s string, outname string) error
func (*AvatarBuilder) GetFontWidth ¶
func (ab *AvatarBuilder) GetFontWidth() int
func (*AvatarBuilder) SetAvatarSize ¶
func (ab *AvatarBuilder) SetAvatarSize(w int, h int)
func (*AvatarBuilder) SetBackgroundColor ¶
func (ab *AvatarBuilder) SetBackgroundColor(c color.Color)
func (*AvatarBuilder) SetBackgroundColorHex ¶
func (ab *AvatarBuilder) SetBackgroundColorHex(hex uint32)
func (*AvatarBuilder) SetFontSize ¶
func (ab *AvatarBuilder) SetFontSize(size float64)
func (*AvatarBuilder) SetFrontgroundColor ¶
func (ab *AvatarBuilder) SetFrontgroundColor(c color.Color)
func (*AvatarBuilder) SetFrontgroundColorHex ¶
func (ab *AvatarBuilder) SetFrontgroundColorHex(hex uint32)
type FontCenterCalculator ¶
type FontCenterCalculator interface { // CalculateCenterLocation used to calculate center location in different font style CalculateCenterLocation(string, *AvatarBuilder) (int, int) }
Click to show internal directories.
Click to hide internal directories.