//--------------------------------------------------------------------------- public void Trim(SpriteFont font) { if (Texts.Count > 0) { TextSegment first = Texts.First(); first.Text = first.Text.TrimStart(' '); TextSegment last = Texts.Last(); last.Text = last.Text.TrimEnd(' '); } Width = Texts.Sum(text => text.GetWidth(font)); }