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.

Path resource category (again, the SearchPath resource category can alternatively be configuredin a UPR file), for example:p.set_parameter("SearchPath", "/usr/fonts");p.set_parameter("FontOutline", "f1=DFHSMincho-W3.ttf");font = p.load_font("f1", "unicode", "");For PostScript fonts the corresponding resource configuration must relate the font metricsand outline data (the latter only if embedding is requested, see Section 5.3.3, »FontEmbedding«, page 106) to the corresponding disk file(s):p.set_parameter("FontOutline", "f1=LuciduxSans.pfa");p.set_parameter("FontPFM", "f1=LuciduxSans.pfm");font = p.load_font("f1", "unicode", "embedding");In order to select a font which is contained in a TrueType Collection (TTC, see Section5.6.2, »Custom CJK Fonts«, page 117) file you directly specify its name:p.set_parameter("FontOutline", "f1=msgothic.ttc");font = p.load_font("f1", "unicode", "");The font name can be encoded in ASCII or Unicode, and will be matched against allnames of all fonts in the TTC file. Alternatively, to select the n-th font in a TTC file youcan specify the number n with a colon after the font name:p.set_parameter("FontOutline", "f1=msgothic.ttc");font = p.load_font("f1:0", "unicode", "");PostScript font metric files. The font name is related to the name of a disk-based orvirtual PostScript font metric file via the FontAFM or FontPFM resource. This is sufficientif font embedding is not required, for example:p.set_parameter("FontOutline", "f2=carta.afm");font = p.load_font("f2", "builtin", "");Host font aliases. The font name is related to the name of a host font via the HostFontresource. For example, to replace one of the Latin core fonts (see below) with a host fontinstalled on the system you must configure the font in the HostFont resource category.The following line makes sure that instead of using the built-in core font data, the Symbolfont metrics and outline data will be taken from the host system:p.set_parameter("HostFont", "Symbol=Symbol");font = p.load_font("Symbol", "builtin", "embedding");Latin core fonts. PDF viewers support a core set of 14 fonts which are assumed to be alwaysavailable. Full metrics information for the core fonts is already built into PDFlib sothat no additional data are required (unless the font is to be embedded). The core fontshave the following names:Courier, Courier-Bold, Courier-Oblique, Courier-BoldOblique,Helvetica, Helvetica-Bold, Helvetica-Oblique, Helvetica-BoldOblique,Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic,Symbol, ZapfDingbatsThe following code fragment requests one of the core fonts without any configuration:102 Chapter 5: Font Handling

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

Saved successfully!

Ooh no, something went wrong!