Documentation
¶
Overview ¶
Package layout lays an ad's words over its picture: the headline, a second line, a button and the brand's logo, in any shape. The picture itself carries no text, so the words can change and the ad can be made in another size without making (and paying for) a new picture.
Index ¶
Constants ¶
const ( MinWidth = 240 MaxWidth = 2160 )
Limits on what is drawn.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Ad ¶
type Ad struct {
// Picture fills the whole ad, cropped around its middle.
Picture image.Image
// Logo sits in the top left corner; nil for none.
Logo image.Image
// Headline, Subline and CTA are the words; any may be empty.
Headline, Subline, CTA string
// Font is a TrueType or OpenType font for every word; nil, or one
// that can't be read, uses the built-in one.
Font []byte
// Accent colours the button; nil gives a white one.
Accent *color.NRGBA
}
Ad is what goes on one picture.