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

Create successful ePaper yourself

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

Examples:<br />

&linefeed;<br />

&hortab;<br />

&ZWNJ;<br />

U+000A linefeed control character<br />

U+0009 horizontal tab<br />

U+200C ZERO WIDTH NON-JOINER<br />

Glyph name references. Glyph names are drawn from the following sources:<br />

> Common glyph names will be searched in an internal list<br />

> Font-specific glyph names are searched in the current font. Character references of<br />

this class work only with content strings since they always require a font.<br />

In order to identify glyph name references the actual name requires a period character<br />

’.’ after the ampersand character ’&’. Examples:<br />

&.three; U+0033 common glyph name for the digit 3<br />

&.mapleleaf; (PUA unicode value) custom glyph name from Carta font<br />

&.T.swash;<br />

(PUA unicode value) second period character is part of the glyph name<br />

Character references with glyph names are useful in the following scenarios:<br />

> Character references with font-specific glyph names are useful in contents strings to<br />

select alternate character forms (e.g. swash characters) and glyphs without any specific<br />

Unicode semantics (symbols, icons, and ornaments). Note that tabular figures<br />

and many other features are more easily implemented with OpenType features (see<br />

Section 6.3, »OpenType Layout Features«, page 158).<br />

> Names from the Adobe Glyph List (including the uniXXXX and u1XXXX forms) plus<br />

certain common »misnamed« glyph names will always be accepted for content<br />

strings and hypertext strings.<br />

Byte value references. Numerical values can also be supplied in character references<br />

which may be useful for addressing the glyphs in a symbol font. This variant requires<br />

an additional hash character ’#’ and a decimal or hexadecimal number, where hexadecimal<br />

numbers are introduced with a lower- or uppercase ’X’ character. Example (assuming<br />

the Wingdings font):<br />

&.#x9F;<br />

&.#159;<br />

bullet symbol in Wingdings font<br />

bullet symbol in Wingdings font<br />

Using character references. Character references will not be substituted by default;<br />

you must explicitly set the charref parameter or option to true in order to use character<br />

references in content strings, for example:<br />

p.set_parameter("charref", "true");<br />

font = p.load_font("Helvetica", "winansi", "");<br />

if (font == -1) { ... }<br />

p.setfont(font, 24);<br />

p.show_xy("Price: 500&euro;", 50, 500);<br />

Additional notes on using character references:<br />

> Character references can be used in all content strings, hypertext strings, and name<br />

strings. As an exception, font-specific glyph name references work only with contents<br />

strings as noted above.<br />

> Character references are not substituted in text with builtin encoding. However, you<br />

can use character references for symbolic fonts by using unicode encoding.<br />

110 Chapter 4: Unicode and Legacy Encodings (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!