Help with approach for language based fonts

Hi Team,

I am working on implementing the user’s language based font. For eg: If a user has language ‘Language 1’, use ‘Font1’. So, based on User’s language, apply the font throughout the application. There are currently 30 languages, and each language has around 4-5 files (.ttf, .woff, etc) total in around 30 mb size for one language. (So total 900 mb for all languages)
Could you please help me with the approach? The approaches I find

  1. Save all the fonts files on the server in a directory. Language Directory → ‘Language 1’ Directory → All font files.
    This approach will increase the code size so think not good to go with.

  2. Upload all the files on CDN and use the fonts (CDN Urls) based on the language. This approach finds suitable.

Let me know your thoughts on this.

No, not at all. The load and the code is the same whether the requested files are on your server or on the CDN server.

That’s equivalent to:
Upload all the files to your site and use the fonts (your Urls) based on the language.

The CDN option is a feature for speed and bandwidth when the requested files are common to many sites so you can expect the visitor’s browser already have those exact files (CDN Urls) in cache.

Thanks Erik for the response.
So, are you saying from speed and bandwidth perspective, to go with CDN Option otherwise storing files on the server will suffice?

Yes. :slight_smile:

Also, when relying on a third part for essential files, you’re putting them out of your control and that has always some risk for failure.

You are right Erik.

Thanks for valuable inputs.

1 Like

If you are loading every font for every user it will be very inneficient, CDN or not.
The key will be to load only the specific fonts a user needs.

That seems to be what @SamA74 pointed out, load only the specific language a user needs.

Do you already have a solution for detecting the user’s language?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.