Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Drawing Italic / Different font text

$
0
0
Found a workaround. You can't make any arbitrary font bold or italic and you can't use DrawableFont at all. but just using the Font and FontPointsize properties works as long as you format the font name like ImageMagick expects:
using (var working = new MagickImage(@"c:\temp\filename.jpg"))
{
    // Draw text
    working.StrokeColor = new MagickColor("#FFFFFF");
    working.FillColor = working.StrokeColor;
    working.Font = "Arial-Bold-Italic";
    working.FontPointsize = 24f;

    var metrics = working.FontTypeMetrics("Why hello there!");
    using (var piText = new DrawableText(10, working.Height - metrics.TextHeight - 10, "Why hello there!"))
    {
            working.Draw(piText);
    }
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>