Exemplo n.º 1
0
        public void VisitTextSlide(TextSlide textSlide)
        {
            string text = textSlide.Text;

            Console.WriteLine("Processing text: {0}", text);
            ColBlock block = new ColBlock();

            for (int j = 0; j < text.Length; j++)
            {
                char c = text[j];
                if (c == ' ')
                {
                    block.AddWhiteSpace(4, true);
                }
                else
                {
                    block.AddCharBitmap(_font.getCharBitmap(c), true);
                }
            }

            int colLeft = _width - block.Size;

            Trace.Assert(colLeft >= 0, string.Format("Text does not fit in {0} columns: {1}", _width, text));
            int before = 0, after = 0;

            switch (textSlide.TextAlignment)
            {
            case TextSlide.Alignment.Center:
                before = colLeft / 2;
                after  = colLeft - (colLeft / 2);
                break;

            case TextSlide.Alignment.Left:
                before = 0;
                after  = colLeft;
                break;

            case TextSlide.Alignment.Right:
                before = colLeft;
                after  = 0;
                break;
            }

            for (int j = 0; j < before; j++)
            {
                StringizedColumn(ColBlock.OffCol);
            }

            block.getCols(StringizedColumn);

            for (int j = 0; j < after; j++)
            {
                StringizedColumn(ColBlock.OffCol);
            }

            RecordStringizedBitmap();
        }
Exemplo n.º 2
0
 public void VisitTextSlide(TextSlide textSlide)
 {
     _names[_stringIdx++] = new string(textSlide.Text.Reverse().ToArray());
 }