PRB: Embedded Read-Only Fonts in Multiple Application Instances on Windows 9x

ID: Q230210


The information in this article applies to:


SYMPTOMS

Microsoft Windows Operating Systems provide a feature called Embedded Read-Only fonts that an application can use to temporarily install a TrueType font such that only the application can access and use the font.

The behavior of this feature on Windows 95 and Windows 98 may be unexpected. The second and any subsequent instance of the application fails to install the font resource when it is created "hidden." This behavior is designed to protect the Embedded Read-Only font from misuse by other processes.


CAUSE

The AddFontResource() function fails to install a hidden font resource file created by the CreateScalableFontResource() function when the font resource file is already in use.

Multiple processes can not use the same hidden font resource at the same time.


RESOLUTION

Each instance of an application can use a TrueType font file via a hidden font resource created by the CreateScalableFontResource() function by creating unique copies of the TrueType font file.

To make a TrueType font file unique, the application instance must change the name of the font in the TrueType font file and recalculate the checksum. The resulting TrueType font file is considered to be unique by the operating system but provides the same glyphs because the definition of the font has not changed.

However, each instance of the application needs to use the new font face name in the LOGFONT structure that was given to the font when it was modified to make it unique.

Alternatively, the application can install the font without using the hidden font resource option. This allows all processes in the system to use the font.


STATUS

This behavior is by design.

This design prevents other processes in the system from using private fonts that a process has installed as hidden to presumably protect the font from unlicensed use outside of the application.


MORE INFORMATION

On Windows 95 and Windows 98, when a font resource file is created by the CreateScalableFontResource() function as a hidden font resource, the operating system special cases the use of this file. When a process attempts to install this font resource file to access the TrueType font, the system fails the AddFontResource() function call if the hidden resource file is currently installed.

The hidden font resource mechanism provided by the CreateScalableFontResource() function is intended for use by applications that use a TrueType font file with restrictive licensing requirements. The AddFontResource() function call fails to install the font resource file as a protection from attempted use of the font by other processes.

Multiple instances of an application can each use an Embedded Read-Only font by modifying multiple copies of the TrueType font file so that the font files are unique.

For information on the structure of a TrueType font file, consult the OpenType specification (formerly the TrueType specification) referenced later in this article.

Steps to Reproduce Behavior

  1. In an application, install a TrueType font file by creating a hidden font resource with the CreateScalableFontResource() function and install it by calling the AddFontResource() function.


  2. Try to use the font in the application programmatically ensuring that the CLIP_EMBEDDED flag is used in the LOGFONT structure.


  3. Observe that the font cannot be installed or used by any simultaneous instance of the application beyond the first instance that was started.



REFERENCES

For additional information about this issue on Windows NT, please see the following article in the Microsoft Knowledge Base:

Q230179 PRB: Embedded Read Only Fonts in Multiple Application Instances on Windows NT
For additional information on the OpenType (TrueType) specification, please see the OpenType Specification on Microsoft's website.

Or, see the OpenType Specification on Adobe's website.

For additional information about calculating TrueType font file checksums, please see the following article in the Microsoft Knowledge Base:
Q102354 Calculating the TrueType Checksum

Additional query words: licensing embedding bug failure fail font map mapping problem


Keywords          : kbFont kbGDI kbNTOS400 kbSDKWin32 kbTTFonts kbGrpGDI 
Version           : WINDOWS:95,98
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: May 7, 1999