Timidfriendly
Timidfriendly

Reputation: 3284

@font-face: Icon fonts & Converting CSS character (Hex) Value

Background

I am working a lot at the moment with webfonts, and specifically icon fonts. I need to ascertain the which character a specific icon is for testing purposes, so I can simply type the character &/or copy-paste it.

Example

The CSS of most icon fonts is similar, using the :before pseudo approach e.g.

.icon-search:before{content:"\f002"}

Question

Summary

I would love to be able to find out which character it is so I can simply type it on my keyboard. I have spent ages looking it up but am not quite sure what this type of encoding and conversion is called so can't find what i'm looking for. I'd appreciate some pointers.

Upvotes: 3

Views: 4212

Answers (1)

Timidfriendly
Timidfriendly

Reputation: 3284

SOLVED - the answer below for completeness

After some research myself I just want to confirm that the encoding used in CSS is indeed called HEX encoding. I did find a converter that allows me to enter the HEX value and converts it to Decimal http://www.binaryhexconverter.com/hex-to-decimal-converter

If you want to use a HTML entity then all you need to do is wrap the converted decimal value in the obligatory &# ; entity start/finish characters and you are good to go.

Example

(HEXvalue = \f002) converts to (Decimal = 61442)

This HTML entity is therefore 

Upvotes: 5

Related Questions