Ejemplo n.º 1
0
        public TextLayout(AttributedCharacterIterator text)
        {
            fullText    = text.GetText();
            trimText    = fullText;
            font        = text.GetFont();
            layout      = font.FontFamily;
            stringColor = text.GetColor();

            int start = text.GetBeginIndex();
            int limit = text.GetEndIndex();

            if (start == limit)
            {
                throw new ArgumentException("Zero length iterator passed to TextLayout constructor.");
            }

            int len = limit - start;

            text.First();
            char[] chars = new char[len];
            int    n     = 0;

            for (char c = text.First(); c != DONE; c = text.Next())
            {
                chars[n++] = c;
            }
            GetGraphicLayout(fullText, text.GetFont());
        }