Closed wiryadev closed 3 years ago
Compose currently only supports a subset of the fontFamily
constants, and serif-monospace
is unfortunately not one of them:
https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/font/FontFamily.kt;l=31
Also see the TODO in this library: https://github.com/material-components/material-components-android-compose-theme-adapter/blob/develop/lib/src/main/java/com/google/android/material/composethemeadapter/TypedArrayUtils.kt#L216
Understood, thanks for explanation
MDC Adapter can not display serif-monospace, but works with other fontFamily like monospace and sans-serif-black.
And here is Serif Monospace in Compose and Views XML:
The fact that it doesnt exist in google fonts make it harder to use this font manually in Compose:
Additional Info Sample app to reproduce that is available here.