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.

5.3 Locating, Embedding and Subsetting Fonts5.3.1 Searching for FontsSources of Font Data. PDFlib loads fonts with the function PDF_load_font( ) or appropriatefont options in PDF_fit_textline( ) and PDF_add/create_textflow( ). You can use afont’s native name, or work with arbitrary custom font names which will be used to locatethe font data. Custom font names should be unique within a document. In PDF_info_font( ) this font name can be queried with the apiname key.Subsequent calls to PDF_load_font( ) will return the same font handle if all optionsare identical to those provided in the first call to this function; otherwise a new fonthandle will be created for the same font name. PDFlib supports the following sources offont data:> Disk-based font files> Fonts pulled from the Windows or Mac operating system (host fonts)> PDF standard fonts: these are from a small set of Latin and CJK fonts with wellknownnames> Type 3 fonts which have been defined with PDF_begin_font( ) and related functions> Font data passed by the client directly in memory by means of a PDFlib virtual file(PVF). This is useful for advanced applications which have the font data already loadedinto memory and want to avoid unnecessary disk access by PDFlib (see Section3.1.2, »The PDFlib Virtual File System (PVF)«, page 47 for details on virtual files).The font name supplied to PDFlib is a name string. The choice of font name depends onthe method for locating the font data. PDFlib searches for fonts according to the stepsdescribed below (in the specified order).Cookbook A full code sample can be found in the Cookbook topic fonts/font_resources.Standard CJK fonts. Acrobat supports various standard fonts for CJK text; see Section5.6.1, »Standard CJK Fonts«, page 116, for more details and a list of standard CJK fonts. Ifthe requested font name matches one of the standard CJK fonts the font will be selected,for example:font = p.load_font("KozGoPro-Medium", "90msp-RKSJ-H", "");Type 3 fonts. Type 3 fonts must be defined at runtime by defining its glyphs with standardPDFlib graphics functions (see Section 5.2.3, »User-Defined (Type 3) Fonts«, page99). If the font name supplied to PDF_begin_font( ) matches the font name requestedwith PDF_load_font( ) the font will be selected, for example:font = p.load_font("PDFlibLogoFont", "logoencoding", "");Font outline files. The font name is related to the name of a disk-based or virtual fontoutline file via the FontOutline resource, for example:p.set_parameter("FontOutline", "f1=/usr/fonts/DFHSMincho-W3.ttf");font = p.load_font("f1", "unicode", "");As an alternative to runtime configuration via PDF_set_parameter( ), the FontOutline resourcecan be configured in a UPR file (see Section 3.1.3, »Resource Configuration andFile Searching«, page 48). In order to avoid absolute file names you can use the Search-5.3 Locating, Embedding and Subsetting Fonts 101

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

Saved successfully!

Ooh no, something went wrong!