tags:

views:

571

answers:

2

Hi All,

I need to display a string with each character displayed every x pixels. (x is accross the whole string).

e.g.: "Hello" -> H at position (pixel) 0, e at position 50, l at 100, l at 150, o at 200.

Of course I could use a TextBlock for each character but it seems overkill.

TranslateTransform doesn't seem to do the trick: It offsets my characters relatively to the END of the previous character, which is not what I want.

TIA for your help.

+4  A: 
Kent Boogaart
Interesting. I'll have to add some more code though to support custom fonts and colors. Thanks.
Serge - appTranslator
+1  A: 

I guess it depends on the details of your situation whether this will work or not. But could you just add spaces between each letter, and set the text alignment to be justified?

Unfortunately you don't get to set the # of pixels this way if that's what you need... but you can get even spacing this way. If this isn't just one spot on your window or is a little more complex with dynamic text... then you may want to look into a more elegant solution.

Scott
Serge - appTranslator
Thanks, I hope you find a good solution!
Scott