Documentation
¶
Index ¶
- func GetEmojiImage(text string) (image.Image, bool)
- func IsEmoji(text string) bool
- func NewColorWitRGB(r, g, b float64) color.Color
- func NewColorWitRGB255(r, g, b int) color.Color
- func NewColorWitRGBA(r, g, b, a float64) color.Color
- func NewColorWitRGBA255(r, g, b, a int) color.Color
- func NewColorWithHex(x string) color.Color
- func StrSplit(reqStr string) []string
- type Align
- type FaceInfo
- type TextDraw
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewColorWitRGB ¶
NewColorWitRGB sets the current color. r, g, b values should be between 0 and 1, inclusive. Alpha will be set to 1 (fully opaque).
func NewColorWitRGB255 ¶
NewColorWitRGB255 sets the current color. r, g, b values should be between 0 and 255, inclusive. Alpha will be set to 255 (fully opaque).
func NewColorWitRGBA ¶
NewColorWitRGBA sets the current color. r, g, b, a values should be between 0 and 1, inclusive.
func NewColorWitRGBA255 ¶
NewColorWitRGBA255 sets the current color. r, g, b, a values should be between 0 and 255, inclusive.
func NewColorWithHex ¶
NewColorWithHex sets the current color using a hex string. The leading pound sign (#) is optional. Both 3- and 6-digit variations are supported. 8 digits may be provided to set the alpha value as well.
Types ¶
type TextDraw ¶
type TextDraw interface {
// GetMetrics font.Metrics
GetMetrics() font.Metrics
// GetWidth returns the width of the text.
GetWidth(text string) float64
// GetHeight returns the height of the text.
GetHeight() float64
// GetTextWithWidth returns the text that fits in the specified width.
GetTextWithWidth(text string, width float64) string
// TextWrap x
TextWrap(text string, width float64) []string
// DrawString draws the specified text at the specified point.
DrawString(im draw.Image, c color.Color, s string, x, y float64)
// DrawStringAnchored draws the specified text at the specified anchor point.
// The anchor point is x - w * ax, y - h * ay, where w, h is the size of the
// text. Use ax=0.5, ay=0.5 to center the text at the specified point.
DrawStringAnchored(im draw.Image, c color.Color, s string, x, y, ax, ay float64)
// DrawStringWrapped word-wraps the specified string to the given max width
// and then draws it at the specified anchor point using the given line
// spacing and text alignment.
DrawStringWrapped(im draw.Image, c color.Color, s string, x, y, ax, ay, width, lineSpacing float64, align Align) float64
// DrawStringToDC draws the specified text at the specified point.
DrawStringToDC(im *gg.Context, c color.Color, s string, x, y float64)
// DrawStringAnchoredToDC draws the specified text at the specified anchor point.
// The anchor point is x - w * ax, y - h * ay, where w, h is the size of the
// text. Use ax=0.5, ay=0.5 to center the text at the specified point.
DrawStringAnchoredToDC(im *gg.Context, c color.Color, s string, x, y, ax, ay float64)
// DrawStringWrappedToDC word-wraps the specified string to the given max width
// and then draws it at the specified anchor point using the given line
// spacing and text alignment.
DrawStringWrappedToDC(im *gg.Context, c color.Color, s string, x, y, ax, ay, width, lineSpacing float64, align Align) float64
}
