# vtkCaptionWidget and text scaling

**URL:** https://discourse.vtk.org/t/vtkcaptionwidget-and-text-scaling/13726
**Category:** Support
**Created:** [April 17, 2024, 8:08am UTC](https://discourse.vtk.org/t/vtkcaptionwidget-and-text-scaling/13726 "2024-04-17T08:08:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![codeling](https://discourse.vtk.org/user_avatar/discourse.vtk.org/codeling/32/3792_2.png) [@codeling](https://discourse.vtk.org/u/codeling)
#### Post date: [April 17, 2024, 8:08am UTC](https://discourse.vtk.org/t/vtkcaptionwidget-and-text-scaling/13726/1 "2024-04-17T08:08:15Z")

</div>

After [experimenting a little with vtkCaptionActor2D directly](https://discourse.vtk.org/t/vtkcaptionactor2d-and-the-size-of-leader-glyph/13721), I now switched to vtkCaptionWidget and like it a little better, with its automated arrow glyph and positionable text.

One thing I can’t figure out though is how to make the caption text **not scale** (or at least not so much) with the size of the window it is placed in (context: I use a 3D scene in a Qt widget, which is embedded in a larger layout and can be resized arbitrarily to better adapt to the user’s task at hand,.

With the `vtkCaptionActor2D` alone, I could achieve this by setting the `TextScaleMode` to `None`:

```auto
vtkNew<vtkCaptionActor2D> actor2D;
actor2D->GetTextActor()->SetTextScaleModeToNone();

```

Trying the same on the `vtkCaptionWidget` seems to have no effect however:

```auto
vtkNew<vtkCaptionRepresentation> captionRep;
// captionRep setup...
captionRep->GetCaptionActor2D()->SetTextScaleModeToNone();
vtkNew<vtkCaptionWidget> caption3D;
// caption3D setup...
caption3D->SetRepresentation(captionRep);

```

The only way I found so far to affect the font size (but only relative to the automatic scaling) is via `vtkCaptionRepresentation`’s font factor:

```auto
captionRep->SetFontFactor(0.6);

```

There is probably some easy way to disable the automatic scaling in `vtkCaptionWidget` that I am overlooking?

---

<div class="post-metadata">

### Author: ![codeling](https://discourse.vtk.org/user_avatar/discourse.vtk.org/codeling/32/3792_2.png) [@codeling](https://discourse.vtk.org/u/codeling)
#### Post date: [January 14, 2025, 11:52am UTC](https://discourse.vtk.org/t/vtkcaptionwidget-and-text-scaling/13726/2 "2025-01-14T11:52:19Z")

</div>

Similar to [my other question](https://discourse.vtk.org/t/vtkcaptionactor2d-and-the-size-of-leader-glyph/13721/2), haven’t found an answer here yet and would be glad if anybody who has worked already a little with vtk’s text annotations could chime in…
