You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
onWasmReady {
val fontFamily = mutableStateOf<FontFamily?>(null)
MainScope().launch {
val data = resource("font/NotoSansJP-Regular.ttf").readBytes()
val font = Font("notoSansJP", data)
val fm = FontFamily(listOf(font))
fontFamily.value = fm
}
CanvasBasedWindow("Show Japanese or Chinese", canvasElementId = "ComposeTarget") {
MaterialTheme(colorScheme = if (isSystemInDarkTheme()) darkColorScheme() else lightColorScheme()) {
Scaffold(
modifier = Modifier.fillMaxSize()
) {
DefaultFontComposable(font = fontFamily.value ?: FontFamily.Default) {
UIShow()
}
}
}
}
}
}```
and ```@Composable
public funDefaultFontComposable(
font: FontFamily,
content: @Composable () -> Unit
) {
CompositionLocalProvider(LocalTextStyle provides TextStyle(fontFamily = font)){
content()
}
}``` this is just a workaround .. andthis font in resource/font directory . i am using google font -> download then paste in font directory ..
I am using the text component to display text, but it cannot display Chinese
The text was updated successfully, but these errors were encountered: