Open hat618 opened 1 week ago
Hi, thank you for taking time to submit issue.
For preloadSystemFonts
, the feature it depends (queryLocalFonts()
function) seems not be very widely deployed on modern browsers so I suggest not to use it in production.
For preloadRemoteFonts
, since I'm not knowing whether we have problem when loading data from google fonts, I would like to experiment it by myself a bit and answer you. I'm currently busy with publishing tinymist and typst.ts so I may go back in a few days.
After experiements, I would like to add some documentation to help all people in future.
If you find I forget it in next days, you can @me to remind me.
@Myriad-Dreamin bumping this as mentioned (and thanks for the helpful response so far).
Thanks for this package; it's worked a charm to date. I am trying to load custom fonts for rendering in the browser. Following the commentary listed in the documentation and previous issues (#514), the general consensus will be to use the node compiler for future reference. But in the meantime, what is the correct way to load remote fonts? I can't seem to get it working.
Is your feature request related to a problem? Please describe. The functionality to load custom fonts (both working for font families and individual fonts), just seems to be missing either an example of how it all ties together when attempting to render these in the browser with
preloadSystemFonts
.Describe the solution you'd like An integrated working example of the
beforeBuild
andpreloadSystemFonts
working for the latest version of the typst lib.Describe alternatives you've considered See below for an attempt to do this so far.
Additional context
Using
typst.ts@0.5.0-rc7
typst-ts-web-compiler@0.5.0-rc7
typst-ts-renderer@0.5.0-rc7
Example component to try to load custom fonts (Vue 3)