[vtk-developers] vtkTextActor rotation

David Lonie david.lonie at kitware.com
Wed Oct 15 10:19:42 EDT 2014


Hi all,

I finished up a patch to better handle rotated and aligned text, and
cleaned up a few other rough spots in the text rendering system.

Looking for reviewers:

http://review.source.kitware.com/#/t/4851/

Dave

On Wed, Oct 8, 2014 at 3:52 PM, David Lonie <david.lonie at kitware.com> wrote:

> Hi Folks,
>
> We've noticed some odd behavior while rotating 2D vtkTextActors. There are
> two ways to do it:
>
> vtkTextActor::SetOrientation(degrees), or
> vtkTextProperty::SetOrientation(degrees)
>
> These behave very differently, especially when alignment flags are used --
> see the attached image for an example. The bottom two rows show this most
> clearly.
>
> Rotating the text property will rotate the text as it is being rendered
> into the texture's buffer. This gives great antialiasing on the rotated
> text, but gives bad alignment results, since the vtkTextActor is currently
> aligning the entire texture to its position, rather than the text inside
> the texture.
>
> Rotating the actor gives the expected alignment behavior, but bad
> antialiasing. This is because the text is rendered into the texture without
> rotation, and then rotated afterwards.
>
> Combining the two (top row) gives the worst of both cases.
>
> I'd like to fix the text actor to align things "correctly" when the text
> property is rotated. So my questions:
>
> 1) Is this behavior expected due to backwards compatibility?
> 2) If not, is this a good time to fix this? (e.g. are there any upcoming
> releases I should hold off for?)
>
> Thanks,
> Dave
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20141015/b15172ea/attachment-0002.html>


More information about the vtk-developers mailing list