22.03.2015 Views

DLI Implementation and Reference Guide - Datalogics

DLI Implementation and Reference Guide - Datalogics

DLI Implementation and Reference Guide - Datalogics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />

array be allocated to hold a sufficient number of entries to prevent this. In practice,<br />

a dozen ASAtom entries should be sufficient.<br />

Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />

The dlpdfttload function returns the number of fonts loaded from the font file.<br />

An exception may be raised for invalid parameters, if the font file could not be<br />

opened, or if there was a problem invoking the font loader.<br />

NOTE: If a given font file has already been loaded, dlpdfttload returns a -1,<br />

<strong>and</strong> does not re-parse the font file (for performance reasons).<br />

Once loaded, the font may then be created using the dlpdffontcreate calls (see<br />

“Font Creation Calls” on page 4.6). The easiest means of creating the DLPDFFONT<br />

structure is to call dlpdffontcreateembedded, supplying the DLPDFDOC in which<br />

to use the font, the name of the font loaded (use the ASAtomGetString call to<br />

obtain a C-string representation of the font name), <strong>and</strong> a NULL or "Type0" for the<br />

third parameter. The fourth parameter must be True, since it is illegal to embed<br />

Type0 fonts without subsetting.<br />

Because the DLPDFINSTANCE font cache is searched for fonts before the system is<br />

searched, a font loaded with dlpdfttload will be found before the system is<br />

examined, unless a more specific font creation call is used. If both single-byte <strong>and</strong><br />

multibyte versions of a font are required for a <strong>DLI</strong> document, use the<br />

dlpdffontcreatewithmetrics calls, specifying Type0 as the font type for<br />

multibyte fonts, <strong>and</strong> either Type1 or TrueType as appropriate for the single-byte<br />

font.<br />

An easier alternative is to create the single-byte versions of the required fonts before<br />

loading the fonts into the DLPDFINSTANCE. However, it is recommended that you<br />

use the multibyte font for all text output if possible, to ensure optimal PDF file<br />

viewing performance <strong>and</strong> file size.

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

Saved successfully!

Ooh no, something went wrong!