gpt4 book ai didi

c# - 如何让 C# 使用基于 css/svg 字体系列字符串的字体?

转载 作者:行者123 更新时间:2023-11-28 15:36:40 27 4
gpt4 key购买 nike

在微软的 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com