post = word;
String hyphen = getHyphenSymbol();
float hyphenWidth = font.getWidthPoint(hyphen, fontSize);
if (hyphenWidth > remainingWidth)
return "";
Hyphenation hyphenation = hyphenator.hyphenate(word);
if (hyphenation == null) {
return "";
}
int len = hyphenation.length();
int k;
for (k = 0; k < len; ++k) {
if (font.getWidthPoint(hyphenation.getPreHyphenText(k), fontSize) + hyphenWidth > remainingWidth)
break;
}
--k;
if (k < 0)
return "";
post = hyphenation.getPostHyphenText(k);
return hyphenation.getPreHyphenText(k) + hyphen;
}