Tuesday, January 1, 2008

Introduction

When discussing TrueType hinting it is best to think of TrueType as a programming language. Font companies who produce TrueType all use different approaches. Individual typographic engineers in a font company may also use different hinting philosophies. A single type engineer may use a different overall strategy from typeface1 to typeface.

In this document I begin by discussing the hinting process in a general, high level manner, and then convert that high level description into actual TrueType code.


A note about hinting tools

Tools used to produce professional fonts are not necessarily commercially available. Software and font companies have developed specific software for their development needs. In this document the syntax used for all TrueType instructions should be considered specific to this document and / or a specific TrueType development tool. For a full explanation of TrueType instructions and their syntax see the Microsoft TrueType spec Version 1.66 (or later) or the manual of a specific TrueType editor. In addition to proprietary tools the known TrueType editors are currently: RoyalT from Apple Computer and TypeSolution's TypeMan and StingRay.


Starting out

If you have ever painted a picture you know you start with a blank surface and sketch out the basic shapes. Then you add the tones. After that you get more and more specific until you decide the painting is complete. In general every painting is done the same way. But the details are always different. The edges are sharpened differently. Highlights are either added or not. Perhaps you will use the classic red line, perhaps not. This is what hinting is about. Decisions.

The first thing you must consider is the kind of fonts2 you are hinting and how the separate fonts relate to the whole typeface. When the core fonts from the typeface Times New Roman were hinted, the type engineers compared all fonts to be included in the family (regular, italic, bold and bold italic). They measured each font and determined if values such as heights or stem values should be consistent through the family or specific to the font.

Type is a tool for communication

type is the single most used method of communication. Most people are not aware of this fact because type is usually doing its job by delivering and not distracting from the message. To continue to do that job digitally we must consider that the solution for a printed document is very different than the solution for a low resolution screen. These images may be derived from the same source but the final images seen are NOT the same thing. The rules and design decisions made for the printed high resolution images need to be keep separate from those of low resolution devices. A new set of rules needs to be adopted for these new devices.

Visual equality is not mathematical equality

The most important concept in type design is visual equality. It is the most used technique in designing letterforms. Type designers make very subtle changes to different letterforms to make them appear equal. They lighten vertical strokes when there are multiple strokes and make serifs different lengths to make them visually the same. Sidebearings, advance widths and stem weights are all examples of this balancing technique. The technique is to be used at the right time and should not be confused with poorly marked or aligned stems, badly spaced glyphs or inconsistent vertical and horizontal distances.

Overview

the purpose of the Character Design Standards is to state the general rules for character shapes in Latin based languages in digital fonts. Primarily defining the guidelines designers use for character alignments, both vertical and horizontal and how these relate to other similar characters or character groups.

These guidelines should be thought of as a roadway to the goal of a well made typeface. This roadway is not a heavily patrolled, narrow one lane street but a well marked multi-lane path that takes you where you want to go.

Making digital type is not the same as drawing a typeface

The art and process of designing letterforms is a very creative task but it is not void of the rules and guidelines that govern good design. Any form of design is a solution to a problem or need. A good design is one that is appropriate for its use without any inappropriate features.

As an example, a well designed house is one large enough for its inhabitants, stylistically equivalent to its culture and strong enough for its environment. A well designed typeface is appropriate for its use and its final usable form appropriate for that use or device.

This document is about the final usable font. It is not a definition of how to use or design a typeface. This document also is less concerned with the artistic decisions in creating letterforms than it is with creating a usable, functional solution for written communication.

Overview

the purpose of the Character Design Standards is to state the general rules for character shapes in Latin based languages in digital fonts. Primarily defining the guidelines designers use for character alignments, both vertical and horizontal and how these relate to other similar characters or character groups.

These guidelines should be thought of as a roadway to the goal of a well made typeface. This roadway is not a heavily patrolled, narrow one lane street but a well marked multi-lane path that takes you where you want to go.

Making digital type is not the same as drawing a typeface

The art and process of designing letterforms is a very creative task but it is not void of the rules and guidelines that govern good design. Any form of design is a solution to a problem or need. A good design is one that is appropriate for its use without any inappropriate features.

As an example, a well designed house is one large enough for its inhabitants, stylistically equivalent to its culture and strong enough for its environment. A well designed typeface is appropriate for its use and its final usable form appropriate for that use or device.

This document is about the final usable font. It is not a definition of how to use or design a typeface. This document also is less concerned with the artistic decisions in creating letterforms than it is with creating a usable, functional solution for written communication.

Introduction

In a relatively simple digital font architecture, as typified by the original TrueType format developed at Apple Computers, there is a one-to-one relationship between an encoded character and the glyph that represents it. Systems and applications that make use of such fonts do not need to make a distinction between character processing and glyph processing. In working with such fonts, it is most often convenient to think only in terms of character processing, or simply text processing: that is, the sequential rendering of glyphs representing character codes as input in logical order. When applications have needed to provide more complicated text processing for complex scripts or sophisticated typography, they have generally made use of proprietary engines to shape text based on custom character sets, or have obliged users to resort to font switching to access variant glyph forms. The idiosyncratic nature of these solutions frequently results in text that cannot be exchanged outside of particular systems and applications.

The wide adoption of the Unicode Standard for character encoding provides a means to make text interchangeable across different systems and between applications that implement the standard. The Unicode Standard is strictly concerned with character processing, and presumes that Unicode text strings will be input and stored in a simple sequence defined as 'logical order'. The Unicode Standard also presumes the existence of rendering systems above the Unicode text string that will, as necessary, reorder codepoints and affect sophisticated glyph processing to shape the rendering of the text through glyph substitution and positioning features. This article introduces the different elements of the Microsoft Windows implementation of Unicode character and glyph processing, and explains how they can be used by font and application developers to provide users with sophisticated typographic controls and the ability to process text in complex scripts.

This article explains three principal elements of Windows technology and their interaction: the OpenType font format, the Windows Unicode Script Processor (Uniscribe), and the OpenType Layout Services library (OTLS). The first part of the article provides an overview of Windows glyph processing, explaining the role of each of these elements and demonstrating how they render a sample string of complex script text. The second part of the article covers each of these elements in greater detail, explaining some of the internal workings of font tables, Uniscribe script shaping engines, and the interaction of OTLS with client applications.

The audience for this article includes type designers and font vendors, software engineers and application developers. These groups do not always speak the same language, so I have tried to provide concise definitions, in the notes, of terminology that may be confusing for some readers; these and other notes are indicated in the text by bracketed numbers. One person's daily vocabulary is another's impenetrable jargon, and not all type designers are comfortable with terms such as API and DLL that are common currency among software engineers. Likewise, most engineers are likely to scratch their heads when typographers start speaking of nuts and mutton.