Verify font loading

This commit is contained in:
crschnick 2023-12-22 12:20:20 +00:00
parent 2a8bd7b2a0
commit e8566ea137
3 changed files with 11 additions and 2 deletions

View file

@ -58,7 +58,15 @@ public class AppFont {
node.setStyle(node.getStyle() + "-fx-font-size: " + (baseSize + off) + "pt;");
}
public static void loadFonts() {
public static void verifyFontLoadingFunctional() {
try {
Font.getDefault();
} catch (Throwable t) {
throw new IllegalStateException("Font loading is not working. Check whether your system is properly configured with fontconfig", t);
}
}
public static void init() {
TrackEvent.info("Loading fonts ...");
AppResources.with(
AppResources.XPIPE_MODULE,

View file

@ -102,6 +102,7 @@ public abstract class OperationMode {
AppProperties.logSystemProperties();
AppProperties.logPassedProperties();
XPipeSystemId.init();
AppFont.verifyFontLoadingFunctional();
TrackEvent.info("mode", "Finished initial setup");
} catch (Throwable ex) {
ErrorEvent.fromThrowable(ex).term().handle();

View file

@ -25,7 +25,7 @@ public abstract class PlatformMode extends OperationMode {
TrackEvent.info("mode", "Platform mode initial setup");
PlatformState.initPlatformOrThrow();
AppFont.loadFonts();
AppFont.init();
AppTheme.init();
AppStyle.init();
AppImages.init();