I am currently using the Carlito font to render some FormattedText in WPF to then print the final image like this:
DrawingVisual vis = new DrawingVisual(); DrawingContext dc = vis.RenderOpen(); ... FormattedText someText = new FormattedText("Delightful", System.Globalization.CultureInfo.CurrentCulture, FlowDirection.LeftToRight, typefaceCarlito, 52, brushBlack); dc.DrawText(someText, new Point(rightX - someText.Width, 2900 - (someText.Height / 2))); ... dlg.PrintVisual(vis, "Test print"));
I chose the text โDelightfulโ here because it contains one of the ligatures (โtfโ), which seem to give me a strange problem. Printing works fine without such ligatures, and printing in PDF shows that it is sent as a vector:

However, if I (re) enter a ligature, the following will happen:

The text becomes rasterized (ignore the pixelated line, this is a background image) and ends with a short one. In some cases, he stops in the ligature position. In other cases, it contracts shortly afterwards.
This does not happen with all fonts - most system fonts are fine, as is the other third-party font that I chose to use, but I still need the ability to stop this. Pixeling is not so much a problem, but a cutoff.
Is there a way I can get FormattedText not to convert consecutive characters to their ligature equivalent, or is it even better to stop this?
c # fonts wpf drawing
Dan
source share