hey guys, i have issue with unicode symbols in web...
# compose-web
d
hey guys, i have issue with unicode symbols in web compose (wasm): is it possible to load some modern font?
a
You can have webpack bundle font resources and then you can require them and load them as any other url into a font object
d
doesn't work. also setting typefaces via MaterialTheme does nothing on web platform
a
ill pull up an example
d
i managed it with platform specific typeface loader
Copy code
actual suspend fun platformTypography(): Typography = Typography(
    defaultFontFamily = FontFamily(
        Font(
            identity = "roboto",
            data = loadBytesFromPath("Roboto-Regular.ttf")
        )
    )
)
would be awesome if this code works in common module so we don't have repeat it on all platforms
a
oh nice. yeah its probably a WIP
what contructor is that
Font
in ?
e
@deviant if you don't mind, what's the current state of Compose Web canvas in your experience?
d
@ESchouten well it works 🙂 i have some performance issue in firefox. but chrome works fine. you can check this project https://github.com/mykola-dev/Tetris
j
@deviant Lack of keyboard support is the first thing I noticed, but 🤯 this is amazing!