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

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

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

loading option list for the fallbackfonts option to add a user-defined (gaiji) character<br />

from an EUDC font to the loaded font:<br />

fallbackfonts={<br />

{fontname=EUDC encoding=unicode forcechars=U+E000 fontsize=140% textrise=-20%}<br />

}<br />

Once a base font has been loaded with this fallback font configuration, the EUDC character<br />

can be used within the text without any need to change the font.<br />

With SING fonts the Unicode value doesn’t have to be supplied since it will automatically<br />

be determined by <strong>PDFlib</strong>:<br />

fallbackfonts={<br />

{fontname=<strong>PDFlib</strong>Wing encoding=unicode forcechars=gaiji}<br />

}<br />

Preparing EUDC fonts. You can use the EUDC editor available in <strong>Windows</strong> to create<br />

custom characters for use with <strong>PDFlib</strong>. Proceed as follows:<br />

> Use the eudcedit.exe to create one or more custom characters at the desired Unicode<br />

position(s).<br />

> Locate the EUDC.TTE file in the directory \<strong>Windows</strong>\fonts and copy it to some other directory.<br />

Since this file is invisible in <strong>Windows</strong> Explorer use the dir and copy commands<br />

in a DOS box to find the file. Now configure the font for use with <strong>PDFlib</strong>, using<br />

one of the methods discussed in (see Section 5.4.4, »Searching for Fonts«, page<br />

132):<br />

p.set_parameter("FontOutline", "EUDC=EUDC.TTE");<br />

p.set_parameter("SearchPath", "...directory name...");<br />

or place EUDC.TTE in the current directory.<br />

As an alternative to this explicit font file configuration you can use the following<br />

function call to configure the font file directly from the <strong>Windows</strong> directory. This way<br />

you will always access the current EUDC font used in <strong>Windows</strong>:<br />

p.set_parameter("FontOutline", "EUDC=C:\<strong>Windows</strong>\fonts\EUDC.TTE");<br />

> Integrate the EUDC font into any base font using the fallbackfonts option as described<br />

above. If you want to access the font directly, use the following call to load<br />

the font in <strong>PDFlib</strong>:<br />

font = p.load_font("EUDC", "unicode", "");<br />

as usual and supply the Unicode value(s) chosen in the first step to output the characters.<br />

6.5.4 OpenType Layout Features for advanced CJK Text Output<br />

As detailed in Section 6.3, »OpenType Layout Features«, page 158, <strong>PDFlib</strong> supports advanced<br />

typographic layout tables in OpenType and TrueType fonts. For example, Open-<br />

Type features can be used to select alternative forms of the Latin glyphs with proportional<br />

widths or half widths, or to select alternate character forms. Table 6.7 lists<br />

OpenType features which are targeted at CJK text output.<br />

174 Chapter 6: Text Output (Edition for <strong>COM</strong>, .<strong>NET</strong>, and REALbasic)

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

Saved successfully!

Ooh no, something went wrong!