implement import/export for typographie

This commit is contained in:
MM20
2025-06-18 22:46:54 +02:00
parent fb85b49798
commit c672e0826a
6 changed files with 64 additions and 1 deletions
@@ -11,6 +11,7 @@ import de.mm20.launcher2.themes.colors.DefaultLightColorScheme
import de.mm20.launcher2.themes.colors.EmptyCorePalette
import de.mm20.launcher2.themes.shapes.Shapes
import de.mm20.launcher2.themes.transparencies.Transparencies
import de.mm20.launcher2.themes.typography.Typography
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationException
import kotlinx.serialization.json.JsonObject
@@ -26,6 +27,7 @@ data class ThemeBundle(
val name: String,
val author: String? = null,
val colors: Colors? = null,
val typography: Typography? = null,
val shapes: Shapes? = null,
val transparencies: Transparencies? = null,
/**
@@ -216,6 +216,7 @@ sealed interface FontWeight {
* Absolute font weight, e.g. 400 for normal, 700 for bold.
*/
@JvmInline
@Serializable
value class Absolute(val weight: Int) : FontWeight
/**
@@ -224,5 +225,6 @@ sealed interface FontWeight {
* the emphasized style with a relative weight of 100 will have a weight of 500,
*/
@JvmInline
@Serializable
value class Relative(val relativeWeight: Int) : FontWeight
}