Visit Main Site
Join Partner Program
Login
     
Getting Started with Template
Building a Website
Starting Template Creation
Layout
Creating Your Layout
Editing The Content Section
Creating & Editing Docker
Positioning
Pages
Create a Page
Page Content Editor
More Features
Widgets
Files & Assets
Designing With Custom CSS
Development With Custom JS
How to Add Fonts
How to Add Images
Navigation
How to Create?
How to Modify Existing Navigation?
How to Set a Navigation?
Snippet
Adding Snippet Template
Add Code to Snippet Template
Data Attribute
Skip-control
Create Snippet
Using Snippets on Page
Responsive Design
Crafting Responsive Content
Crafting a Responsive Header
Hide Grid for Specific Resolutions
Import & Export Guide
Marketplace Template Management
Demo Template
Logo & Favicon
» How to Add Fonts

How to Add Fonts

If you intend to incorporate embedded fonts into your template, you can begin by creating a folder and organising your font files within it. While there are no strict rules regarding the naming of files and folders, it is crucial to follow the appropriate file path convention when using the @font-face rule in your style.css file.

The file path should adhere to the following format: /template/eightDigit/folderName/fileNameWithExtension

You can obtain the eight-digit code from the General Settings section in the WebCommander admin panel.

We can add fonts to the WebCommander front-end in two different ways. The first method is to import fonts from a Content Delivery Network (CDN) such as Google Fonts. The second method is to embed the font directly into our own site.

To import a font from a CDN, we need to add an @import rule in the style.css file. Here’s an example:

CSS
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;500;700&display=swap');

body {
  font-family: 'Roboto', sans-serif;
}

To embed a font in the WebCommander front-end, you need to follow these steps:

  1. Place the font files (.ttf, .eot, .woff, .svg) in the “fonts” folder of your project.
  2. Open the style.css file and add the @font-face rule. Here’s an example:
CSS
@font-face {
    font-family: 'Gilroy';
    src: url('../fonts/gilroymedium/Gilroy-Medium.eot');
    src: url('../fonts/gilroymedium/Gilroy-Medium.eot?#iefix') format('embedded-opentype'),
    url('../fonts/gilroymedium/Gilroy-Medium.woff2') format('woff2'),
    url('../fonts/gilroymedium/Gilroy-Medium.woff') format('woff'),
    url('../fonts/gilroymedium/Gilroy-Medium.ttf') format('truetype'),
    url('../fonts/gilroymedium/Gilroy-Medium.svg#Gilroy-Medium') format('svg');
    font-weight: 500;
    font-style: normal;
}

body {
  font-family: 'Gilroy';
}
Terms and Conditions
Privacy Policy

© 2024 WebCommander | All Rights Reserved

contact@webcommander.com
1300 797 571

WebCommander
About Us
Features
Pricing
Compare
Partners
Contact Us
Resource
Find a Partner
Help Centre
Community
Blog
Solutions
Inventory Management
Omnichannel Sales
Ecommerce Automation
B2B Ecommerce
Headless Commerce
Website Design and Performance