mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-10-01 09:40:35 +13:00
Verify font loading
This commit is contained in:
parent
2a8bd7b2a0
commit
e8566ea137
3 changed files with 11 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue