PDFlib 8 Windows COM/.NET Tutorial
PDFlib 8 Windows COM/.NET Tutorial
PDFlib 8 Windows COM/.NET Tutorial
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
8.2.8 Controlling the standard Linebreak Algorithm<br />
<strong>PDFlib</strong> implements a sophisticated line-breaking algorithm. Table 8.2 lists Textflow options<br />
which control the line-breaking algorithm.<br />
Line-breaking rules. When a word or other sequence of text surrounded by space characters<br />
doesn’t fully fit into a line, it must be moved to the next line. In this situation the<br />
line-breaking algorithm decides after which characters a line break is possible.<br />
For example, a formula such as -12+235/8*45 will never be broken, while the string<br />
PDF-345+LIBRARY may be broken to the next line at the minus character. If the text<br />
contains soft hyphen characters it can also be broken after such a character.<br />
For parentheses and quotation marks it depends on whether we have an opening or<br />
closing character: opening parentheses and quotations marks do not offer any break<br />
opportunity. In order to find out whether a quotation mark starts or ends a sequence,<br />
pairs of quotation marks are examined.<br />
Table 8.2 Options for controlling the line-breaking algorithm<br />
option<br />
adjustmethod<br />
advancedlinebreak<br />
avoidbreak<br />
charclass<br />
hyphenchar<br />
explanation<br />
(Keyword) The method used to adjust a line when a text portion doesn’t fit into a line after compressing<br />
or expanding the distance between words subject to the limits specified by the minspacing and maxspacing<br />
options. Default: auto<br />
auto The following methods are applied in order: shrink, spread, nofit, split.<br />
clip<br />
nofit<br />
shrink<br />
split<br />
spread<br />
Same as nofit (see below), except that the long part at the right edge of the fitbox (taking<br />
into account the rightindent option) will be clipped.<br />
The last word will be moved to the next line provided the remaining (short) line will not be<br />
shorter than the percentage specified in the nofitlimit option. Even justified paragraphs<br />
will look slightly ragged in this case.<br />
If a word doesn’t fit in the line the text will be compressed subject to the shrinklimit option<br />
until the word fits. If it still doesn’t fit the nofit method will be applied.<br />
The last word will not be moved to the next line, but will forcefully be hyphenated. For text<br />
fonts a hyphen character will be inserted, but not for symbol fonts.<br />
The last word will be moved to the next line and the remaining (short) line will be justified by<br />
increasing the distance between characters in a word, subject to the spreadlimit option. If<br />
justification still cannot be achieved the nofit method will be applied.<br />
(Boolean) Enable the advanced line breaking algorithm which is required for complex scripts. This is required<br />
for linebreaking in scripts which do not use space characters for designating word boundaries, e.g.<br />
Thai. The options locale and script will be honored. Default: false<br />
(Boolean) If true, avoid any line breaks until avoidbreak is reset to false. Default: false<br />
(List of pairs, where the first element in each pair is a keyword, and the second element is either a unichar<br />
or a list of unichars) The specified unichars will be classified by the specified keyword to determine the<br />
line breaking behaviour of those character(s):<br />
letter behave like a letter (e.g. a B)<br />
punct behave like a punctuation character (e.g. + / ; : )<br />
open behave like an open parenthesis (e.g. [ )<br />
close behave like a close parenthesis (e.g. ] )<br />
default reset all character classes to <strong>PDFlib</strong>’s builtin defaults<br />
Example: charclass={ close » open « letter {/ : =} punct & }<br />
(Unichar or keyword) Unicode value of the character which replaces a soft hyphen at line breaks. The value<br />
0 and the keyword none completely suppress hyphens. Default: U+00AD (SOFT HYPHEN) if available<br />
in the font, U+002D (HYPHEN-MINUS) otherwise<br />
8.2 Multi-Line Textflows 219