Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FontFamily.Monospace doesn't seem to work for Web? #293

Open
Zomis opened this issue Jun 12, 2024 · 1 comment
Open

FontFamily.Monospace doesn't seem to work for Web? #293

Zomis opened this issue Jun 12, 2024 · 1 comment

Comments

@Zomis
Copy link

Zomis commented Jun 12, 2024

It might be me who is doing something wrong, or it might be something with Compose and/or Wasm, but I can't get the monospace font to work when building for Web.

Add to Kotlin Multiplatform project (I used the https://kmp.jetbrains.com generator)

val state = rememberRichTextState()
LaunchedEffect(Unit) {
    state.addSpanStyle(SpanStyle(fontFamily = FontFamily.Monospace))
    state.setText("Hello World.,!?")
}
RichTextEditor(state, modifier = Modifier.fillMaxSize())

Run ./gradlew :composeApp:wasmJsBrowserDevelopmentRun

Expected result: Monospace font

Actual result: No monospace font

Any help on how to make Monospace font appear in browser appreciated.

On Desktop it works as expected.

@MohamedRejeb
Copy link
Owner

If you try a normal Text composable or a TextField with this font family, it works fine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants