tldraw / tldraw

SDK for creating whiteboards and canvas experiences on the web.
https://tldraw.dev
Other
33.4k stars 1.99k forks source link

[Example Request]: How to specify a non-default font for text #3700

Closed mochizuki-pg closed 3 weeks ago

mochizuki-pg commented 3 weeks ago

What's the example?

Are there other ways to use fonts?

DefaultFontStyle: import('./StyleProp').EnumStyleProp<
  'draw' | 'mono' | 'sans' | 'serif'
>

I want to use an external font

I tried using defineEnum to define a new one, but it gave me an error

ValidationError: At instance(id = instance:instance).stylesForNextShape.app:.

Code of Conduct

linear[bot] commented 3 weeks ago

TLD-2495 [Example Request]: How to specify a non-default font

MitjaBezensek commented 3 weeks ago

Sorry, but we don't have a good way of adding custom fonts at the moment. One way you can do it is to host the fonts yourself and then just rename the custom fonts to the names that our default fonts use. This would override one of the existing fonts though.

We definitely want to improve this in the future.