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.

Requirements for shaping. A font for use with complex script shaping must meet the<br />

following requirements in addition to containing glyphs for the target script:<br />

> It must be a TrueType or OpenType font with GDEF, GSUB, and GPOS feature tables<br />

and correct Unicode mappings appropriate for the target script. As an alternative to<br />

the OpenType tables, for the Arabic and Hebrew scripts, the font may contain glyphs<br />

for the Unicode presentation forms (e.g. Arabic Apple fonts are constructed this<br />

way). In this case internal tables will be used for the shaping process. For Thai text<br />

the font must contain contextual forms according to Microsoft, Apple, or Monotype<br />

Worldtype (e.g. used in some IBM products) conventions for Thai.<br />

> If standard CJK fonts are to be used, the corresponding font file must be available.<br />

> The font must be loaded with encoding=unicode or glyphid.<br />

> The monospace and vertical options of load_font( ) must not be used, and the<br />

readshaping option must not be set to false.<br />

> If the fallbackfonts option of load_font( ) was used, text in a single text run must not<br />

contain glyphs from a fallback font.<br />

6.4.2 Script and Language<br />

Script and language settings play a role the functional aspects listed below. They can be<br />

controlled with the following options:<br />

> The script text option identifies the target script (writing system). It supports the<br />

four-letter keywords listed in Table 6.2. Examples:<br />

script=latn<br />

script=cyrl<br />

script=arab<br />

script=hebr<br />

script=deva<br />

script={lao }<br />

With script=_auto <strong>PDFlib</strong> automatically assigns that script to which the majority of<br />

characters in the text belong. Since Latin text doesn’t require shaping it will not be<br />

counted when determining the script automatically.<br />

You can query the scripts used for some text with the scriptlist keyword of info_<br />

textline( ).<br />

> The language option specifies the natural language in which the text is written. It<br />

supports the three-character keywords listed in Table 6.3. Examples:<br />

language=ARA<br />

language=URD<br />

language=ZHS<br />

language=HIN<br />

Complex script processing. Complex script processing (option shaping) requires the<br />

script option. The language option can additionally be supplied. It controls languagespecific<br />

aspects of shaping, e.g. different figures for Arabic vs. Urdu. However, only few<br />

fonts contain language-specific script shaping tables, so in most cases specifying the<br />

script option will be sufficient, and shaping cannot be improved with the language option.<br />

OpenType layout features. Fonts can implement OpenType layout features in a language-specific<br />

manner (see »Script- and language-specific OpenType layout features«,<br />

6.4 Complex Script Output 165

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

Saved successfully!

Ooh no, something went wrong!