Let’s initiate a discussion!!
Generally, if you load font as preload, it will load first and it will help to increase site speed.
So If you want to add custom font as preload, you need to perform settings as shown below:
The first step is to set your font .woff or .woff2 file in your theme web/fonts folder.
Then after you need to set that font in between head like below in default.xml layout file.
1 2 3 4 5 6 7 8 9 10 11 12 |
<?xml version="1.0"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <font src="fonts/custom-font.woff2"/> </head> </page> |
The search box is the most underrated functionality that is...
Managing and customizing Magento site can be a daunting task,...
Having an in-house eCommerce developer is very costly, and it...
Have you wonder why your conversions are less compare to...
According to a research, around 68% of eCommerce stores are...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.