Browsers Internet

How to embed a True Type Font on your web page?

You may have an interesting or weird font type that you want on your web page, but in order for other people to be able to see this font you will need to embed it on your web page. Why? Because when a visitor views a web site, the only fonts that will display are those installed on the visitors system!

So if you want either a weird gothic font or an old Celtic font such as in the main logo of my site (which is actually an image) you will need to either display the font in an image or embed the font in your web page.

Why Use Embedded Fonts?

Because a font is an operating system resource, not a browser resource. If you have an unusual font installed on your PC, it’s easy to design a Web page and include that font. You can see it because the font is installed on your operating system. But if your visitors don’t have it installed too, their browsers will display their default font instead.

From a page designer’s perspective, this is a big weakness. You want pages to display like you intend, but can’t control an individual browser’s display. No matter how carefully you lay out your page with a particular font, you’re at the mercy of the user’s browser when the page is displayed.

That’s where embedded fonts come in: with them, you don’t have to worry about browsers defaulting to a more common font. Instead, your font downloads along with the page.

1. Locate And Use The Font

Finding fonts is easy. Once you’ve found the perfect font, you’re ready to download it to your computer and use it in your page design.

Do some research first though: some designers don’t allow their fonts to be embedded. TrueType fonts have embedding permissions encoded within them. Please respect the designer’s wishes to avoid any potential copyright problems!

2. Create An Embedded Font File

You have to use a third-party application that creates an embedded font file using the font you installed locally on your hard drive. This task may be time-consuming because Netscape and Explorer both use different formats.

Recently though, Netscape updated its method to support Explorer browsers. Microsoft continues to use a proprietary technology.

Create embedded fonts using one of 2 available formats:

  1. Portable Font Resources (.pfr): TrueDoc technology was developed by Bitstream and licensed by Netscape. It can be viewed by Navigator 4.0+ and Explorer 4.0+ on Windows, Mac, and Unix platforms.
  2. Embeddable Open Type (.eot): Compatible only with Explorer 4.0+ on the Windows platform. Create .eot files using Microsoft’s free Web Embedding Font Tool (WEFT).

After you’ve created the embedded font file, you’re ready to attach it to a CSS.

3. Attach To Your Style Sheet

  1. Into the HEAD section of your document insert:

    Example with True Type

    To work in IE4 and above, you need to add a pointer to an ActiveX control immediately after the LINK tag OR ELSE create an OpenType file for Explorer and refer to both on your page.

    TrueDoc fonts stay within the browser: you can’t download them to your system

    Example with Open Type

This method works in IE5 & IE6 but is not supported by Firefox/Opera.

A List Apart have an article on Dynamic Text Replacement which presents an interesting method for replacing blocks of text such as headers with dynamic images. Worth checking out.

This method works in IE5 & IE6 but is not supported by Firefox/Opera.

'Coz sharing is caring

By Swatantra Kumar

Swatantra is an engineering leader with a successful record in building, nurturing, managing, and leading a multi-disciplinary, diverse, and distributed team of engineers and managers developing and delivering solutions. Professionally, he oversees solution design-development-delivery, cloud transition, IT strategies, technical and organizational leadership, TOM, IT governance, digital transformation, Innovation, stakeholder management, management consulting, and technology vision & strategy. When he's not working, he enjoys reading about and working with new technologies, and trying to get his friends to make the move to new web trends. He has written, co-written, and published many articles in international journals, on various domains/topics including Open Source, Networks, Low-Code, Mobile Technologies, and Business Intelligence. He made a proposal for an information management system at the University level during his graduation days.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.