/// <summary>
        /// Applies a font to the specified Chars of a string.
        /// </summary>
        /// <param name="startIndex">The start index to apply the font to (inclusive).</param>
        /// <param name="endIndex">The end index to apply the font to (exclusive).</param>
        /// <param name="fontIndex">The font to use.</param>
        public void ApplyFont(int startIndex, int endIndex, short fontIndex)
        {
            if (startIndex > endIndex)
                throw new ArgumentException("Start index must be less than end index.");
            if (startIndex < 0 || endIndex > Length)
                throw new ArgumentException("Start and end index not in range.");
            if (startIndex == endIndex)
                return;

            //Need to Check what the font Is currently, so we can reapply it after
            //the range Is completed
            short currentFont = NO_FONT;
            if (endIndex != Length)
            {
                currentFont = this.GetFontAtIndex(startIndex);
            }

            //Need to clear the current formatting between the startIndex and endIndex
            str = CloneStringIfRequired();
            System.Collections.Generic.List<FormatRun> formatting = str.FormatIterator();

            ArrayList deletedFR = new ArrayList();
            if (formatting != null)
            {
                IEnumerator formats = formatting.GetEnumerator();
                while (formats.MoveNext())
                {
                    FormatRun r = (FormatRun)formats.Current;
                    if ((r.CharacterPos >= startIndex) && (r.CharacterPos < endIndex))
                    {
                        deletedFR.Add(r);
                    }
                }
            }
            foreach(FormatRun fr in deletedFR)
            {
                str.RemoveFormatRun(fr);
            }

            str.AddFormatRun(new FormatRun((short)startIndex, fontIndex));
            if (endIndex != Length)
                str.AddFormatRun(new FormatRun((short)endIndex, currentFont));

            AddToSSTIfRequired();
        }