private void AddToLine(PdfChunk chunk)
{
if (chunk.ChangeLeading)
{
float f;
if (chunk.IsImage())
{
Image img = chunk.Image;
f = chunk.ImageHeight + chunk.ImageOffsetY
+ img.BorderWidthTop + img.SpacingBefore;
}
else
{
f = chunk.Leading;
}
if (f > height)
{
height = f;
}
}
if (tabStop != null && tabStop.Align == TabStop.Alignment.ANCHOR && float.IsNaN(tabStopAnchorPosition))
{
String value = chunk.ToString();
int anchorIndex = value.IndexOf(tabStop.AnchorChar);
if (anchorIndex != -1)
{
float subWidth = chunk.Width(value.Substring(anchorIndex));
tabStopAnchorPosition = originalWidth - width - subWidth;
}
}
line.Add(chunk);
}