Exemple #1
0
        private static void DrawText(string text)
        {
            FontFamily      fam    = SixLabors.Fonts.SystemFonts.Find("Arial");
            Font            font   = new Font(fam, 30);
            RendererOptions style  = new RendererOptions(font, 72);
            IPathCollection glyphs = SixLabors.Shapes.TextBuilder.GenerateGlyphs(text, style);

            glyphs.SaveImage("Text", text + ".png");
        }
Exemple #2
0
        private static void DrawText(string text)
        {
            FontFamily      fam         = SystemFonts.Get("Arial");
            var             font        = new Font(fam, 30);
            TextOptions     textOptions = new(font);
            IPathCollection glyphs      = TextBuilder.GenerateGlyphs(text, textOptions);

            glyphs.SaveImage("Text", text + ".png");
        }
Exemple #3
0
        private static void DrawText(string text, IPath path)
        {
            FontFamily      fam   = SixLabors.Fonts.SystemFonts.Find("Arial");
            Font            font  = new Font(fam, 30);
            RendererOptions style = new RendererOptions(font, 72)
            {
                WrappingWidth       = path.Length,
                VerticalAlignment   = VerticalAlignment.Top,
                HorizontalAlignment = HorizontalAlignment.Center
            };
            IPathCollection glyphs = SixLabors.Shapes.TextBuilder.GenerateGlyphs(text, path, style);

            glyphs.SaveImage("Text-Path", text + ".png");
        }
Exemple #4
0
        private static void DrawText(string text, IPath path)
        {
            FontFamily  fam         = SystemFonts.Get("Arial");
            var         font        = new Font(fam, 30);
            TextOptions textOptions = new(font)
            {
                WrappingLength      = path.ComputeLength(),
                VerticalAlignment   = VerticalAlignment.Top,
                HorizontalAlignment = HorizontalAlignment.Center,
            };
            IPathCollection glyphs = TextBuilder.GenerateGlyphs(text, path, textOptions);

            glyphs.SaveImage("Text-Path", text + ".png");
        }