# How to fix the font actor size, that is, the font size does not change when the camera distance is changed

**URL:** https://discourse.vtk.org/t/how-to-fix-the-font-actor-size-that-is-the-font-size-does-not-change-when-the-camera-distance-is-changed/2965
**Category:** Support
**Created:** [April 6, 2020, 8:01am UTC](https://discourse.vtk.org/t/how-to-fix-the-font-actor-size-that-is-the-font-size-does-not-change-when-the-camera-distance-is-changed/2965 "2020-04-06T08:01:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kknnnyy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/b5a626/32.png) [@kknnnyy](https://discourse.vtk.org/u/kknnnyy)
#### Post date: [April 6, 2020, 8:01am UTC](https://discourse.vtk.org/t/how-to-fix-the-font-actor-size-that-is-the-font-size-does-not-change-when-the-camera-distance-is-changed/2965/1 "2020-04-06T08:01:53Z")

</div>

I need to make the text face the camera, so I tried two methods

1. vtkVectorText + vtkFollower  
This method cannot have a fixed font size like vtkTextActor
2. vtkTextActor  
It is a vtkActor2D object, this method can not set the z-axis coordinates, can not fix the font at a certain position (x, y, z)  
So how can I display fixed-size text at a certain point (x, y, z)? When I zoom the camera, its size will not change, and it always faces the camera

---

<div class="post-metadata">

### Author: ![yuhuimoon](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/y/c6cbf5/32.png) [@yuhuimoon](https://discourse.vtk.org/u/yuhuimoon)
#### Post date: [April 6, 2020, 9:28am UTC](https://discourse.vtk.org/t/how-to-fix-the-font-actor-size-that-is-the-font-size-does-not-change-when-the-camera-distance-is-changed/2965/2 "2020-04-06T09:28:03Z")

</div>

You can try **vtkCaptionActor2D**. I have use it in my 3D scene(rendering in QVTKOpenGLNativeWidget). Here is the relevant code:

```
vtkSmartPointer<vtkCaptionActor2D> caption = vtkSmartPointer<vtkCaptionActor2D>::New();
caption->SetCaption(txt.toStdString().c_str());
caption->SetAttachmentPoint(centerPt.GetData());
caption->GetTextActor()->SetTextScaleModeToNone(); //key: fix the font size
caption->GetCaptionTextProperty()->SetFontSize(15);
caption->GetCaptionTextProperty()->SetFrame(false);
caption->GetCaptionTextProperty()->SetShadow(false);

```

I hope it will be useful to you.

---

<div class="post-metadata">

### Author: ![kknnnyy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/b5a626/32.png) [@kknnnyy](https://discourse.vtk.org/u/kknnnyy)
#### Post date: [April 6, 2020, 9:38am UTC](https://discourse.vtk.org/t/how-to-fix-the-font-actor-size-that-is-the-font-size-does-not-change-when-the-camera-distance-is-changed/2965/3 "2020-04-06T09:38:47Z")

</div>

It’s perfect,thank you!

---

<div class="post-metadata">

### Author: ![yuhuimoon](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/y/c6cbf5/32.png) [@yuhuimoon](https://discourse.vtk.org/u/yuhuimoon)
#### Post date: [April 6, 2020, 12:33pm UTC](https://discourse.vtk.org/t/how-to-fix-the-font-actor-size-that-is-the-font-size-does-not-change-when-the-camera-distance-is-changed/2965/4 "2020-04-06T12:33:29Z")

</div>

That’s great! You are welcome! 😀
