// isn't met we are SOL.
float [] pts = new float[6];
int count = 0;
int type = -1;
PathIterator pi = gbounds.getPathIterator(null);
Point2D.Float firstPt = null;
if (isVertical()) {
if (glyphOrientationAuto) {
if (isLatinChar(ch))
glyphOrientationAngle = 90;
else
glyphOrientationAngle = 0;
}
}
while (!pi.isDone()) {
type = pi.currentSegment(pts);
if ((type == PathIterator.SEG_MOVETO) ||
(type == PathIterator.SEG_LINETO)) {
// LINETO or MOVETO
if (count > 4) break; // too many lines...
if (count == 4) {
// make sure we are just closing it..
if ((firstPt == null) ||
(firstPt.x != pts[0]) ||
(firstPt.y != pts[1]))
break;
} else {
Point2D.Float pt;
pt = new Point2D.Float(pts[0], pts[1]);
if (count == 0) firstPt = pt;
// Use sides of rectangle...
switch (count) {
case 0: botPts[ptIdx] = pt; break;
case 1: topPts[ptIdx] = pt; break;
case 2: topPts[ptIdx+1] = pt; break;
case 3: botPts[ptIdx+1] = pt; break;
}
}
} else if (type == PathIterator.SEG_CLOSE) {
// Close in the wrong spot?
if ((count < 4) || (count > 5)) break;
} else {
// QUADTO or CUBETO
break;
}
count++;
pi.next();
}
if (pi.isDone()) {
// Sucessfully Expressed as a quadralateral...
if ((botPts[ptIdx]!=null) &&
((topPts[ptIdx].x != topPts[ptIdx+1].x) ||
(topPts[ptIdx].y != topPts[ptIdx+1].y)))
// box isn't empty so use it's points...