WPF FormattedText rasterizes / shortens when ligatures are used in some fonts (ti, tf, etc.)

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:

Correct text

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

Invalid text rendering.

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?

+8
c # fonts wpf drawing
source share

No one has answered this question yet.

See related questions:

460
How to add custom font to website?
145
WPF Font Blur Solutions
57
How to set default font for WPF application?
51
WPF total font size
7
In Win7, some fonts do not work, as in Win2K / XP
2
C # WPF - Dynamically changing text color based on background image
one
Wpf 4.0: drawing with the alias FormattedText / GlyphRun?
one
Get font information from FormattedText in WPF
one
Invalid font displayed in PDF when using wkhtmltopdf
0
WPF FormattedText randomly fades in high resolution images

All Articles