10.07.2015 Views

Download - Multivac!

Download - Multivac!

Download - Multivac!

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

When working with host fonts it is important to use the exact (case-sensitive) fontname. Since font names are crucial we mention some platform-specific methods for determiningfont names below. More information on font names can be found in Section5.2.1, »PostScript Type 1 Fonts«, page 98, and Section 5.2.2, »TrueType and OpenTypeFonts«, page 99.Finding host font names on Windows. You can easily find the name of an installedfont by double-clicking the font file, and taking note of the full font name which will bedisplayed in the first line of the resulting window. Some fonts may have parts of theirname localized according to the respective Windows version in use. For example, thecommon font name portion Bold may appear as the translated word Fett on a Germansystem. In order to retrieve the host font data from the Windows system you must usethe translated form of the font name in PDFlib (e.g. Arial Fett), or use font style names(see below). However, in order to retrieve the font data directly from file you must usethe generic (non-localized) form of the font name (e.g. Arial Bold).Note You can avoid this internationalization problem by appending font style names (e.g. »,Bold«,see below) to the font name instead of using localized font name variants.If you want to examine TrueType fonts in more detail take a look at Microsoft’s free»font properties extension« 1 which will display many entries of the font’s TrueType tablesin human-readable form.Windows font style names. When loading host fonts from the Windows operating systemPDFlib users have access to a feature provided by the Windows font selection machinery:style names can be provided for the weight and slant, for examplefont = p.load_font("Verdana,Bold", "unicode", "");This will instruct Windows to search for a particular bold, italic, or other variation of thebase font. Depending on the available fonts Windows will select a font which mostclosely resembles the requested style (it will not create a new font variation). The fontfound by Windows may be different from the requested font, and the font name in thegenerated PDF may be different from the requested name; PDFlib does not have anycontrol over Windows’ font selection. Font style names only work with host fonts, butnot for fonts configured via a font file.The following keywords (separated from the font name with a comma) can be attachedto the base font name to specify the font weight:none, thin, extralight, ultralight, light, normal, regular, medium,semibold, demibold, bold, extrabold, ultrabold, heavy, blackThe keywords are case-insensitive. The italic keyword can be specified alternatively or inaddition to the above. If two style names are used both must be separated with a comma,for example:font = p.load_font("Verdana,Bold,Italic", "unicode", "");Numerical font weight values can be used as an equivalent alternative to font stylenames:1. See www.microsoft.com/typography/TrueTypeProperty21.mspx104 Chapter 5: Font Handling

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

Saved successfully!

Ooh no, something went wrong!