this.flags = DIRECTION_DEFAULT_LEFT_TO_RIGHT;
// Likewise this attribute should be specified on the whole text.
// We read it here and then, if it is set, we apply the numeric shaper
// to the text before processing it.
NumericShaper shaper = null;
val = iter.getAttribute(TextAttribute.NUMERIC_SHAPING);
if (val instanceof NumericShaper)
shaper = (NumericShaper) val;
text = new char[iter.getEndIndex() - iter.getBeginIndex()];
this.embeddings = new byte[this.text.length];
this.embeddingOffset = 0;
this.length = text.length;
for (int i = 0; i < this.text.length; ++i)
{
this.text[i] = iter.current();
val = iter.getAttribute(TextAttribute.BIDI_EMBEDDING);
if (val instanceof Integer)
{
int ival = ((Integer) val).intValue();
byte bval;
if (ival < -62 || ival > 62)
bval = 0;
else
bval = (byte) ival;
this.embeddings[i] = bval;
}
}
// Invoke the numeric shaper, if specified.
if (shaper != null)
shaper.shape(this.text, 0, this.length);
runBidi();
}