Hello everyone, I would like to know the width and height of a vtkTextActor in python. According to the documentation, the GetSize and GetBoundingBox should provide me the height and width and those said methods require vtkViewport as one of its parameters. But I wanted to gain this information without passing a vtkViewport instance. Also, I tried the GetPosition2 method but its value is always set to (0.5, 0.5, 0) irrespective of the font size of vtkTextActor. It would be great if someone could provide me way to gain this information.
It’s not possible to determine the pixel size of the rendered text without the viewport, since the size of the rendered text is dependent on the DPI of the target display.
A vtkRenderer is a type of vtkViewport, so you should pass in the renderer that draws the actor.