[vtkusers] Does vtkCaptionActor2D support chinese characters?

David Lonie david.lonie at kitware.com
Mon Sep 12 09:20:46 EDT 2016


On Sun, Sep 11, 2016 at 12:18 PM, Liu_tj <tjlp at netease.com> wrote:

> I want to give Chinese text annotation on 3D model.Does vtkCaptionActor2D
> support chinese characters? If no, what class should I use?
>

vtkCaptionActor2D will work.

You'll need to provide a unicode font file (the embedded fonts in VTK only
support ASCII) via the caption actor's GetCaptionTextProperty:

captionActor->GetCaptionTextProperty()->SetFontFamily(VTK_FONT_FILE);
captionActor->GetCaptionTextProperty()->SetFontFile("/path/to/some/unicode/font/file");

and then encode the caption text as UTF-8.

Hope this helps,
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160912/dc6c1a8e/attachment.html>


More information about the vtkusers mailing list