|
@ -676,7 +676,7 @@ func TestImageOperationsGolden(t *testing.T) {
|
|||
f.Overlay(gopher.(images.ImageSource), 20, 30),
|
||||
f.Text("No options"),
|
||||
f.Text("This long text is to test line breaks. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."),
|
||||
f.Text("Hugo rocks!", map[string]interface{}{"x": 30, "y": 30, "size": 15, "color": "#ff0000"}),
|
||||
f.Text("Hugo rocks!", map[string]interface{}{"x": 3, "y": 3, "size": 20, "color": "#fc03b1"}),
|
||||
}
|
||||
|
||||
resized, err := orig.Fill("400x200 center")
|
||||
|
|
|
@ -46,9 +46,9 @@ func (*Filters) Text(text string, options ...interface{}) gift.Filter {
|
|||
linespacing: 2,
|
||||
}
|
||||
|
||||
var opt map[string]interface{}
|
||||
var opt maps.Params
|
||||
if len(options) > 0 {
|
||||
opt := maps.MustToParamsAndPrepare(options[0])
|
||||
opt = maps.MustToParamsAndPrepare(options[0])
|
||||
for option, v := range opt {
|
||||
switch option {
|
||||
case "color":
|
||||
|
@ -62,7 +62,6 @@ func (*Filters) Text(text string, options ...interface{}) gift.Filter {
|
|||
case "linespacing":
|
||||
tf.linespacing = cast.ToInt(v)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.9 KiB |