c# - 让连字在 SharpDX/DirectWrite 中工作
问题描述
我无法让连字出现在 DirectWrite 代码中。我正在使用一种富含连字的字体,并且基本上应用了我可以得到的每个连字标签:
var typography = new Typography(dwriteFactory);
var ligatureTags = new[]
{
FontFeatureTag.StandardLigatures,
FontFeatureTag.StylisticAlternates,
FontFeatureTag.DiscretionaryLigatures,
FontFeatureTag.RequiredLigatures,
FontFeatureTag.ContextualLigatures,
FontFeatureTag.HistoricalLigatures
};
foreach (var tag in ligatureTags)
{
FontFeature ff;
ff.NameTag = tag;
ff.Parameter = DisableLigatures ? 0 : 1;
typography.AddFontFeature(ff);
}
textLayout.SetTypography(typography, EntireRange(text));
从上面的代码,StylisticAlternates
并且DiscretionaryLigatures
工作。但是,无论我做什么,StandardLigatures
都不工作。
任何人都可以就为什么这不起作用提出建议吗?
解决方案
推荐阅读
- excel - 用单元格引用替换逻辑运算符excel
- php - 找不到驱动程序(SQL:select * from ".." where ".." = user limit 1),在 vscode cli 上运行 docker-compose build 时服务“app”构建失败
- javascript - Vue - 单个文件组件未呈现
- php - 如何不仅检查保留关键字,还检查任何内置函数或“特殊变量”?
- javascript - 使用 ws 库(nodejs)的套接字 ping 错误
- c++ - vector::iterator 也可以用作向量吗
- sql - 在 oracle sql developer 中从另一个数据库的视图中更新表列
- ios - Nodejs 苹果原生认证
- asp.net-core - Ajax 调用,其中参数为 IRequest (Mediatr),所有属性都为 null
- openam - 无法创建 SMS 配置:服务器 URL 的主机名不是 openam 中的 FQD