How to get any suitable font in ImageSharp?

Viewed 484

I am very tired of providing fonts for my application. It would be a lot easier to have some ready-to-use fonts collection that I can use.

See this

//I need to add text to image, no matter what font is
var fo = SystemFonts.Find("Mono");
var font = new Font(fo, 10f, FontStyle.Regular);
x.DrawText("123", font,color,point);

I need to be sure that computer running this piece of code have font Mono installed. But it is not always the case, so I had to keep font file in my project folder and so on... This is just annoying.

What I want to do

//this must be a font that included into library itself.
var font = FontCollection.Any;
x.DrawText("123", font,color,point);

With this I can be sure that I will be able to print text on image no matter what system is.

0 Answers
Related