我无法在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
都不起作用。
任何人都可以提出建议,为什么它不起作用?