We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我在使用"gen_sample_by_captcha.py"脚本生成中文验证码时,在sample/origin文件夹下生成的验证码图片中的中文全是方框。这个可有解决办法。captcha_config.json配置如下: { "root_dir": "sample/origin/", "image_suffix": "png", "characters": "你好中国我他她", "count": 1000, "char_count": 4, "width": 100, "height": 60 }
生成的验证码图片如下:
The text was updated successfully, but these errors were encountered:
问题解决了,是设置的字体问题。默认字体是:“DroidSansMono.ttf”,不支持中文。 在gen_sample_by_captcha.py中,初始化ImageCaptcha类的时候,可以设置字体。
fonts_path = 'xxxxx/Python36_64/lib/site-packages/captcha/data/' fonts_list = [os.path.join(fonts_path, 'SIMYOU.ttf')] generator = ImageCaptcha(width=width, height=height, fonts=fonts_list) #设置字体
Sorry, something went wrong.
No branches or pull requests
我在使用"gen_sample_by_captcha.py"脚本生成中文验证码时,在sample/origin文件夹下生成的验证码图片中的中文全是方框。这个可有解决办法。captcha_config.json配置如下:
{
"root_dir": "sample/origin/",
"image_suffix": "png",
"characters": "你好中国我他她",
"count": 1000,
"char_count": 4,
"width": 100,
"height": 60
}
生成的验证码图片如下:
The text was updated successfully, but these errors were encountered: