public static int addText(BlockArea ba, FontState fontState, float red, float green,
float blue, int wrapOption, LinkSet ls,
int whiteSpaceCollapse, char data[], int start, int end,
TextState textState, int vAlign) {
if (fontState.getFontVariant() == FontVariant.SMALL_CAPS) {
FontState smallCapsFontState;
try {
int smallCapsFontHeight = (int) (((double) fontState.getFontSize()) * 0.8d);
smallCapsFontState = new FontState(
fontState.getFontInfo(),
fontState.getFontFamily(),
fontState.getFontStyle(),
fontState.getFontWeight(),
smallCapsFontHeight,
FontVariant.NORMAL);
} catch (FOPException ex) {
smallCapsFontState = fontState;
MessageHandler.errorln("Error creating small-caps FontState: " + ex.getMessage());
}
// parse text for upper/lower case and call addRealText
char c;
boolean isLowerCase;
int caseStart;
FontState fontStateToUse;
for (int i = start; i < end; ) {
caseStart = i;
c = data[i];
isLowerCase = (java.lang.Character.isLetter(c) && java.lang.Character.isLowerCase(c));
while (isLowerCase == (java.lang.Character.isLetter(c) && java.lang.Character.isLowerCase(c))) {