mojocn/base64Captcha

text must not be empty, there is nothing to draw

virskor opened this issue · 0 comments

Text must not be empty, there is nothing to draw
Could you please write a document with full descriptions?
It's hard to find the way to use this library like add more fonts or use fonts?
Thank you.

func (c *Captcha) Create() (map[string]interface{}, error) {
	var (
		driver       base64Captcha.Driver
		driverString base64Captcha.DriverString
	)

	driver = driverString.ConvertFonts()
	
	captcha := base64Captcha.NewCaptcha(driver, store)
	id, b64s, err := captcha.Generate()
	if err != nil {
		return nil, err
	}

	return map[string]interface{}{
		"captcha":   b64s,
		"captchaID": id,
	}, nil
}