【问题标题】:Graphics.DrawString - not work fontfamily text formatGraphics.DrawString - 不工作 fontfamily 文本格式
【发布时间】:2016-12-23 17:35:17
【问题描述】:

在视频上叠加文字:

using (f_graphics = Graphics.FromImage(f_bmp_overlay))
            {
                f_graphics.Clear(System.Drawing.Color.Transparent);
                f_graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
                f_graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
                f_graphics.DrawString(f_text, f_font, f_color, new PointF(15, 15));
            }

文本颜色和大小效果很好,但 FontFamily 仅适用数字。

可以做什么?

【问题讨论】:

  • 你用的是什么字体?也许那个字体只适用于数字?

标签: c# text-rendering


【解决方案1】:

您使用的是西里尔字符,物理字体显然不包含这些字符。所以系统用它选择的另一种字体替换字形。尝试使用拉丁字符,您会发现它们也打印正确。

您需要一个字体文件,其中包含您正在打印的所有 Unicode 代码点的字形,并改用它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-06-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多