I'm having trouble getting ligatures to show up in DirectWrite code. I'm using a ligature-rich font and am basically applying every ligature tag I can get my hands on:
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));
From the above code, StylisticAlternates
and DiscretionaryLigatures
work. But, whatever I do, StandardLigatures
do not work.
Can anyone give suggestions as to why this wouldn't be working?