package com.jaytux.simd.frontend.theme

import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Typography
import androidx.compose.runtime.Composable
import androidx.compose.ui.text.font.FontFamily
import com.jaytux.simd.frontend.App
import frontend.composeapp.generated.resources.Alegreya
import frontend.composeapp.generated.resources.Res
import frontend.composeapp.generated.resources.Roboto_Mono
import frontend.composeapp.generated.resources.allFontResources
import org.jetbrains.compose.resources.Font

@Composable
fun Roboto() = FontFamily(Font(Res.font.Roboto_Mono))

@Composable
fun Alegreya() = FontFamily(Font(Res.font.Alegreya))

@Composable
fun buildTypography(): Typography {
    val baseline = MaterialTheme.typography
    val displayFontFamily = Alegreya()
    val bodyFontFamily = Roboto()
    val AppTypography = Typography(
        displayLarge = baseline.displayLarge.copy(fontFamily = displayFontFamily),
        displayMedium = baseline.displayMedium.copy(fontFamily = displayFontFamily),
        displaySmall = baseline.displaySmall.copy(fontFamily = displayFontFamily),
        headlineLarge = baseline.headlineLarge.copy(fontFamily = displayFontFamily),
        headlineMedium = baseline.headlineMedium.copy(fontFamily = displayFontFamily),
        headlineSmall = baseline.headlineSmall.copy(fontFamily = displayFontFamily),
        titleLarge = baseline.titleLarge.copy(fontFamily = displayFontFamily),
        titleMedium = baseline.titleMedium.copy(fontFamily = displayFontFamily),
        titleSmall = baseline.titleSmall.copy(fontFamily = displayFontFamily),
        bodyLarge = baseline.bodyLarge.copy(fontFamily = bodyFontFamily),
        bodyMedium = baseline.bodyMedium.copy(fontFamily = bodyFontFamily),
        bodySmall = baseline.bodySmall.copy(fontFamily = bodyFontFamily),
        labelLarge = baseline.labelLarge.copy(fontFamily = bodyFontFamily),
        labelMedium = baseline.labelMedium.copy(fontFamily = bodyFontFamily),
        labelSmall = baseline.labelSmall.copy(fontFamily = bodyFontFamily),
    )
    return AppTypography
}