Custom desktop font (#6377)

* Custom desktop font

* Add `getDesktopAllFonts` to setting custom desktop font.

* Custom font.
`desktopFontFamily` change to `fontFamily`.
Add GameSettings.getSettingsForPlatformLaunchers().

* Add `Custom font` setting UI.

* Add `Custom font` on Android.

* `Default Font` use translations.

* format

* remove open fun.

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
This commit is contained in:
Tang
2022-03-21 14:12:16 -05:00
committed by GitHub
parent 130fd653a4
commit c1737b6183
10 changed files with 153 additions and 26 deletions

View File

@ -11,6 +11,7 @@ import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration
import com.unciv.UncivGame
import com.unciv.UncivGameParameters
import com.unciv.logic.GameSaver
import com.unciv.models.metadata.GameSettings
import com.unciv.ui.utils.Fonts
import java.io.File
@ -34,12 +35,15 @@ open class AndroidLauncher : AndroidApplication() {
val config = AndroidApplicationConfiguration().apply {
useImmersiveMode = true;
}
val fontFamily = GameSettings.getSettingsForPlatformLaunchers(filesDir.path).fontFamily
val androidParameters = UncivGameParameters(
version = BuildConfig.VERSION_NAME,
crashReportSysInfo = CrashReportSysInfoAndroid,
fontImplementation = NativeFontAndroid(Fonts.ORIGINAL_FONT_SIZE.toInt()),
customSaveLocationHelper = customSaveLocationHelper,
limitOrientationsHelper = limitOrientationsHelper
version = BuildConfig.VERSION_NAME,
crashReportSysInfo = CrashReportSysInfoAndroid,
fontImplementation = NativeFontAndroid(Fonts.ORIGINAL_FONT_SIZE.toInt(), fontFamily),
customSaveLocationHelper = customSaveLocationHelper,
limitOrientationsHelper = limitOrientationsHelper
)
game = UncivGame(androidParameters)