[vtkusers] Unicode support for Axis Titles and Labels in vtkCubeAxesActor2D

David Lonie david.lonie at kitware.com
Fri Feb 3 11:37:57 EST 2017

Unfortunately vtkCubeAxesActor2D still uses vtkVectorText internally
by default, which ignores the font family entirely. So custom font
files will not be used with it.

There is an experimental feature to use a vtkTextActor3D (which
supports custom fonts) in place of vtkVectorText that may work for
you, but I'm not sure if it's in a usable state at this point. You can
try it by getting the 3 vtkAxisActor2D instances out of the cube axes
and calling UseTextActor3DOn for them:


It looks like the Use2DMode setting on the axis actors would use a
vtkTextActor, which supports custom fonts as well. Hopefully one of
these will work for you.


On Fri, Feb 3, 2017 at 6:35 AM, Butterfly via vtkusers <vtkusers at vtk.org> wrote:
> Hello everybody,
> I successfully visualize unicode text using other vtk actors, but can not do
> the same with vtkCubeAxesActor2D. I see the symbols, but they are not
> correct. Is this not implemented yet?
>                                 vtkSmartPointer<vtkCubeAxesActor2D> axes =
> vtkSmartPointer<vtkCubeAxesActor2D>::New();
>                                 axes->GetAxisTitleTextProperty()->SetFontFamily(VTK_FONT_FILE);
>                                 axes->GetAxisTitleTextProperty()->SetFontFile(unicodeFontFilePath);
>                                 axes->GetAxisLabelTextProperty()->SetFontFamily(VTK_FONT_FILE);
>                                 axes->GetAxisLabelTextProperty()->SetFontFile(unicodeFontFilePath);
>                                 axes->SetXLabel(unicodeString);
> Many thanks in advance!
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Unicode-support-for-Axis-Titles-and-Labels-in-vtkCubeAxesActor2D-tp5742039.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Search the list archives at: http://markmail.org/search/?q=vtkusers
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers

More information about the vtkusers mailing list