[vtkusers] Why the vtkTextProperty.SetFontSize() does not take effect?

David Lonie david.lonie at kitware.com
Mon Sep 19 14:31:29 EDT 2016


On Sat, Sep 17, 2016 at 11:26 AM, Liu_tj <tjlp at netease.com> wrote:

> Hi,
>
> I use vtkCaptionWidget to display text annotation on 3D model. My issue is
> the font size of the text. Below is my C# code:
>
> vtkCaptionRepresentation rep = vtkCaptionRepresentation.New();
> rep.GetCaptionActor2D().ThreeDimensionalLeaderOff();
> rep.GetCaptionActor2D().GetTextActor().GetTextProperty().SetFontSize(100);
> rep.GetCaptionActor2D().GetTextActor().GetTextProperty().SetFontFamily(4);
> rep.GetCaptionActor2D().GetTextActor().GetTextProperty().SetFontFile(
> "simsunb.ttf");
> rep.GetCaptionActor2D().GetCaptionTextProperty().SetColor(0.0, 1.0, 0.0);
>

Try setting it on rep.GetCaptionActor2D().GetTextProperty() instead of
rep.GetCaptionActor2D().GetTextActor().GetTextProperty().

Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160919/fffba3e4/attachment.html>


More information about the vtkusers mailing list