top | item 37946980

(no title)

imslavko | 2 years ago

Does it support exporting to SVGs without requiring the used fonts installed on the viewer's system? That seems to be the issue the author is trying to address.

discuss

order

HL33tibCe7|2 years ago

Can the author not simply include the necessary fonts on his site?

imslavko|2 years ago

I only read the article once, but to me it seemed like this was an explicit requirement: produce a vector artifact that renders the same on all platforms without dependencies (basically a PDF?) and without invoking a browser in the build process.

Sort of like folks would praise Go's ability to compile a static binary without dylib dependencies besides libc.

steveruizok|2 years ago

Embedding fonts isn't really great for SVG exports; either you link to the fonts, in which case the SVGs only load correctly when the user has the font locally or is online, and the CDN is still running; or else you embed them as base 64, which makes the image very large.

We do the base 64 route for tldraw, which is sort of the best of all bad options. I'd like to someday add more export options so that a creator could host the fonts themselves on the same site where the SVG is shown.