If you use the Joomla content management system and are wondering how to use and display specific typefaces on your website, you have several approaches to choose from. One option is to place the font files directly on your web server. Another is to use an online font library such as Google Fonts; many modern Joomla templates already allow for this service and offer built-in integration.
In the following text we look at some of the reasons why hosting fonts yourself, that is locally, can be the better choice for your Joomla website. Apart from giving you access to a wider range of typographic styles, in some cases it can also have a positive effect on how fast your site loads.
What are web fonts?
Before we look at the specific advantages and disadvantages of each approach, it is worth explaining what web fonts actually are. When you visit any website, you may encounter two basic categories of fonts: web-safe fonts and web fonts.
Web-safe fonts are those that are already pre-installed on the device, whether a computer or a mobile phone. Examples of web-safe fonts include Arial, Times New Roman and Courier New. These fonts are often used because they are guaranteed to be available on most devices and browsers.
Web fonts are not pre-installed on the device and have to be downloaded from an external server. Examples of web fonts include Open Sans or Roboto, which come from the Google Fonts library.
Hosting fonts locally: the advantages
If you decide to host fonts locally, it means you physically place the font files on your own web server or on the CDN (Content Delivery Network) you use for the other files of your website. This approach has several advantages.
- Wider choice of fonts: Local hosting lets you choose any font you want, including those from specialist type foundries and font shops.
- Loading speed: When implemented correctly and combined with a CDN, this approach can have a positive effect on loading speed, because all requests go to your own domain.
- Control over fonts: You can have full control over how fonts are loaded and how they are cached by browsers.
Disadvantages of hosting fonts locally
Local hosting does have its drawbacks, however. If you choose this approach, you need to be aware of the following aspects:
- Font loading: If you choose a font that is not widely used, the browser will have to download it on the first visit to your website, which can slow down page loading.
- Compatibility: You need to make sure the font files are in a format compatible with most browsers (for example WOFF2 for modern browsers).
Google Fonts: advantages and disadvantages
If you decide to use a third-party service such as Google Fonts, you get a wide range of fonts that are already optimised for fast loading and compatibility with most browsers. Google Fonts are cached in users' browsers, which means visitors to your website have probably already downloaded them, and that can speed up page loading.
Google Fonts usage statistics
Another advantage of these services is the simplicity of implementation. All you need to do is add a link to an external CSS file that loads the required fonts. Most modern Joomla templates already support this integration.
On the other hand, using external services means relying on third parties, so you have less control over how the fonts are served and cached by the browser. In addition, dependence on an external network can affect loading speed if those servers run into problems.
How to set up fonts in Joomla
In the default Joomla template you can easily change the font in the Font Scheme drop-down list. The system comes preset with the "Roboto" font, which is hosted locally. Fonts are defined using the CSS property font-family, which specifies the list of fonts for a given element.
You can also download fonts from other websites, for example from https://gwfh.mranftl.com/fonts, and save them in the media/templates/site/your_template/fonts directory. Then you add the code to your template's CSS file in the media/templates/site/your_template/css directory. If you are targeting Czech users, we recommend choosing fonts that support the latin-ext character set.
When choosing how to host fonts for your Joomla website, you have several options, each with its own specific advantages and disadvantages. Hosting fonts locally gives you more control, a wider choice of fonts and potentially faster loading if it is implemented correctly with a CDN. On the other hand, external services such as Google Fonts are easier to implement and can speed up your site thanks to fonts already cached in browsers.
The final decision should take into account your specific needs, technical capabilities and priorities, whether that is maximum control, a wide choice of fonts, loading speed or simplicity of implementation.
