Dynamic import/selection of multiple fonts in Web app

Viewed 35

I have a vue app with a frontend repo and a custom CMS (JAVA API backend), you can change colors and assets from CMS and I want to add dynamic font selection from CMS. My question is, which is the best way to achieve that based on clean code and performance.

My thoughts were, to load a bunch of popular fonts and let the User choose from CMS. In that case I will add all fonts to the frontend repo and lazy-load them based on selection (Drawback the user will not be able to upload/use another custom font)

Upload the ttf/woff2 files from CMS and download them from frontend and use them.(Drawback initial request and load time)

Use Google Fonts and add a selector in CMS for the user to choose.(Drawback initial request and load time)

Any other ideas or someone that has done it before otherwise?

0 Answers
Related