Font Embedding on the World Wide Web

Microsoft Corporation,

April 19, 1996


This document contains a high-level proposal for embedding fonts in HTML documents on the World Wide Web. Clients interact with platform-specific services (called "embedding services" in this document) that provide much of the embedding functionality.

  1. Authoring clients identify fonts to be embedded and obtain an embedded font structure from embedding services.
  2. Authoring clients create a .FONT file or .FONT files containing the embedded font structure and associate it with an HTML document using a new HTML tag, <FONT FILE> (or similar, to be agreed by W3C working group).
  3. Display clients download the HTML file, identify that there is an associated font or fonts, and postpone rendering the text.
  4. Display clients then download the associated .FONT file, install the font(s) using embedding services, and display the text of the HTML file using the newly installed font(s).

Platform Specific Embedding Services

The embedding services used by the clients perform the following functions:

The Embedded Font Structure

The Embedding Services create an embedded font structure from a specified font or fonts. The font structure has a known length and stream identifier, which the clients use to package the structure appropriately.

The .FONT File

Rather than actually embed a font structure in an HTML document, we propose that clients create a separate file to contain the embedded font or fonts, perhaps called a .FONT file, with its own URL. This file would have the following MIME specification:

The Embedded Font HTML Tag

An HTML document would contain a reference to the associated font file, similar to the way graphics or other objects are referenced within a web document. We propose the tag
<FONT FILE> to associate fonts with a web document. For example,


The Font Embedding Process

The following scenario outlines the process an authoring client might follow when embedding a font in an HTML document:

  1. The client prepares to save an HTML document, reviewing <FONT FACE> tags within the document.
  2. If a non-standard font is referenced, the client checks the embedding privileges of the font and, if appropriate, verifies with the user that the font should be embedded.
  3. The client calls the embedding services, which create an embedded font structure for the specified font or fonts.
  4. The client creates a .FONT file from the embedded font structure.
  5. The client writes a <FONT FILE> identifier in the associated HTML file.
  6. The client notifies the user that the .FONT file is now a part of the web site and referenced in the HTML file.
  7. NOTE: An additional level of security is likely to be required for fonts which are embedded in Web documents: a "digital signature", written at embed time, to guarantee the integrity of the embedded font.

The Font Loading Process

Display clients will use a procedure similar to the following to load and display embedded fonts:

  1. The client downloads the HTML document from the specified URL.
  2. The client previews the HTML text for <FONT FILE> tags indicating fonts are associated with the document.
  3. The client downloads the .FONT file from the specified URL and verifies that the font(s)should be installed.

    NOTE: More sophisticated implementations of font loading may include server-side ISAPI services that provide the client a small header file identifying the font name, checksum, and other information identifying the font. This would enable a client to decide whether to download the font at all.

  4. The client may validate the integrity of the font after downloading the font, but prior to installing the font, by using the embedding services to check the digital signature within the font file.
  5. The client uses the embedding services to install the font(s) with a unique alias (supplied by the client) and appropriate privileges. The client will need to create a table for mapping the client-assigned font name to the original font name referenced in the HTML document.
  6. The client renders the appropriate <FONT FACE> sections of the HTML text using the newly installed font(s).
  7. After the document is read and an appropriate amount of time has passed, the font is uninstalled. The .FONT file is left in the cache until regular cache maintenance functions clear it out.

OPEN ISSUE regarding HTML FORMS: Fonts with read-only embedding privileges (preview and print embedding) have previously only been allowed to be loaded for use in read-only documents. A web author may unknowingly embed a read-only font for use with an HTML form, which allows a user to modify and enter text. Rather than create a new embedding level for this purpose, or modifying the existing read-only level to permit this use of the font, the client should substitute a local font for the read-only font used in the form.

Client Responsibilities

Authoring clients need to determine which fonts are actually used in a document before embedding the fonts. Fonts that are associated with a document but not actually displayed should not be embedded.

Authoring clients also need to determine which of the fonts used in a document should actually be embedded. Fonts that will exist on the remote system, such as the Windows core fonts, should not be embedded. Users may also notify the authoring client of fonts they do not want to embed. Authoring clients are responsible for maintaining a shared typeface exclusion list that lists fonts that should not be embedded.

If an authoring client requests the font be subsetted, the client must supply the list of characters used in the document.

Authoring and display clients are responsible for defining functions that the embedding services can use to write the font structure to the .FONT file.

The embedding services report the embedding privileges the font creator has applied to the font, and clients must respect those privileges. After loading and displaying a document with a font intended for temporary use, a client must uninstall the font.

When loading a document with embedded fonts that the creator has labeled fully-installable, the display client should ask the user whether to permanently install the font or use it only temporarily. Otherwise, users may unwittingly load numerous fonts on their computer that they never regularly use.

Standards for Identifying Embeddability

Microsoft has worked with the font industry to develop standards for identifying embeddability within font files.

The embeddability of a TrueType font is determined by the creator of the font. Information about the level of embedding permitted for the font is contained in the fsType bit field of the OS/2 table, as described in the TrueType 1.0 Font File Specification.

OS/2 table                 Description                              
fsType bit settings                                                 

1                          Restricted License Embedding. The font   
                           must not be modified, embedded, or       
                           exchanged in any manner without first    
                           obtaining permission of the legal        

2                          Preview and Print Embedding. The font    
                           may be embedded within documents, but    
                           must only be installed temporarily on    
                           the remote system. Documents containing  
                           the font can only be opened as           

3                          Editable Embedding. The font may be      
                           embedded within documents, but must      
                           only be installed temporarily on the     
                           remote system. Documents containing the  
                           font can be opened for reading and