com.lowagie.text.pdf
Class HyphenationAuto
java.lang.Object
com.lowagie.text.pdf.HyphenationAuto
- HyphenationEvent
public class HyphenationAuto
extends java.lang.Object
Hyphenates words automatically accordingly to the language and country.
The hyphenator engine was taken from FOP and uses the TEX patterns. If a language
is not provided and a TEX pattern for it exists, it can be easily adapted.
- Paulo Soares (psoares@consiste.pt)
HyphenationAuto(String lang, String country, int leftMin, int rightMin) - Creates a new hyphenation instance usable in
Chunk .
|
hyphenator
protected Hyphenator hyphenator
The hyphenator engine.
post
protected String post
The second part of the hyphenated word.
HyphenationAuto
public HyphenationAuto(String lang,
String country,
int leftMin,
int rightMin)
Creates a new hyphenation instance usable in Chunk
.
lang
- the language ("en" for english, for example)country
- the country ("GB" for Great-Britain or "none" for no country, for example)leftMin
- the minimun number of letters before the hyphenrightMin
- the minimun number of letters after the hyphen
getHyphenatedWordPost
public String getHyphenatedWordPost()
Gets the second part of the hyphenated word. Must be called
after getHyphenatedWordPre()
.
- getHyphenatedWordPost in interface HyphenationEvent
- the second part of the hyphenated word
getHyphenatedWordPre
public String getHyphenatedWordPre(String word,
BaseFont font,
float fontSize,
float remainingWidth)
Hyphenates a word and returns the first part of it. To get
the second part of the hyphenated word call getHyphenatedWordPost()
.
- getHyphenatedWordPre in interface HyphenationEvent
word
- the word to hyphenatefont
- the font used by this wordfontSize
- the font size used by this wordremainingWidth
- the width available to fit this word in
- the first part of the hyphenated word including
the hyphen symbol, if any