views:

216

answers:

1

I am building a text-to-image generator that takes a text, a font, a max width and some other parameters and generates an image from this. It will be used as a custom server control in a web site to generate headlines.

I allready have a component like this which uses GDI+. The problem with this is that GDI+ is incapable of setting line height which means I have to render the text first and then copy the resulting rows into a new Bitmap using the line height I want.

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

+1  A: 

You should just be able to set the LineHeight property, is that not working?

Drew Marsh
I was going to say that I had allready tried that but that the property was Get only... until I realised that it was Get only according to the doc but not in reality and that the Exception I had got when using it was due to another part of the code. Thanks!
Johan Öbrink