17.05.2014 Views

PDFlib 8 Windows COM/.NET Tutorial

PDFlib 8 Windows COM/.NET Tutorial

PDFlib 8 Windows COM/.NET Tutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5 Font Handling<br />

5.1 Font Formats<br />

5.1.1 TrueType Fonts<br />

TrueType file formats. <strong>PDFlib</strong> supports vector-based TrueType fonts, but<br />

not fonts based on bitmaps. TrueType font files are self-contained: they contain<br />

all required information in a single file. <strong>PDFlib</strong> supports the following<br />

file formats for TrueType fonts:<br />

> <strong>Windows</strong> TrueType fonts (*.ttf), including Western, symbolic, and CJK<br />

fonts;<br />

> TrueType collections (*.ttc) with multiple fonts in a single file. TTC files are<br />

typically used for grouping CJK fonts, but Apple also uses them to package<br />

multiple members of a Western font family in a single file.<br />

> End-user defined character (EUDC) fonts (*.tte) created with Microsoft’s<br />

eudcedit.exe tool;<br />

> On the Mac any TrueType font installed on the system (including .dfont) can also be<br />

used in <strong>PDFlib</strong>.<br />

TrueType font names. If you are working with font files you can use arbitrary alias<br />

names (see »Sources of Font Data«, page 132). In the generated PDF the name of a True-<br />

Type font may differ from the name used in <strong>PDFlib</strong> (or <strong>Windows</strong>). This is normal, and results<br />

from the fact that PDF uses the PostScript name of a TrueType font, which differs<br />

from its genuine TrueType name (e.g., TimesNewRomanPSMT vs. Times New Roman).<br />

5.1.2 OpenType Fonts<br />

The OpenType font format combines PostScript and TrueType technology. It<br />

is implemented as an extension of the TrueType file format and offers a unified<br />

format. OpenType fonts may contain optional tables which can be used<br />

to enhance text output, e.g. ligatures and swash characters (see Section 6.3,<br />

»OpenType Layout Features«, page 158), as well as tables for complex script<br />

shaping (see Section 6.4, »Complex Script Output«, page 164).<br />

While OpenType fonts offer a single container format which works on all platforms,<br />

it may be useful to understand the following OpenType flavors which sometimes lead<br />

to confusion:<br />

> Outline format: OpenType fonts may contain glyph descriptions which are based on<br />

TrueType or PostScript. The PostScript flavor is also called Compact Font Format<br />

(CFF) or Type 2, and is usually used with the *.otf suffix. The <strong>Windows</strong> Explorer always<br />

displays OpenType fonts with the »O« logo.<br />

> TrueType fonts and OpenType fonts with TrueType outlines are not easily distinguished<br />

since both may use the *.ttf suffix. Because of this blurry distinction the<br />

<strong>Windows</strong> Explorer works with the following criterion: if a .ttf font contains a digital<br />

signature it is displayed with the »O« logo; otherwise it is displayed with the »TT«<br />

logo. However, since a digital signature is not required in OpenType fonts this can-<br />

5.1 Font Formats 117

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!