How to set the line height of rich text

I am creating a text generator for an image that takes text, font, max width and some other parameters, and generates an image from that. It will be used as a custom server control on the website to create headers.

I already have a component like this that uses GDI +. The problem is that GDI + is unable to set the line-height, which means I have to render the text first and then copy the resulting lines into a new bitmap using the line-height I want.

Now I am looking at using WPF components and have managed to create text images using FormattedText. The problem is, I still cannot set the line height. Is there a way to do this? If I could also set the letter spacing, that would be even better.

+2


source to share


1 answer


You should just set the LineHeight property , doesn't it work?



+2


source







All Articles