Fonts

From MobileRead
(Redirected from TTF)
Jump to: navigation, search

Fonts are used to print all of the characters we read. They are grouped in families that have style and similar characteristics.

Contents

[edit] Definitions

font
a set of type (or glyph) in one size and style. They are mapped from characters.
glyph
the actual artistic representation in some typographic style, in the form of outlines or bitmaps that may be drawn on the screen or paper. Note that a glyph can include more than one character and may change depending on adjacent characters.
points
Points is the measurement system used to measure the size (height) of a font which includes the space that minimally separates a line. One point is 1/72 of an inch.

[edit] Introduction

Fonts are used to print all of the characters we read. They are grouped in families that have style and similar characteristics. A family consists of different sizes and different attributes. The arrangement of fonts into words and sentences on a page is called setting type or typography. For computer use a font glyph must be mapped to a particular character set (consisting of an alphabet, numbers, punctuation, and symbols. A particular binary value is assigned to each character. Prior to Unicode that was no standardize mapping except the basic characters used in ASCII and still today a particular character set may map a completely different characters into the same binary codes from another character set. Unicode attempts to provide unique binary values for each character. However in Unicode the opposite problem can exist. The same character may be mapped to multiple binary values based on font attributes or the intended interpretation. For example a "-" may be interpreted as a hyphen, a dash, or a minus sign requiring different binary values to distinguish them in a program.

[edit] Glyphs

Early computer implementations of glyphs on display screens were done with bitmapped fonts. A character was represented with a rectangular array of bits which were either on on off to show the shape of the character. The minimal size was 5x7 bits for most implementations and 5x8 if you wanted descenders to really drop below the line. Characters were recognizable but not very elegant. Larger bitmaps could be used to represent more detail. If you wanted a different attribute or a different size you generally created a new glyph.

To improve the looks of characters, especially when printed, outline fonts were designed. These shapes were described mathematically as vectors and could even be scaled or angled a bit without needed another set of fonts. They could be scaled up easily, however, as the size decreased the quality of shape of the font deteriorated. Adobe added hints to the font description to provide a method for the software to adjust the shape in the smaller sizes to make them look good and Adobe Type 1 fonts were invented.

[edit] Allographs

Sometimes a totally different shape is used to represent the same character. These are different than glyph changes, as a glyph difference is generally still recognizable. An example is lower case characters which are very different from the upper case letter. For example 'A' and 'a' are different allographs.

[edit] Generic Font families

A font family will fall into one of the following generic classifications. This list is shown with a sample latin font.

  • serif - Times Roman, New Century Schoolbook
  • sans-serif - MS Arial, MS Verdana
  • cursive - Zapf-Chancery, Caflisch Script
  • fantasy - Alpha Geometrique
  • monospace - Courier

Note that all of these fonts have recognizable characters as opposed to symbol fonts which are font sized icons or pictures.

In a CSS description the font-family, if specified, should be set to a comma separated list of acceptable fonts ending in a generic entry since the author cannot be sure of what fonts are available on the host system.

[edit] Font Attributes

These include such things as Style (italics), weight (bold), and variant (small-caps). In a CSS description the following items are supported.

attribute choices Notes
font-style normal italics oblique oblique is slanted while italics is slightly cursive. rendering engine may treat them the same.
font-weight normal bold bolder lighter numbers 100 to 900 may also be used where normal=400 and bold=700. bolder means 100 more than before and lighter 100 less.
font-variant normal small-caps may be rendered as a separate font or by changing

the font-size.

font-stretch normal wider narrower specific attributes may be specified as ultra-condensed, extra-condensed, condensed, semi-condensed, normal, semi-expanded, expanded, extra-expanded, ultra-expanded

While it is certainly possible to create the fonts with the attributes listed above with a computer by modifying the an existing standard font mathematically, having font sets will result in much better visual results as the glyphs are custom optimized.

A font set usually consists of four complete fonts, regular, italic, bold, and bold-italic. A full font family would include all of these sets in a several font sizes. The font files themselves will often use a naming convention like Font.otf (or Font.ttf), Font-Italic.otf, Font-Bold.otf and Font-BoldItalic.otf.

[edit] Font Types

[edit] Adobe Type 1

Adobe PostScript Type 1 is a worldwide standard for digital type fonts (International Standards Organization outline font standard, ISO 9541). It was first developed by Adobe Systems for use in PostScript printers. Although Adobe is a leader in the design and manufacturing of Type 1 software and maintains the standards for Type 1, hundreds of companies around the world have designed and released more than 30,000 fonts in the Type 1 format.

The Type 1 font format is recognized on every computer platform, from microcomputers to mainframes. It prints on virtually every printer, either directly through built-in PostScript language interpreting, or through add-on utilities, such as Adobe Type Manager® (ATM®). ATM technology is integrated into Microsoft® Windows® 2000 and MacOS X operating system. For more than a decade, Type 1 has been the preferred format for the graphic arts and publishing industries.

[edit] TTF

TrueType is a standard for digital type fonts that was developed by Apple Computer, and subsequently licensed to Microsoft Corporation. Each company has made independent extensions to TrueType, which is used in both Windows and Macintosh operating systems. Like Type 1, the TrueType format is available for development of new fonts. See #History of TTF

[edit] OpenType

OpenType (OTF) is a new standard for digital type fonts, developed jointly by Adobe and Microsoft. OpenType supersedes Microsoft's TrueType Open extensions to the TrueType format. OpenType fonts can contain PostScript, TrueType outlines, and even bitmapped fonts in a common wrapper. An OpenType font is a single file, which can be used on both Macintosh and Windows platforms without conversion. OpenType fonts have many advantages over previous font formats because they contain more glyphs, support more languages (OpenType uses the Unicode standard for character encoding,) and support rich typographic features such as small caps, old style figures, and ligatures — all in a single font.

[edit] Type 3 Fonts

This name is used by Adobe for bitmapped fonts

[edit] TTC

A TrueType Collection (TTC file extension) is a means of delivering multiple OpenType fonts in a single file structure. TrueType Collections are most useful when the fonts to be delivered together share many glyphs in common. By allowing multiple fonts to share glyph sets, TTCs can result in a significant saving of file space.

For example, a group of Japanese fonts may each have their own designs for the kana glyphs, but share identical designs for the kanji. With ordinary OpenType font files, the only way to include the common kanji glyphs is to copy their glyph data into each font. Since the kanji represent much more data than the kana, this results in a great deal of wasteful duplication of glyph data. TTCs were defined to solve this problem.

[edit] WOFF

WOFF (Web Open Font Format) should be regarded as a container format or "wrapper" for font data in already-existing formats. It supports the table-based sfnt (scalable font numbering table) structure used in TrueType, OpenType, and Open Font Format [OFF] fonts. It is a required format for ePub 3.

A WOFF file a repackaged version of a sfnt font with optional compression of the font data tables. The WOFF file format also allows font metadata and private-use data to be included separately from the font data. WOFF encoding tools convert an input sfnt font into a WOFF formatted file, and user agents restore the sfnt font data for use with a Web document.

[edit] Open Type Variable Fonts

Opentype variable fonts are a new type of font set that provides all of the variations in a single font set. This means you don't need a separate font for bold or italics. This is defined in OpenType specification version 1.8. So, for example, a font may contain a set of glyph outlines that correspond to the regular weight and width of a typeface, and the lighter, heavier, narrower, and extended designs will be expressed in the font data as movements of outline nodes relative to that outline.

[edit] OpenType-SVG fonts

These fonts are usually built using SVG graphics inside OpenType font files. See #Color Fonts

[edit] History of TTF

The TrueType digital font format was originally designed by Apple Computer, Inc. It was a means of avoiding per-font royalty payments to the owners of other font technologies, and a solution to some of the technical limitations of Adobe's Type 1 format.

Originally code named "Bass" (because these were scalable fonts and you can scale a fish), and later "Royal", the TrueType format was designed to be efficient in storage and processing, and extensible. It was also built to allow the use of hinting approaches already in use in the font industry as well as the development of new hinting techniques, enabling the easy conversion of already existing fonts to the TrueType format. This degree of flexibility in TrueType's implementation of hinting makes it extremely powerful when designing characters for display on the screen. Microsoft had also been looking for an outline format to solve similar problems, and Apple agreed to license TrueType to Microsoft.

Apple included full TrueType support in its Macintosh operating system, System 7, in May 1991. Its more recent development efforts include TrueType GX, which extends the TrueType format as part of the new graphics architecture QuickDraw GX for the MacOS. TrueType GX includes some Apple-only extensions to the font format, supporting Style Variations and the Line Layout Manager.

Microsoft first included TrueType in Windows 3.1, in April 1992. Soon afterwards, Microsoft began rewriting the TrueType rasterizer to improve its efficiency and performance and remove some bugs (while maintaining compatibility with the earlier version). The new TrueType rasterizer, version 1.5, first shipped in Windows NT 3.1. There have since been some minor revisions, and the version in Windows 95 and NT 3.51 is version 1.66. The new capabilities include enhanced features such as font smoothing (or more technically, grayscale rasterization).

Microsoft's ongoing development effort includes the TrueType Open specification. TrueType Open will work on any Microsoft platform and Apple Macintosh machine, and includes features to allow multi-lingual typesetting and fine typographic control.

The next extension to the TrueType Open format is to be TrueType Open version 2, a collaborative effort with Adobe Systems to produce a format capable of containing both TrueType (and Open) and PostScript data.

[edit] Font Rendering

For computer use a Font is rendered on to the display screen or printer. The resolution of the display or printer can influence the quality and appearance of the glyph. There are techniques that can improve the looks of the characters beyond the basic capabilities of the pixel or dot resolution. For a screen display the techniques include anti-aliasing and sub-pixel resolution.

Anti-alias.jpg

[edit] Anti-aliasing

Anti-aliasing is a technique where adjacent pixels are displayed in gray to soften the hard edges of the character for angles and curved edges. This can avoid the blotchy look that can be seen when the pixel resolution is too small for the font size.

[edit] Sub-pixel

Sub-pixel is a technique that fools the eye into thinking the image has higher resolution that it has. It takes advantage of the fact that, on a color display, a pixel is actually made up of 3 different color elements. These color elements are only 1/3 the size of the pixel so lighting only one effectively triples the resolution. Generally the pixel is so small that, by itself, the eye cannot distinguish the color but only sees a gray image. In this fashion a few extra elements along the edge of an angled line or curve can behave like a high resolution anti-aliasing technique for improved smoothness for the glyph. Microsoft Clear-Type uses this technique.

[edit] Embedded Fonts

The term embedded fonts refers to the inclusion of fonts in the eBook itself. The idea is that the font that is needed in the eBook may not be available on the displaying system. In some cases only a few special characters will be included but in some cases you would need the full set. This can allow, for example, Chinese to be displayed on a unit that doesn't have native support for these characters. Most eBook formats do not include embedded font support but PDF, ePUB, TPZ, and XPS do. The alternative to embedded fonts is to have images of the characters needed and display one of them when the character is needed.

See Sony EPUB Embedded Fonts for limitations on Sony Portable Readers.

Note that embedding a font in a document you produce and distribute may be in violation of the copyright on the font itself. Be sure you have permission before including a font.

[edit] Font Obfuscation

(From the idpf 3.0 spec)

Many commercial fonts allow embedding, but embedding a font implies making it an integral part of the Publication, not providing the original font file along with the content. Since integrated ZIP support is so ubiquitous in modern operating systems, simply placing the font in the ZIP archive is insufficient to signify that the font is not intended to be reused in other contexts. This uncertainty can undermine the otherwise very useful font embedding capability of EPUB Publications.

In order to discourage reuse of the font, some font vendors may allow use of their fonts in EPUB Publications if those fonts are bound in some way to the Publication. That is, if the font file cannot be installed directly for use on an operating system with the built-in tools of that computing device, and it cannot be directly used by other EPUB Publications. Two methods are used. Method one is the apply DRM to the fonts. This may be used even when the eBook itself doesn't use DRM. The second method is to obfuscate the fonts so that they cannot simply be extracted from the zip file and used as is. Not all vendors will accept obfuscation so the author needs to obtain permission from the vendor.

The algorithm employed to obfuscate the font file consists of modifying the first 1040 bytes (~1KB) of the font file (or all of the file if it is less that 1040 bytes). This is done using a key and then performing a logical exclusive or (XOR) on the first byte of the raw file and the first byte of the key is stored as the first byte of the embedded font file. This process is repeated with the next byte of source and key, until all bytes in the key have been used. At this point, the process continues starting with the first byte of the key and 21st byte of the source. Once 1040 bytes have been encoded in this way (or the end of the source is reached), any remaining data in the source is directly copied to the destination.

[edit] Ligatures

Some letter combinations have been determined to look better if they are especially spaced. For example fl can be shown using a ligature fl and fi can be shown as fi. These are called Stylistic ligatures and are a feature of typography. Other times a special letter combination can be combined to represent a different phoneme to aid in pronouncing the word. A ligature occurs where two or more graphemes are joined as a single glyph. These require ligature fonts in the font set to be displayed properly. In a few cases they may use a ligature from a different font set if one is not available in the one in use. See special characters for examples of ligatures.

[edit] Font editing

  • Type Light is a free font editing tool for OpenType fonts from CR8 software.
  • Type 3.2 is a commercial font editor from CR8 software.
  • Type Tuner Web allows downloading custom fonts from their sets including alternate glyphs.
  • FontForge Open source font editor for Windows, MacOS, and Linux.

[edit] Images

It is also possible to use graphics images as fonts (technically glyphs). An inline image in an eBook will typically scale with the text around it and can be used when there is no character available. They can also be used for drop caps where a really fancy decorated font is desirable. Here is a download site for font images. Select the image style and then click the box.

For more on this subject see Bitmapped fonts.

[edit] Fonts available for download

The look of a Font is often called a typeface.

[edit] specialized or unique fonts

[edit] Color Fonts

The latest craze in 2019 is color fonts when there is a mix of colors within a single character. See https://www.colorfonts.wtf/ for details and more information. These fonts are usually built using SVG graphics inside OpenType font files. The official name is OpenType-SVG fonts. (The Symbola fonts mentioned above use this format.) It is claimed that:

  • They bring multiple colors, shades, textures and transparency to type
  • They include vector shapes, bitmap images or even both into font files
  • Color fonts can impact any type of text, since they may contain any type of characters, including emojis and icons.

[edit] For more information

Personal tools
Namespaces

Variants
Actions
Navigation
MobileRead Networks
Toolbox