package com.example.wabi.ui.theme

import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.sp
import com.example.wabi.R
import com.example.wabi.models.system.Type
import com.example.wabi.view.ui.theme.CreamRed

val Confortaa = FontFamily(
    Font(R.font.comfortaa, FontWeight.Normal)
)

val BalooDa2 = FontFamily(
    Font(R.font.balooda2_bold, FontWeight.Bold),
    Font(R.font.balooda2_extrabold, FontWeight.ExtraBold),
    Font(R.font.balooda2_medium, FontWeight.Medium),
    Font(R.font.balooda2_regular, FontWeight.Normal),
    Font(R.font.balooda2_semibold, FontWeight.SemiBold),
    Font(R.font.balooda2_variablefont_wght, FontWeight.Light)
)

val EduQLDBeginner = FontFamily(
    Font(R.font.eduqldbeginner_bold, FontWeight.Bold),
    Font(R.font.eduqldbeginner_medium, FontWeight.Medium),
    Font(R.font.eduqldbeginner_regular, FontWeight.Normal),
    Font(R.font.eduqldbeginner_semibold, FontWeight.SemiBold),
    Font(R.font.eduqldbeginner_variablefont_wght, FontWeight.Light)
)

//общая переменная для обращения к шрифтам, используемым в приложении
val type = Type(
    headerFont = TextStyle(
        fontFamily = BalooDa2,
        fontWeight = FontWeight.Bold,
        fontSize = 35.sp,
        textAlign = TextAlign.Center,
        lineHeight = 35.sp,
    ),
    mainFont = TextStyle(
        fontFamily = Confortaa,
        fontWeight = FontWeight.Normal,
        fontSize = 20.sp,
        textAlign = TextAlign.Center,
        lineHeight = 20.sp
    ),
    acentFont = TextStyle(
        fontFamily = EduQLDBeginner,
        fontWeight = FontWeight.Normal,
        fontSize = 20.sp,
        lineHeight = 20.sp
    ),
    buttonFont = TextStyle(
        fontFamily = BalooDa2,
        fontWeight = FontWeight.Bold,
        fontSize = 25.sp,
        textAlign = TextAlign.Center
    ),
    error = TextStyle(
        fontFamily = Confortaa,
        fontWeight = FontWeight.Normal,
        fontSize = 20.sp,
        color = CreamRed
    ),
    forTextField = TextStyle(
        fontFamily = BalooDa2,
        fontWeight = FontWeight.Bold,
        fontSize = 20.sp,
        lineHeight = 20.sp,
    )
)

//провайдер для обращения к шрифтам и их изменению
val LocalFonts = staticCompositionLocalOf { type }