Dituon / petpet

根据模板生成图像
http://d2n.moe/petpet/
GNU Affero General Public License v3.0
310 stars 81 forks source link

Fontconfig error: Cannot load default config file #83

Closed Shinyaleaves closed 1 year ago

Shinyaleaves commented 1 year ago

这个在我的群晖和CentOS 7的机器都有,但是在MacOS就没有

2023-03-01 16:51:08 I/stdout: Petpet GifMakerThreadPoolSize: 5 2023-03-01 16:51:08 I/stdout: ヾ(≧▽≦*)o Petpet 初始化成功,使用 pet 以获取keyList! Fontconfig error: Cannot load default config file 2023-03-01 16:51:09 E/PetPet: java.lang.InternalError: java.lang.reflect.InvocationTargetException java.lang.InternalError: java.lang.reflect.InvocationTargetException at java.desktop/sun.font.FontManagerFactory$1.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at java.desktop/sun.font.FontManagerFactory.getInstance(Unknown Source) at java.desktop/java.awt.Font.(Unknown Source) at java.desktop/java.awt.Font.createFont(Unknown Source) at petpet-5.3.mirai2.jar//moe.dituon.petpet.share.BasePetService.registerFontsToAwt(BasePetService.java:156) at petpet-5.3.mirai2.jar//moe.dituon.petpet.share.BasePetService.readData(BasePetService.java:54) at petpet-5.3.mirai2.jar//moe.dituon.petpet.plugin.PluginPetService.readData(PluginPetService.java:59) at petpet-5.3.mirai2.jar//moe.dituon.petpet.mirai.MiraiPetService.readData(MiraiPetService.java:86) at petpet-5.3.mirai2.jar//moe.dituon.petpet.mirai.MiraiPetpet.onEnable(MiraiPetpet.java:57) at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnEnable$mirai_console(JvmPluginInternal.kt:232) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:305) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:35) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt:50) at net.mamoe.mirai.console.plugin.PluginManager.enablePlugin(PluginManager.kt:173) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.enableAllLoadedPlugins$mirai_console(PluginManagerImpl.kt:181) at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:347) at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:496) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:177) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:176) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:54) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.itxtech.mcl.Utility.bootJars(Utility.java:86) at org.itxtech.mcl.Utility.bootJars(Utility.java:76) at org.itxtech.mcl.Utility.bootMirai(Utility.java:98) at org.itxtech.mcl.module.builtin.Boot.boot(Boot.java:113) at org.itxtech.mcl.module.ModuleManager.phaseBoot(ModuleManager.java:123) at org.itxtech.mcl.Loader.lambda$start$4(Loader.java:196) at org.itxtech.mcl.Loader.tryCatching(Loader.java:151) at org.itxtech.mcl.Loader.start(Loader.java:196) at org.itxtech.mcl.Loader.main(Loader.java:84) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source) at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source) ... 35 more Caused by: java.lang.NullPointerException: Cannot load from short array because "sun.awt.FontConfiguration.head" is null at java.desktop/sun.awt.FontConfiguration.getVersion(Unknown Source) at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(Unknown Source) at java.desktop/sun.awt.FontConfiguration.init(Unknown Source) at java.desktop/sun.awt.X11FontManager.createFontConfiguration(Unknown Source) at java.desktop/sun.font.SunFontManager$2.run(Unknown Source) at java.desktop/sun.font.SunFontManager$2.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at java.desktop/sun.font.SunFontManager.(Unknown Source) at java.desktop/sun.awt.FcFontManager.(Unknown Source) at java.desktop/sun.awt.X11FontManager.(Unknown Source) ... 40 more

Shinyaleaves commented 1 year ago

Mirai版本为:version 2.14.0, built on 2023-02-06 14:25:21.

Dituon commented 1 year ago
  1. 检查字体文件是否完整, 位于data/font文件夹
  2. 确保jvm有足够的权限将字体注册到系统环境
  3. 手动安装字体
Shinyaleaves commented 1 year ago

感谢您的回复~

不是很懂JAVA和jvm,最后手动安装了字体,正常运行

2023-03-01 17:33:31 I/stdout: Petpet GifMakerThreadPoolSize: 5 2023-03-01 17:33:31 I/stdout: ヾ(≧▽≦*)o Petpet 初始化成功,使用 pet 以获取keyList! Fontconfig error: Cannot load default config file Fontconfig error: Cannot load default config file 2023-03-01 17:33:32 I/stdout: registerFontsToAwt失败: MiSans-Bold.ttf 2023-03-01 17:33:32 I/stdout: registerFontsToAwt失败: Aller-Bold.ttf 2023-03-01 17:33:32 I/stdout: registerFontsToAwt成功: [] 2023-03-01 17:33:32 I/stdout: Petpet 加载完毕 (共 84 素材,随机表列包含 48 素材,已禁用 0) 2023-03-01 17:33:32 I/PetPet:

██████╗ ███████╗████████╗██████╗ ███████╗████████╗
██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██╔════╝╚══██╔══╝
██████╔╝█████╗     ██║   ██████╔╝█████╗     ██║
██╔═══╝ ██╔══╝     ██║   ██╔═══╝ ██╔══╝     ██║
██║     ███████╗   ██║   ██║     ███████╗   ██║
╚═╝     ╚══════╝   ╚═╝   ╚═╝     ╚══════╝   ╚═╝     v5.3

再次表达对您的感谢!

Dituon commented 1 year ago

推荐使用最新版本 https://github.com/Dituon/petpet/releases/tag/5.4-M1