I would really like if someone could provide me with either a repo or a blog/docs explaining the best way of adding fonts in a
project.
Using google fonts with a link to their CDN gave me performance issues since they nead to load eagerly or cause CLS if I load lazily. I have tried looking on this discord channel and docs, and while my research hasn't been extensive (about an hour), I haven't gotten any silver-bullet solution which I feel like it has to exists.
Currently, I'm using a method I found in a blog post talking about SSR in general that I managed to use in Quick City. I have attached the font file under /public and then I change my font-family with a class that I have attached to body tag in the root.tsx file while also attaching the aforementioned file with a link tag as a stylesheet.
My current solution gets rid of the call to Google Fonts cdn and has no font-shifting, so it performs better and looks better. My current solution also give me an error of "file was not loaded because its MIME type, font/ttf” is not text/css ", but I'm sure that if my solution is the best way of adding font files to Qwik City that I'm just a few Googles away from getting rid of that issue.
So, does anyone here have a repo I can look at or know where I can find more info on the topic?