增加内置字体、贝塞尔曲线、算术验证码、base64输出

This commit is contained in:
whvcse@foxmail.com
2019-08-25 15:29:08 +08:00
parent 1d9dc73bda
commit 8be24c89ea
3 changed files with 6 additions and 6 deletions

View File

@@ -271,7 +271,7 @@ public abstract class Captcha extends Randoms {
}
public void setFont(int font, int style, float size) throws IOException, FontFormatException {
this.font = Font.createFont(Font.TRUETYPE_FONT, new File(getClass().getResource("/" + FONT_NAMES[font]).getFile())).deriveFont(style, size);
this.font = Font.createFont(Font.TRUETYPE_FONT, getClass().getResourceAsStream("/" + FONT_NAMES[font])).deriveFont(style, size);
}
public int getLen() {