在微软的 C# SVG 渲染引擎中,font-family 属性定义如下:
[SvgAttribute("font-family")]
public virtual Font FontFamily
{
get { return this._font; }
set { this._font = value; this.IsPathDirty = true; }
}
但是,这只适用于诸如
<text style='font-family:"Lucida Sans Unicode";font-size:12px;'>
当有多个字体系列时,例如
<text style='font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;font-size:12px;'>
已指定,它只是采用默认字体(Times New Roman)。
如何修改属性 FontFamily 以使用指定的第一个字体(如果存在)或后续字体(如果存在)?
最佳答案
不要单独包围字体系列类型,而是将它们作为一个单独的分组。
<text style='font-family:"Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica";font-size:12px;'>
关于c# - 如何让 C# 使用基于 css/svg 字体系列字符串的字体?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7841605/