This commit is contained in:
2025-12-04 10:47:58 +08:00
parent 752b90b048
commit 7b45b43a0e
6 changed files with 14 additions and 56 deletions

View File

@@ -216,9 +216,21 @@ func (fm *FontManager) buildFontPaths(fontNames []string) []string {
}
}
// 只记录关键错误
// 只记录关键错误,并显示调试信息
if len(existingFonts) == 0 {
fm.logger.Warn("未找到字体文件", zap.Strings("font_names", fontNames))
workDir, _ := os.Getwd()
execPath, _ := os.Executable()
fm.logger.Warn("未找到字体文件",
zap.Strings("font_names", fontNames),
zap.String("work_dir", workDir),
zap.String("exec_path", execPath),
zap.String("base_dir", fm.baseDir),
zap.String("first_tried_path", func() string {
if len(fontPaths) > 0 {
return fontPaths[0]
}
return "none"
}()))
}
return existingFonts