update at 2026-02-09 16:09:44
This commit is contained in:
@@ -36,7 +36,14 @@ function run() {
|
||||
const wrapped = wrapTextByChars('123456', 2)
|
||||
assert(wrapped === '12\n34\n56', 'wrapTextByChars 结果不符合预期')
|
||||
|
||||
const fontFile = findFirstFontFile(path.join(__dirname, '..', 'frontend', 'public', 'fonts'))
|
||||
const fontRootCandidates = [
|
||||
path.join(__dirname, '..', 'fonts'),
|
||||
path.join(__dirname, '..', 'frontend', 'public', 'fonts'),
|
||||
]
|
||||
const fontRoot = fontRootCandidates.find((dir) => fs.existsSync(dir))
|
||||
assert(fontRoot, '未找到字体目录(fonts 或 frontend/public/fonts)')
|
||||
|
||||
const fontFile = findFirstFontFile(fontRoot)
|
||||
assert(fontFile, '未找到可用字体文件')
|
||||
|
||||
const buffer = fs.readFileSync(fontFile)
|
||||
|
||||
Reference in New Issue
Block a user