# Scalable Text Position by Scaling its Parent (QVtkRenderWindowInteractor) size vtk python

**URL:** https://discourse.vtk.org/t/scalable-text-position-by-scaling-its-parent-qvtkrenderwindowinteractor-size-vtk-python/1871
**Category:** Support
**Created:** [October 4, 2019, 7:24pm UTC](https://discourse.vtk.org/t/scalable-text-position-by-scaling-its-parent-qvtkrenderwindowinteractor-size-vtk-python/1871 "2019-10-04T19:24:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kimia.af1998](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/7ab992/32.png) [@kimia.af1998](https://discourse.vtk.org/u/kimia.af1998)
#### Post date: [October 4, 2019, 7:24pm UTC](https://discourse.vtk.org/t/scalable-text-position-by-scaling-its-parent-qvtkrenderwindowinteractor-size-vtk-python/1871/1 "2019-10-04T19:24:25Z")

</div>

Hi  
I have a render window that contains a text actor .  
its widget container can scale and resize by user but the text position is still fixed.(I used grid layout with pyqt5 that is resizable and contains my render windows.)  
I set the text on left-center and also want to be on left-center when the parent widget size become bigger or smaller.  
How can I do this and make the text position scalable for all sizes and remain at the same position?  
This is my code below :

```
   # Create Actor
    txtActor = vtk.vtkTextActor()
    txtActor.SetInput("L")
    # Set coordinates to match the old vtkScaledTextActor default value
    txtActor.GetPosition2Coordinate().SetCoordinateSystemToNormalizedViewport()
    txtActor.SetDisplayPosition(x, y)
    # Set Text Properties
    txtprop = txtActor.GetTextProperty()
    txtprop.SetFontFamilyToArial()
    txtprop.SetFontSize(50)
    txtprop.SetJustificationToCentered()
    txtprop.SetColor(1, .84, 0) 
    renderer.AddActor2D(txtActor)

```

and The output is :

 ![Screenshot%20from%202019-10-04%2022-48-29](https://discourse.vtk.org/uploads/default/original/1X/af0d9457f557b051e1b1b71cd42ea398f87bf488.jpeg)  
regular size  
 ![Screenshot%20from%202019-10-04%2022-49-08](https://discourse.vtk.org/uploads/default/original/1X/1131f3c4db894ff5b9c4722babf2a3154dcd2205.jpeg)  
bigger size  
as you see in bigger size label “L” is not center any more.
