|
@ -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 ![]() (image error) Size: 45 KiB After ![]() (image error) Size: 45 KiB ![]() ![]() |
Before ![]() (image error) Size: 63 KiB After ![]() (image error) Size: 63 KiB ![]() ![]() |
Before ![]() (image error) Size: 64 KiB After ![]() (image error) Size: 64 KiB ![]() ![]() |
Before ![]() (image error) Size: 60 KiB |
Before ![]() (image error) Size: 57 KiB After ![]() (image error) Size: 57 KiB ![]() ![]() |
Before ![]() (image error) Size: 57 KiB After ![]() (image error) Size: 57 KiB ![]() ![]() |
After ![]() (image error) Size: 61 KiB |
Before ![]() (image error) Size: 20 KiB After ![]() (image error) Size: 20 KiB ![]() ![]() |
Before ![]() (image error) Size: 33 KiB After ![]() (image error) Size: 33 KiB ![]() ![]() |
After ![]() (image error) Size: 27 KiB |
Before ![]() (image error) Size: 26 KiB |
Before ![]() (image error) Size: 28 KiB After ![]() (image error) Size: 28 KiB ![]() ![]() |
Before ![]() (image error) Size: 6.5 KiB After ![]() (image error) Size: 6.9 KiB ![]() ![]() |