varabyte / kobweb

A modern framework for full stack web apps in Kotlin, built upon Compose HTML
https://kobweb.varabyte.com
Apache License 2.0
1.46k stars 65 forks source link

Typography (i.e. how to set fancy fonts) #49

Closed bitspittle closed 1 year ago

bitspittle commented 2 years ago

We should look at how Jetpack Compose does it with Material theming and also Chakra UI?

alialbaali commented 1 year ago

Is there any way to set a regular .ttf font via Kobweb?

bitspittle commented 1 year ago

Apologies! But I don't have the bandwidth to respond to general questions on the issue tracker, I'm pretty overwhelmed at the moment.

However, if you have Discord, I'd highly recommend visiting our server (linked in the README), as you can search its history and get answers from our community.

This can be done and I'm pretty sure this topic came up in our discord in the past.

Otherwise, the best high level advice I can give is to figure out how to do this in normal html / css, then use the kobweb block in the build script to set things that would normally appear in the head block of your site, put the ttf file in your resources/public folder, and then use an InitSilk block to register styles like I do in my blog site.

I will be working on docs soon and have made a note to answer this question there when I get to it.