Package com.itextpdf.layout.hyphenation
Class HyphenationConfig
java.lang.Object
com.itextpdf.layout.hyphenation.HyphenationConfig
This is the class used to configure hyphenation on layout level
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HyphenatorThe Hyphenator object.protected charThe hyphenation symbol used when hyphenating. -
Constructor Summary
ConstructorsConstructorDescriptionHyphenationConfig(int leftMin, int rightMin) Constructs a newHyphenationConfig.HyphenationConfig(Hyphenator hyphenator) Constructs a newHyphenationConfigby aHyphenatorwhich will be used to find hyphenation points.HyphenationConfig(String lang, String country, int leftMin, int rightMin) Constructs a newHyphenationConfiginstance. -
Method Summary
Modifier and TypeMethodDescriptioncharGets the hyphenation symbol.Hyphenates a given word.voidsetHyphenSymbol(char hyphenSymbol) Sets the hyphenation symbol to the specified value.
-
Field Details
-
hyphenator
The Hyphenator object. -
hyphenSymbol
protected char hyphenSymbolThe hyphenation symbol used when hyphenating.
-
-
Constructor Details
-
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 point -
rightMin- the minimum number of characters after the hyphenation point
-
HyphenationConfig
Constructs a newHyphenationConfigby aHyphenatorwhich will be used to find hyphenation points.- Parameters:
-
hyphenator- theHyphenatorinstance
-
HyphenationConfig
Constructs a newHyphenationConfiginstance.- Parameters:
-
lang- the language -
country- the optional country code (may be null or "none") -
leftMin- the minimum number of characters before the hyphenation point -
rightMin- the minimum number of characters after the hyphenation point
-
-
Method Details
-
hyphenate
Hyphenates a given word.- Parameters:
-
word- Tee word to hyphenate - Returns:
-
Hyphenationobject representing possible hyphenation points ornullif 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
-