Package com.itextpdf.layout.hyphenation
Class HyphenationConfig
- java.lang.Object
-
- com.itextpdf.layout.hyphenation.HyphenationConfig
-
public class HyphenationConfig extends java.lang.Object
This is the class used to configure hyphenation on layout level
-
-
Field Summary
Fields Modifier and Type Field Description protected Hyphenator
hyphenator
The Hyphenator object.protected char
hyphenSymbol
The hyphenation symbol used when hyphenating.
-
Constructor Summary
Constructors Constructor Description HyphenationConfig(int leftMin, int rightMin)
Constructs a newHyphenationConfig
.HyphenationConfig(Hyphenator hyphenator)
Constructs a newHyphenationConfig
by aHyphenator
which will be used to find hyphenation points.HyphenationConfig(java.lang.String lang, java.lang.String country, int leftMin, int rightMin)
Constructs a newHyphenationConfig
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description char
getHyphenSymbol()
Gets the hyphenation symbol.Hyphenation
hyphenate(java.lang.String word)
Hyphenates a given word.void
setHyphenSymbol(char hyphenSymbol)
Sets the hyphenation symbol to the specified value.
-
-
-
Field Detail
-
hyphenator
protected Hyphenator hyphenator
The Hyphenator object.
-
hyphenSymbol
protected char hyphenSymbol
The hyphenation symbol used when hyphenating.
-
-
Constructor Detail
-
HyphenationConfig
public HyphenationConfig(int leftMin, int rightMin)
Constructs a newHyphenationConfig
. No language hyphenation files will be used. Only soft hyphen symbols ('') will be taken into account.- Parameters:
leftMin
- the minimum number of characters before the hyphenation pointrightMin
- the minimum number of characters after the hyphenation point
-
HyphenationConfig
public HyphenationConfig(Hyphenator hyphenator)
Constructs a newHyphenationConfig
by aHyphenator
which will be used to find hyphenation points.- Parameters:
hyphenator
- theHyphenator
instance
-
HyphenationConfig
public HyphenationConfig(java.lang.String lang, java.lang.String country, int leftMin, int rightMin)
Constructs a newHyphenationConfig
instance.- Parameters:
lang
- the languagecountry
- the optional country code (may be null or "none")leftMin
- the minimum number of characters before the hyphenation pointrightMin
- the minimum number of characters after the hyphenation point
-
-
Method Detail
-
hyphenate
public Hyphenation hyphenate(java.lang.String word)
Hyphenates a given word.- Parameters:
word
- Tee word to hyphenate- Returns:
Hyphenation
object representing possible hyphenation points ornull
if no hyphenation points are found.
-
getHyphenSymbol
public char getHyphenSymbol()
Gets the hyphenation symbol.- Returns:
- the hyphenation symbol
-
setHyphenSymbol
public void setHyphenSymbol(char hyphenSymbol)
Sets the hyphenation symbol to the specified value.- Parameters:
hyphenSymbol
- the new hyphenation symbol
-
-