The character codes for symbols in a unique font available at fontello.com

Is there a way to identify the charCode for a glyph in a custom font?

In order to keep my website lightweight, I have designed a custom font with only the 5 icons from FontAwesome that are necessary using . These icons will replace the characters from the complete FontAwesome set that I had been using during development.

To reduce bandwidth usage, I do not want to include the standard fontawesome CSS file, opting instead for the bare minimum.

This is how I implemented it with FontAwesome:

HTML:

<p class="info"> — an (i) for Info icon should appear at the beginning of this line</p>

CSS:

.info::before {
font-family:FontAwesome;
padding: 0 0.5em 0 0;
content: "\f05a"; /* (i) icon */
}

The size of the .svg version of FontAwesome is 253 KB. In contrast, my 5-glyph .svg font is less than 3 KB, resulting in significant bandwidth savings.

However, the (i) glyph does not reside at position "\f05a" within my custom font, nor is it among the characters 012345, ABCDE or abcde. I wish to modify my CSS rule to something like this:

CSS:

.info::before {
font-family:Font5some;
padding: 0 0.5em 0 0;
content: "\xxxx"; /* (i) icon */
}

How can I determine which hexadecimal values to use in place of \xxxx?

Answer №1

Font creation is made easy on Fontello.com. Just head to the top of the page next to "Choose Icons", and you'll find "Modify Codes". This is where you can view and customize your font codes. If you prefer, you can also locate the codes in the Fontello demo.html file.

Answer №2

To view the codes, simply access the SVG file using a text editor and you'll find them listed like this:
glyph unicode="&#xf05a;"

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Basic CSS text overlay on top of images

Hey there! I'm in need of some assistance with displaying text over an image. Specifically, I'd like the text to appear on the left side of the two people in the image and remain proportional when transitioning from desktop to tablet view using m ...

Is there a restriction on the number of stylesheets per page in Internet Explorer 8?

Discussing the limitations of CSS in a forum thread, a user shared insights: A user mentioned that Internet Explorer has is known to have a restriction of 4096 CSS rules per file. For more information, check out this source. Additionally, there might be ...

I'm looking to replicate the testimonial slider from the link provided. How can I achieve this?

I'm looking to replicate the testimonial section layout seen on Kanbanize, which features both vertical and horizontal sliders. I'm unsure of how to link the two sliders so they move in sync. I typically use Swiper for carousel/slider functionali ...

dropdown menu center

I'm currently working with a Bootstrap drop-down menu and I'm trying to figure out how to center the menu directly over the button. Currently, it's aligning to the left or right of the button depending on available space. Any help would be a ...

Focusing solely on a particular category in EJS

I am struggling with this code snippet. HTML: <header<% if ( current.source === 'features' || current.path[0] === 'index' || current.source !== 'customers' ) { %> class="header-white"<% } %>> <div cl ...

Instructions on utilizing the CSSStyleSheet.insertRule() method for modifying a :root attribute

Is it possible to dynamically set the background color of the :root CSS property in an HTML file based on a hash present in the URL? The code provided does change the background color, but unfortunately, the hash value doesn't persist as users navigat ...

Placing text inside a designated element on a different web page upon clicking a button

Imagine a scenario where a user is browsing a website and lands on the 'prices' page. They come across a product that catches their eye and decide to click on the associated button. This action redirects them to the 'contact us' page, w ...

jQuery's height calculations for elements are inaccurate

I have a total of seven divs, each with the class "row". Initially, their content is hidden but there is a timeline that spans from the first row to the last one. The height of the timeline is calculated dynamically based on the combined heights of all row ...

Issues with the appearance of CSS styles on a Firebase site

After deploying a SPA in Firebase, I noticed that the CSS styles only appear correctly after refreshing the browser. I have created a short video demonstrating the issue: https://www.youtube.com/watch?v=dIuQ-axizj8 This is my firebase.json configuration: ...

Is it possible to turn off GPU rasterization for a particular SVG element in Google Chrome?

There is a peculiar issue with the SVG graphic displayed on my webpage. On some computers, the complex linearGradient filling a Rect does not display all the Stops correctly, while on other computers it appears fine. I discovered that if I disable "GPU ra ...

Utilizing jQuery's POST Method to Fetch JSON Data on a Website

I've developed a Java REST API and now I want to retrieve JSON data on my website (which is built using HTML & CSS) by utilizing jQuery. The method to be used is POST, and here is the structure of my JSON: { "sessionID" : "25574", "interactiv ...

How can I make the Box div bigger or smaller?

My goal is to expand and collapse the slider div only for the box where the user clicks. I have achieved this functionality, but a problem arises when I click "read more" - all the boxes expand, which is not the desired behavior. I want only the specific b ...

HTML input field that shows a hint text when selected

Is there a way to create a text box that shows a hint when clicked on? For example, you can see this feature by clicking on the address text box in the following link: ...

JavaScript code for styling changes is not functioning as expected

Check out this code snippet: var moving_nav = document.getElementById("moving_nav"); var logo = document.getElementById("logo"); setInterval(function(){ var scrolled = window.pageYOffset || document.documentElement.scrollTop; if (scrolled >= ...

Tips for perfectly centering text within p tags using CSS

Currently, I am troubleshooting the JSFiddle where my goal is to vertically center text using CSS. Below is the HTML code that I utilized to create the JSFiddle: <div class="poster text-center pt-4"> <div class="item"> <img class=" ...

Aligning radio button vertically in React using Bootstrap styling

I am struggling to align a radio button within a container inline with other buttons on the right. Can anyone provide guidance on how to resolve this issue? Here is my current setup: https://i.sstatic.net/SSWZe.png Code: import React, { Component } from ...

When the content div is clicked within the overlay div, the popup will also close

I want to design a pop-up that features a container with a black background and some opacity, where the content of the popup is placed inside. Here's what I have in mind: <button (click)="showPopup = !showPopup">Open popup</button& ...

Tips for changing between two texts within a button when clicked

Seeking a solution for toggling between two different texts inside a button when making an ajax call, with only one text displayed at a time. I'm facing difficulty in targeting the spans within the button specifically. Using 'this' as conte ...

What is the appropriate way to link the right function to the slideshow button?

I'm having trouble creating a functional slideshow with buttons. Each button should display its corresponding div when clicked, while the slideshow continues to function as normal. View the demo here: http://jsfiddle.net/sabeti05/dsagcc5u/ HTML ...

Struggling to center divs in HTML and CSS but running into issues on mobile devices?

I've been facing some serious CSS issues lately! Currently, I have everything set up to center the #Box div, which works perfectly on all devices except for mobile browsers. The problem arises because the screen size of the mobile browser is too narr ...