public abstract static class WordBreakers.AbstractWordBreaker extends Object implements WordBreaker
| Constructor and Description |
|---|
AbstractWordBreaker() |
| Modifier and Type | Method and Description |
|---|---|
Pair<String> |
breakWord(String word,
FontDescriptor fontDescriptor,
float maxWidth,
boolean breakHardIfNecessary)
Breaks the word in order to fit the given maximum width.
|
protected Pair<String> |
breakWordHard(String word,
FontDescriptor fontDescriptor,
float maxWidth)
Breaks the word hard at the outermost position that fits the given
max width.
|
protected abstract Pair<String> |
breakWordSoft(String word,
FontDescriptor fontDescriptor,
float maxWidth)
To be implemented by subclasses.
|
public Pair<String> breakWord(String word, FontDescriptor fontDescriptor, float maxWidth, boolean breakHardIfNecessary) throws IOException
WordBreakerbreakWord in interface WordBreakerword - the word to break.fontDescriptor - describing the font's type and size.maxWidth - the maximum width to obey.breakHardIfNecessary - indicates if the word should be broken hard to fit the width,
in case there is no suitable position for breaking it
adequately.null if it cannot be broken.IOException - by pdfboxprotected abstract Pair<String> breakWordSoft(String word, FontDescriptor fontDescriptor, float maxWidth) throws IOException
null.word - the word to break.fontDescriptor - describing the font's type and size.maxWidth - the maximum width to obey.null if it cannot be broken.IOException - by pdfboxprotected Pair<String> breakWordHard(String word, FontDescriptor fontDescriptor, float maxWidth) throws IOException
word - the word to break.fontDescriptor - describing the font's type and size.maxWidth - the maximum width to obey.null if it cannot be broken.IOException - by pdfboxCopyright © 2021. All rights reserved.