diff --git a/core/src/cz/nic/tablexia/Tablexia.java b/core/src/cz/nic/tablexia/Tablexia.java index f64728686422600a38e980da277ecca65cbb1f33..1c1ea3c7a3d34b9a1294d64ea78ab22adbb04db5 100644 --- a/core/src/cz/nic/tablexia/Tablexia.java +++ b/core/src/cz/nic/tablexia/Tablexia.java @@ -132,11 +132,13 @@ public class Tablexia extends TablexiaApplication { } private void startLoading(Locale locale) { + // Prepare fonts (Fonts need to be loaded before any screen is active) + ApplicationFontManager.getInstance().load(); + // sync loaded screen with loader image setScreen(Utility.getScreenForScreenClass(TablexiaSettings.LOADER_SCREEN, null)); // async internal assets loading - ApplicationFontManager.getInstance().load(); ApplicationTextManager.getInstance().load(locale); ApplicationInternalSoundManager.getInstance().load(); ApplicationInternalTextureManager.getInstance().load(); diff --git a/core/src/cz/nic/tablexia/loader/application/ApplicationFontManager.java b/core/src/cz/nic/tablexia/loader/application/ApplicationFontManager.java index 0dc9ccae9ded50ce979ae0fa1dc399ad0544c9cf..736bd104591c46bbbc200c05fba923e4a1807a94 100644 --- a/core/src/cz/nic/tablexia/loader/application/ApplicationFontManager.java +++ b/core/src/cz/nic/tablexia/loader/application/ApplicationFontManager.java @@ -104,7 +104,15 @@ public class ApplicationFontManager extends AssetManager implements IApplication instance = null; } - private void loadSDFFont() { + public ShaderProgram getDistanceFieldShader() { + return distanceFieldShader; + } + + public DistanceFieldFont getDistanceFieldFont(FontType_NEW fontType) { + return fontType.isBold() ? robotoBoldFont : robotoRegularFont; + } + + public void load() { robotoRegularFont = new DistanceFieldFont(Gdx.files.internal(ROBOTO_REGULAR_FONT_FILE), false); robotoRegularFont.setUseIntegerPositions(false); robotoRegularFont.setDistanceFieldSmoothing(ApplicationFontManager.DISTANCE_FIELD_FONT_SIZE); @@ -119,16 +127,4 @@ public class ApplicationFontManager extends AssetManager implements IApplication // pedantic flag indicating whether attributes & uniforms must be present at all times // distanceFieldShader.pedantic = false; } - - public ShaderProgram getDistanceFieldShader() { - return distanceFieldShader; - } - - public DistanceFieldFont getDistanceFieldFont(FontType_NEW fontType) { - return fontType.isBold() ? robotoBoldFont : robotoRegularFont; - } - - public void load() { - loadSDFFont(); - } } \ No newline at end of file