[vtkusers] vtkVectorText beyond ASCII - solution

Sean McBride sean at rogue-research.com
Mon Jan 7 12:38:01 EST 2008


On 12/29/07 10:49 AM, Michail Vidiassov said:

>I have enquired on this list (vtkusers) about the sore state of
>non-ASCII text support in VTK and got no reaction:

I also look forward to the day when VTK fully supports Unicode.

>Thus I did some coding myself and got a vtkVectorText "on steroids",
>that can display Cyryllic, Greek and some math (a STIX font was used).
>You can see the results at
>http://www.iaas.msu.ru/tmp/NewVectorText.pdf
>http://www.iaas.msu.ru/tmp/NewVectorText.wrl
>If anyone is interested I will put the code in minimal-decency state and 
>post it here/put it there too.

I am interested.

>As of now I did not change API or logic in any way,
>font was converted offline and the text to show is just assumed to be in
>UTF-8.
>
>> On the other hand, VTK uses FTGL intenally to render bitmap fonts on the 
>> screen. But FTGL can make polygon fonts too.
>> It must be easy enough to hack FTGL to make a polygon set
>> for VTK, instead of feeding triangles to OpenGL directly.
>
>And I have done that easy part. But now I lack both motivation and 
>expertise to go any deeper into VTK to try on-the-fly rendering.
>My search over archives suggests that text handling is some
>untouchable mess and I was plain lucky that vtkVectorText was left 
>neglected by developers, making enhancing it a one-step process.

I'm not very familiar with the text code, but when I looked at it my
impression was that it would be a lot of work.  Lots of the code assumes
that 1 byte = 1 character, and lots of code uses old C string APIs like
strlen(), strcpy(), etc.

Maybe you could update this bug:
<http://public.kitware.com/Bug/view.php?id=4501>

with any helpful information.

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the vtkusers mailing list