Package com.lowagie.text.pdf.hyphenation
Class Hyphenator
java.lang.Object
com.lowagie.text.pdf.hyphenation.Hyphenator
This class is the main entry point to the hyphenation package. You can use only the static methods or create an
instance.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static String
Holds value of property hyphenDir.private HyphenationTree
private static Map
<String, HyphenationTree> TODO: Don't use staticsprivate int
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HyphenationTree
static HyphenationTree
getHyphenationTree
(String lang, String country) static String
Getter for property hyphenDir.private static File
getHyphenFile
(String key) static HyphenationTree
hyphenate
(char[] word, int offset, int len) static Hyphenation
static Hyphenation
private static InputStream
static void
setHyphenDir
(String _hyphenDir) Setter for property hyphenDir.void
setLanguage
(String lang, String country) void
setMinPushCharCount
(int min) void
setMinRemainCharCount
(int min)
-
Field Details
-
defaultHyphLocation
- See Also:
-
hyphenTrees
TODO: Don't use statics -
hyphenDir
Holds value of property hyphenDir. -
hyphenTree
-
remainCharCount
private int remainCharCount -
pushCharCount
private int pushCharCount
-
-
Constructor Details
-
Hyphenator
- Parameters:
lang
- The languagecountry
- the CountryleftMin
- The minimum letters on the leftrightMin
- The minimum letters on the right
-
-
Method Details
-
getHyphenationTree
- Parameters:
lang
- The languagecountry
- The country- Returns:
- the hyphenation tree
-
getResourceHyphenationTree
- Parameters:
key
- A String of the key of the hyphenation tree- Returns:
- a hyphenation tree
-
readHyphenationFile
-
getFileHyphenationTree
- Parameters:
key
- The language to get the tree from- Returns:
- a hyphenation tree or null
-
getHyphenFile
-
hyphenate
public static Hyphenation hyphenate(String lang, String country, String word, int leftMin, int rightMin) - Parameters:
lang
- The languagecountry
- The countryword
- char array containing the wordleftMin
- Minimum number of characters allowed before the hyphenation pointrightMin
- Minimum number of characters allowed after the hyphenation point- Returns:
- a hyphenation object
-
hyphenate
public static Hyphenation hyphenate(String lang, String country, char[] word, int offset, int len, int leftMin, int rightMin) - Parameters:
lang
- The languagecountry
- The countryword
- char array that contains the word to hyphenateoffset
- Offset to the first character in wordlen
- The length of the wordleftMin
- Minimum number of characters allowed before the hyphenation pointrightMin
- Minimum number of characters allowed after the hyphenation point- Returns:
- a hyphenation object
-
getHyphenDir
Getter for property hyphenDir.- Returns:
- Value of property hyphenDir.
-
setHyphenDir
Setter for property hyphenDir.- Parameters:
_hyphenDir
- New value of property hyphenDir.
-
setMinRemainCharCount
public void setMinRemainCharCount(int min) - Parameters:
min
- Minimum number of characters allowed before the hyphenation point
-
setMinPushCharCount
public void setMinPushCharCount(int min) - Parameters:
min
- Minimum number of characters allowed after the hyphenation point
-
setLanguage
- Parameters:
lang
- The languagecountry
- The country
-
hyphenate
- Parameters:
word
- Char array that contains the wordoffset
- Offset to the first character in wordlen
- Length of the word- Returns:
- a hyphenation object
-
hyphenate
- Parameters:
word
- The word to hyphenate- Returns:
- a hyphenation object
-