mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Check for font loading issues more extensively
This commit is contained in:
parent
55441b737f
commit
3a47755c73
1 changed files with 12 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue