[vtkusers] bug 0009618 and UTF 8 text rendering fix question

Roger Bramon Feixas rogerbramon at gmail.com
Mon Dec 13 04:43:14 EST 2010


Hi,

Sean, at my system vtkTextActor::SetInput() also expects ISO-8859-1. I'm
using Qt and I have to call QString::toLatin1() to be able to use accents in
VTK.

Marcus, let me know if you has any questions about the patch which tries to
solve the drop shadow rendering problem.

Thanks for your attention,

Roger


On Tue, Dec 7, 2010 at 10:35 PM, Sean McBride <sean at rogue-research.com>wrote:

> On Tue, 7 Dec 2010 15:27:03 -0500, Marcus D. Hanwell said:
>
> >>> Just to clarify, what encoding should be given to
> vtkTextActor::SetInput
> >>> ()?  Last I tried, it seemed to expect ISO-8859-1.  Certainly a step up
> >>> from ASCII!  Is the long term plan for it to accept UTF8?
> >>
> >> I think it is best if VTK strings use the system default encoding,
> rather
> >> than utf-8.  For unicode there is always vtkUnicodeString.  More classes
> >> should be adapted to take vtkUnicodeString as input (but only, of
> course,
> >> if they are internally capable of using/rendering unicode).
> >>
> >> But I'm flexible.  Really, I'm just pushing for VTK's string handling to
> be
> >> more similar to Python's.  ;)
> >>
> >I am not too concerned about aligning with Python's string handling,
> >but agree with David - I think we should be adjusting existing classes
> >to deal with and take vtkUnicodeString, which can take UTF8 strings
> >for construction.
>
> Agreed.
>
> >It would probably be simplest to interpret all const
> >char* and vtkStdString as UTF8 when it came to rendering, as minimal
> >code/API changes would be required.
>
> I agree here too, but such a change would appear to break binary
> compatibility.  Today's vtkTextActor::SetInput() expects ISO-8859-1 (at
> least on my system), if we change it to expect UTF8 we break existing
> clients of VTK.
>
> In any case, API that take char* should document which encoding they
> expect.  Consider the tiny attached patch.
>
> >If you look at vtkContext2D and friends, where I have been prototyping
> >the UTF8 string handling and Unicode rendering, I have used
> >vtkUnicodeString as the function argument.
>
> Sounds great.
>
> >I certainly welcome people's thoughts on this. Working through the
> >relevant classes, and adding vtkUnicodeString API to them where and
> >when they can really render Unicode seems like a reasonable approach
> >to me.
>
> vtkTextActor appears to be in need of vtkUnicodeString support...
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
> _______________________________________________
> 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/20101213/18488da8/attachment.htm>


More information about the vtkusers mailing list