Check for font loading issues more extensively

This commit is contained in:
crschnick 2024-03-15 11:58:33 +00:00
parent 55441b737f
commit 3a47755c73

View file

@ -2,6 +2,7 @@ package io.xpipe.app.core;
import io.xpipe.core.process.OsType;
import io.xpipe.core.util.XPipeInstallation;
import javafx.scene.text.Font;
import java.util.concurrent.TimeUnit;
@ -12,7 +13,7 @@ public class AppBundledFonts {
return;
}
if (hasFonts()) {
if (hasFonts() && canLoadFonts()) {
return;
}
@ -32,4 +33,14 @@ public class AppBundledFonts {
return false;
}
}
private static boolean canLoadFonts() {
try {
// This can fail if the found fonts can somehow not be loaded
Font.getDefault();
return true;
} catch (Exception e) {
return false;
}
}
}