Exemplo n.º 1
0
        public void DrawText(Font font, SolidBrush b, float x, float y, string text)
        {
            var fontHandler = font.Handler as FontHandler;

            if (fontHandler != null)
            {
                var brush         = b.ToWpf();
                var formattedText = new swm.FormattedText(text, CultureInfo.CurrentUICulture, sw.FlowDirection.LeftToRight, fontHandler.WpfTypeface, fontHandler.PixelSize, brush);
                if (fontHandler.WpfTextDecorations != null)
                {
                    formattedText.SetTextDecorations(fontHandler.WpfTextDecorations, 0, text.Length);
                }
                Control.DrawText(formattedText, new sw.Point(x, y));
            }
        }