Esempio n. 1
0
        public override void Render(GraphicsContext g)
        {
            PaintBackground(g, Background);

            if (Foreground == null || string.IsNullOrWhiteSpace(Text))
            {
                return;
            }

            Foreground.ApplyBrushToContext(g);
            g.SelectFontFace(FontFamily, FontSlant, FontWeight);
            g.SetFontSize(FontSize);
            TextExtents te = g.TextExtents(Text);

            g.MoveTo(te.XBearing * -1 + Padding.Left, te.YBearing * -1 + Padding.Top);
            g.ShowText(Text);
        }