Render TextBlock characters along a path
Posted: 09 Aug 2021, 13:57
Hi guys,
We have just been asked to implement a TextBlock such that it follows an arc. For example, I just mocked up the following image in Photoshop which is the effect we're after:
Looking online, I don't see an easy way to do this. My current thought is to split each character into a separate Run element and then define the location of that inline to be placed along a spline.
Can you think of an easier way to achieve this? Is there some solution we could achieve entirely in the SDF text renderer? Could we define the arc as a cbuffer parameter in a custom shader and render it in a bespoke way?
Any input would be greatly appreciated! Cheers,
-Steven
We have just been asked to implement a TextBlock such that it follows an arc. For example, I just mocked up the following image in Photoshop which is the effect we're after:
Looking online, I don't see an easy way to do this. My current thought is to split each character into a separate Run element and then define the location of that inline to be placed along a spline.
Can you think of an easier way to achieve this? Is there some solution we could achieve entirely in the SDF text renderer? Could we define the arc as a cbuffer parameter in a custom shader and render it in a bespoke way?
Any input would be greatly appreciated! Cheers,
-Steven