Use Google Sans Flex as the default font

This commit is contained in:
MM20
2026-01-30 15:33:07 +01:00
parent 02cd17312f
commit 8ba55f8345
27 changed files with 98 additions and 132 deletions

View File

@@ -16,4 +16,5 @@ val SemiTransparentId = UUID(0L, 1L)
val SystemFontId = UUID(0L, 1L)
val MonospaceId = UUID(0L, 2L)
val SerifId = UUID(0L, 3L)
val SerifId = UUID(0L, 3L)
val RoundedTypographyId = UUID(0L, 4L)

View File

@@ -29,7 +29,7 @@ class FontManager(
val deviceBodyExists = deviceBodyResId != 0 &&
context.resources.getString(deviceBodyResId).isNotBlank()
return FontList(
builtIn = listOf(FontFamily.LauncherDefault),
builtIn = listOf(FontFamily.LauncherDefault, FontFamily.LauncherDefaultRound),
generic = listOf(
FontFamily.SansSerif,
FontFamily.Serif,

View File

@@ -185,6 +185,10 @@ sealed interface FontFamily {
@SerialName("launcher_default")
data object LauncherDefault : FontFamily
@Serializable
@SerialName("launcher_default_round")
data object LauncherDefaultRound : FontFamily
@Serializable
@SerialName("device_headline")
data object DeviceHeadline : FontFamily

View File

@@ -5,6 +5,7 @@ import de.mm20.launcher2.database.AppDatabase
import de.mm20.launcher2.themes.DefaultThemeId
import de.mm20.launcher2.themes.MonospaceId
import de.mm20.launcher2.themes.R
import de.mm20.launcher2.themes.RoundedTypographyId
import de.mm20.launcher2.themes.SerifId
import de.mm20.launcher2.themes.SystemFontId
import kotlinx.coroutines.CoroutineScope
@@ -30,6 +31,7 @@ class TypographyRepository(
fun get(id: UUID): Flow<Typography?> {
if (id == DefaultThemeId) return flowOf(default)
if (id == RoundedTypographyId) return flowOf(defaultRound)
if (id == SystemFontId) return flowOf(systemFont)
if (id == SerifId) return flowOf(serif)
if (id == MonospaceId) return flowOf(monospace)
@@ -63,6 +65,7 @@ class TypographyRepository(
private fun getBuiltIn(): List<Typography> {
return listOf(
default,
defaultRound,
systemFont,
serif,
monospace,
@@ -73,10 +76,23 @@ class TypographyRepository(
get() = Typography(
id = DefaultThemeId,
builtIn = true,
name = "Outfit",
name = "Google Sans",
fonts = mapOf(
"brand" to FontFamily.LauncherDefault,
"plain" to null,
"plain" to FontFamily.LauncherDefault,
),
styles = DefaultTextStyles,
emphasizedStyles = DefaultEmphasizedTextStyles,
)
private val defaultRound: Typography
get() = Typography(
id = RoundedTypographyId,
builtIn = true,
name = "Google Sans (Rounded)",
fonts = mapOf(
"brand" to FontFamily.LauncherDefaultRound,
"plain" to FontFamily.LauncherDefaultRound,
),
styles = DefaultTextStyles,
emphasizedStyles = DefaultEmphasizedTextStyles,