IndexOf

IFontFallBackRule.IndexOf 方法

返回集合中指定规则的索引。

public int IndexOf(string fontName)
参数类型描述
fontNameString要查找的字体名称。

返回值

字体的索引,如果在列表中未找到字体则返回 -1。

示例

[C#]
// 创建一个包含字体列表的规则。
IFontFallBackRule newRule = new FontFallBackRule(0x3040, 0x309F, "MS Mincho, MS Gothic, Tahoma, Times New Roman");

// 获取 Tahoma 的索引
int tahomaIndex = newRule.IndexOf("Tahoma");

参见