support otf fonts in captcha

This commit is contained in:
HF 2023-12-27 15:43:48 +01:00
parent 057f60f049
commit 09c4b4c284

View File

@ -20,7 +20,7 @@ if (isMainThread) {
}
const font = fs.readdirSync(path.resolve(__dirname, '..', FONT_FOLDER))
.filter((e) => e.endsWith('.ttf'))
.filter((e) => e.endsWith('.ttf') || e.endsWith('.otf'))
.map((e) => ppfunCaptcha.loadFont(
path.resolve(__dirname, '..', FONT_FOLDER, e),
));