Double Outline

Text Formatted Text Drawing

Demonstrates how to draw a text with double outline.

Сode Snippet

var bgColor = new RgbColor(23, 42, 88);
var fillColor = new RgbColor(254, 190, 16);

using (var bitmap = new Bitmap(600, 250, PixelFormat.Format24bppRgb, bgColor))
using (var fr = new CustomFontRegistry())
using (var gr = bitmap.GetAdvancedGraphics())
{
    var psName = fr.Add("Jost-Regular.ttf");

    gr.FontRegistry = fr;

    var text = new PlainText("WOW", gr.CreateFont(psName, 190))
    {
        Position = new System.Drawing.PointF(10, 220),
    };

    text.Brush = null;
    text.Pen = new Pen(RgbColor.White, 15);
    text.Pen.LineJoin = Aurigma.GraphicsMill.AdvancedDrawing.LineJoin.Round;

    gr.DrawText(text);

    text.Brush = new SolidBrush(fillColor);
    text.Pen = new Pen(bgColor, 5);
    text.Pen.LineJoin = Aurigma.GraphicsMill.AdvancedDrawing.LineJoin.Round;

    gr.DrawText(text);

    bitmap.Save("DoubleOutline.png");
}

Input

Jost-Regular.ttf

Download

Output

DoubleOutline.png

For AI-assisted development: Download Graphics Mill Code Samples XML Catalog