C# 如何在Windows Azure上加载自定义字体以绘制图像?

C# 如何在Windows Azure上加载自定义字体以绘制图像?,c#,azure,fonts,C#,Azure,Fonts,我需要使用自定义字体在我自己的应用程序上绘图 是否可以通过部署脚本进行安装? 应该可以存储您的 磁盘或数据库中的字体文件,以及 然后使用 归类于 在运行时使用字体 以下是您将如何使用它: 干杯 PrivateFontCollection collection = new PrivateFontCollection(); // Add the custom font families. // (Alternatively use AddMemoryFont if you

我需要使用自定义字体在我自己的应用程序上绘图

是否可以通过部署脚本进行安装?

应该可以存储您的 磁盘或数据库中的字体文件,以及 然后使用 归类于 在运行时使用字体

以下是您将如何使用它:

干杯

    PrivateFontCollection collection = new PrivateFontCollection();
    // Add the custom font families. 
    // (Alternatively use AddMemoryFont if you have the font in memory, retrieved from a database).
    collection.AddFontFile(@"E:\Downloads\actest.ttf");
    using (var g = Graphics.FromImage(bm))
    {
        // Create a font instance based on one of the font families in the PrivateFontCollection
        Font f = new Font(collection.Families.First(), 16);
        g.DrawString("Hello fonts", f, Brushes.White, 50, 50);
    }