[vtkusers] Unicode support

David Lonie david.lonie at kitware.com
Wed Nov 20 13:11:01 EST 2013


Hi Michael,

Support for unicode character sets was exposed in VTK master a couple of
months ago. The tricky bit is that you must provide a specific font file,
as the fonts currently embedded in VTK only support ASCII characters (this
will likely change in the future). The current way of enabling unicode
fonts is to configure vtkTextProperty with the desired font file, for
instance:

vtkTextProperty *tprop = ...;
tprop->SetFontFamily(VTK_FONT_FILE);
tprop->SetFontFile("/path/to/some/font/file.ttf");

Do this for the actors that you want unicode for, and the proper glyphs
will be pulled from the supplied font file. This should work everywhere
except for vtkVectorText, which uses an entirely different method of
rendering text.

See TestChartUnicode and TextContextUnicode in the Charts/Core module for
examples.

BTW, I recommend grabbing the DejaVu true type fonts -- they are rather
openly licensed, and they are what we use internally for testing.

Hope this helps,

Dave


On Wed, Nov 20, 2013 at 12:52 PM, Michael Xanadu <
xanadu.michael at googlemail.com> wrote:

> Dear Friends,
>
> What is the current state concerning the support of unicode in VTK? E.g.
> is it possible to display unicode charcters via vtkCaptionActor2D or
> vtkCornerAnnotation? If yes, which requirements do I have to meet (version
> etc.)?
> I have not found any clear information about the topic via google so far.
>
>
> Thanks in advance,
> Michale
>
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20131120/84848b96/attachment.htm>


More information about the vtkusers mailing list