internal override void UpdateRunWidth()
{
Size size;
if (IsLineBreak)
{
size = CalculateDrawingStringSize(emptyline, 1);
glyphPositions = new int[0];
}
else
{
//TODO: review here again
int len = mybuffer.Length;
size = CalculateDrawingStringSize(this.mybuffer, len);
//when we update run width we should store
//cache of each char x-advance?
//or calculate it every time ?
//TODO: review this,
//if we have enough length, -> we don't need to alloc every time.
glyphPositions = new int[len];
TextServices.IFonts.CalculateGlyphAdvancePos(mybuffer, 0, len, GetFont(), glyphPositions);
}
//---------
this.SetSize(size.Width, size.Height);
//---------
MarkHasValidCalculateSize();
}
public override char GetChar(int index)