aciIdx = aci.getBeginIndex();
int aciEnd = aci.getEndIndex();
char ch = aci.setIndex(aciIdx);
int aciWordStart = aciIdx;
GVTFont gvtFont = (GVTFont)aci.getAttribute(GVT_FONT);
float lineHeight = 1.0f;
Float lineHeightFloat = (Float)aci.getAttribute(LINE_HEIGHT);
if (lineHeightFloat != null)
lineHeight = lineHeightFloat.floatValue();
int runLimit = aci.getRunLimit(szAtts);
WordInfo prevWI = null;
float [] lastAdvAdj = new float [numGlyphs];
float [] advAdj = new float [numGlyphs];
boolean [] hideLast = new boolean[numGlyphs];
boolean [] hide = new boolean[numGlyphs];
boolean [] space = new boolean[numGlyphs];
float [] glyphPos = gv.getGlyphPositions(0, numGlyphs+1, null);
for (int i=0; i<numGlyphs; i++) {
char pch = ch;
ch = aci.setIndex(aciIdx);
Integer integer = (Integer)aci.getAttribute(WORD_LIMIT);
WordInfo theWI = cWordMap[integer.intValue()-numWords];
if (theWI.getFlowLine() == null)
theWI.setFlowLine(aci.getAttribute(FLOW_LINE_BREAK));
if (prevWI == null) {
prevWI = theWI;
} else if (prevWI != theWI) {
GVTLineMetrics lm = gvtFont.getLineMetrics
(aci, aciWordStart, aciIdx, frc);
prevWI.addLineMetrics(gvtFont, lm);
prevWI.addLineHeight(lineHeight);
aciWordStart = aciIdx;
prevWI = theWI;
}
int chCnt = gv.getCharacterCount(i,i);
if (chCnt == 1) {
char nch;
float kern;
switch(ch) {
case SOFT_HYPHEN:
hideLast[i] = true;
nch = aci.next(); aci.previous();
kern = gvtFont.getHKern(pch, nch);
advAdj[i] = -(glyphPos[2*i+2]-glyphPos[2*i]+kern);
break;
case ZERO_WIDTH_JOINER:
hide[i] = true;
break;
case ZERO_WIDTH_SPACE:
hide[i] = true;
break;
case SPACE:
space[i] = true;
nch = aci.next(); aci.previous();
kern = gvtFont.getHKern(pch, nch);
lastAdvAdj[i] = -(glyphPos[2*i+2]-glyphPos[2*i]+kern);
default:
}
}
aciIdx += chCnt;
if ((aciIdx > runLimit) && (aciIdx < aciEnd)) {
// Possible font size/style change so record current
// line metrics and start fresh.
GVTLineMetrics lm = gvtFont.getLineMetrics
(aci,aciWordStart, runLimit, frc);
prevWI.addLineMetrics(gvtFont, lm);
prevWI.addLineHeight(lineHeight);
prevWI = null;
aciWordStart = aciIdx;
aci.setIndex(aciIdx);
gvtFont = (GVTFont)aci.getAttribute(GVT_FONT);
Float f = (Float)aci.getAttribute(LINE_HEIGHT);
lineHeight = f.floatValue();
runLimit = aci.getRunLimit(szAtts);
}
}
GVTLineMetrics lm = gvtFont.getLineMetrics
(aci,aciWordStart, runLimit, frc);
prevWI.addLineMetrics(gvtFont, lm);
prevWI.addLineHeight(lineHeight);
int [] wordGlyphCounts = new int[words];