开发者

Draw Text using Type1 font in C#

开发者 https://www.devze.com 2023-03-26 11:45 出处:网络
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 an

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

精彩评论

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