[vtk-developers] vtkCaptionActor2D is not scaling the text to fit the rectangle when font size is default or 12

David Lonie david.lonie at kitware.com
Thu Apr 9 08:55:06 EDT 2015


On Wed, Apr 8, 2015 at 3:37 PM, E. Tadeu <e.tadeu at gmail.com> wrote:

>   To test it, just create a vtkCaptionActor2D and add it to a renderer.
>
>   See example here, tested in VTK 6.2:
>
> ```
> import vtk
>
> ren = vtk.vtkRenderer()
> renWin = vtk.vtkRenderWindow()
> renWin.AddRenderer(ren)
> iren = vtk.vtkRenderWindowInteractor()
> iren.SetRenderWindow(renWin)
>
> actor = vtk.vtkCaptionActor2D()
> actor.SetCaption(u'Hello')
>
> # # This makes it work:
> # actor.GetCaptionTextProperty().SetFontSize(13)
>
> # # This also makes it work:
> # actor.GetCaptionTextProperty().Modified()
>
> # # This doesn't make it work:
> # actor.GetCaptionTextProperty().SetFontSize(12)
>
> ren.AddActor(actor)
> iren.Initialize()
> iren.Start()
> ```
>
>   I'm having another similar problem related to the font not being scaled
> the second time it is rendered (after changing the scale), and I think it
> may be related to this too.
>
>   Any hint on what may be causing this?
>

It sounds like the logic to check for modifications is missing something.
Can you open a bug report for this?

Thanks,
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150409/2247ea59/attachment.html>


More information about the vtk-developers mailing list