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

New Post: Custom font from file.

$
0
0
It seems you can just specify the font with the file name. I was unaware that this was possible. The following code will use your font and draws some text on the image:
using (MagickImage image = new MagickImage("einsteinshow.jpg"))
{
  DrawableFont font = new DrawableFont(@"D:\Fonts\DK Crayon Crumble.ttf");
  DrawablePointSize size = new DrawablePointSize(72);
  DrawableStrokeColor strokeColor = new DrawableStrokeColor(new MagickColor("#fff"));
  DrawableFillColor fillColor = new DrawableFillColor(new MagickColor("#fff"));
  DrawableText text = new DrawableText(200, 100, "Magick.NET");
  image.Draw(font, size, strokeColor, fillColor, text);
  image.Write("einsteinshow.magick.jpg");
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles



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