开发者

Draw Text using Type1 font in C#

I create an application for Fon开发者_运维百科t Management and I have a problem with preview of Type1 fonts (.pfb and .pfm ext.). I need any solution how display a text using this font type.


To draw any font, you can use Graphics.DrawString method:

System.Drawing.Font font;//initialize your font here.

using (Bitmap previewImage = new Bitmap(16, 16))
{
    using (Graphics graphics = Graphics.FromImage(previewImage))
    {
        graphics.DrawString("text", font, Brushes.YellowGreen, location);
    }

    previewImage.Save(@"Your output file path");
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜