common: create indirection kludge to workaround compiler error

Without this the compiler fails to reason that the Manrope variable actually
does get initialized.
This commit is contained in:
Harsh Shandilya 2022-01-20 20:53:37 +05:30
parent b3dbbd31f3
commit a351a35a43
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80
3 changed files with 5 additions and 3 deletions

View file

@ -7,7 +7,7 @@ import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import dev.msfjarvis.claw.common.R
actual val Manrope =
actual fun createFontFamily() =
FontFamily(
Font(R.font.manrope_bold, FontWeight.Bold),
Font(R.font.manrope_extrabold, FontWeight.ExtraBold),

View file

@ -6,7 +6,9 @@ import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.sp
expect val Manrope: FontFamily
expect fun createFontFamily(): FontFamily
private val Manrope = createFontFamily()
val AppTypography =
Typography(

View file

@ -6,7 +6,7 @@ import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.platform.Font
actual val Manrope =
actual fun createFontFamily() =
FontFamily(
Font("font/manrope_bold.ttf", FontWeight.Bold),
Font("font/manrope_extrabold.ttf", FontWeight.ExtraBold),