chore: add emoji fallback font support for web
This commit is contained in:
@@ -27,6 +27,7 @@ import bzh.ajaury.chombev.onboarding.ui.viewmodel.OnboardingViewModel
|
||||
import bzh.ajaury.chombev.player.ui.PlayerScreen
|
||||
import bzh.ajaury.chombev.records.ui.RecordsScreen
|
||||
import bzh.ajaury.chombev.theme.ChomBevTheme
|
||||
import bzh.ajaury.chombev.theme.RegisterEmojiFallbackFont
|
||||
import bzh.ajaury.chombev.web.model.WebPage
|
||||
import bzh.ajaury.chombev.web.ui.WebViewScreen
|
||||
import org.koin.compose.KoinApplication
|
||||
@@ -53,6 +54,8 @@ fun App() {
|
||||
val darkTheme = isSystemInDarkTheme()
|
||||
|
||||
ChomBevTheme(darkTheme = darkTheme) {
|
||||
RegisterEmojiFallbackFont()
|
||||
|
||||
val onboardingViewModel: OnboardingViewModel = koinViewModel()
|
||||
val onboardingUiState by onboardingViewModel.uiState.collectAsStateWithLifecycle()
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package bzh.ajaury.chombev.theme
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
|
||||
/**
|
||||
* Makes colour emoji renderable on platforms whose font manager has no emoji font of its own.
|
||||
*
|
||||
* Android, iOS and Desktop resolve emoji through the system fonts, so their implementations do
|
||||
* nothing. Only the web needs a bundled font: Skia runs in the browser without any system font
|
||||
* manager, and the default font baked into skiko has no emoji glyphs — they come out as tofu boxes.
|
||||
*
|
||||
* Emits nothing; call it once, high in the composition.
|
||||
*/
|
||||
@Composable
|
||||
internal expect fun RegisterEmojiFallbackFont()
|
||||
Reference in New Issue
Block a user