* TODO: This is not quite right yet. If the current word starts at
* the beginning of the text being considered, we need to look
* backward at any text in the same LineText item, and then to prior
* LineText items to find the beginning of the word.
*/
final HyphenationServer server =
this.getTextServer().getHyphenationServer();
final Language language = this.currentLineText.inlineLanguage();
final Country country = this.currentLineText.inlineCountry();
// Count the number of chars at the beginning that should be ignored.
final int actualWordStart = server.wordStarts(this.currentChars,
this.wordStart, language, country);
if (actualWordStart < 0) {
return this.wordStart;
}
final int nonWordChars = actualWordStart - this.wordStart;
// Extract the word that should be evaluated by the hyphenation system.
final int wordSize = server.wordSize(this.currentChars, actualWordStart,
language, country);
// See if there are discretionary hyphenation points.
Hyphenation hyph = null;
try {
hyph = server.hyphenate(this.currentChars, actualWordStart,
wordSize, language, country,
this.currentLineText.inlineHyphenationRemainCount(),
this.currentLineText.inlineHyphenationPushCount(), false);
} catch (final HyphenationException e) {
/* Log the exception and continue. */