[vtk-developers] vtkVectorText -- to deprecate or not?

Bill Lorensen bill.lorensen at gmail.com
Tue Oct 16 16:20:17 EDT 2012


I guess the only advantage of vtkVectorText is that it is a source that
produces polygonal letters. It can be used in a pipeline.

On Tue, Oct 16, 2012 at 1:09 PM, David Lonie <david.lonie at kitware.com>wrote:

> Hi list,
>
> I'm writing an (optional) extension to VTK that will override
> vtkTextActor with a "smart" math text actor that will switch between
> FreeType rendering for plain text and MathText equation rendering for
> strings containing MathText markup. The plan is to enable this in
> ParaView, so that any visible text field in a RenderView will
> automatically have the ability to display equations.
>
> To this end, I've added a vtkSmartMathTextActor and
> vtkSmartMathTextActor3D, designed to be drop-in replacements for
> vtkTextActor and vtkTextActor3D. Unfortunately, most of the 3D text
> rendering in VTK/ParaView is done using vtkVectorText, which is quite
> different from the other classes.
>
> While vtkTextActor3D is a stand-alone actor that uses FreeType to
> generate a texture which is rendered to the device, vtkVectorText
> derives from PolyDataAlgorithm and simply assembles hardcoded
> polydata, character by character.
>
> I propose a long-term deprecation period for vtkVectorText, favoring
> vtkTextActor3D, for the following reasons:
>
> * Limited supported character set:
>     Only ascii codes 33-126 + '\n' are available
> * Limited font support:
>     Only a single hardcoded sans-serif font is available,
>     while FreeType has at least serif, sans-serif, and monospace,
>     as well as (optional) font config support for access to
>     system fonts.
> * No font properties:
>     In addition to only a single font family, there is only one
>     version of it. vtkVectorText doesn't know anything about
>     vtkTextProperty, so bold, italics, justification, linespacing,
>     etc, etc are fixed.
> * Inflexible for providing custom implementations:
>     Polydata output is quite unusual for a text layout engine,
>     and producing such is difficult to re-implement.
>
> In short, there just doesn't seem to be much reason for keeping this
> class around when there is a much more powerful, easier-to-use
> alternative.
>
> While I think there is a strong argument for using vtkTextActor3D
> instead of vtkVectorText, perhaps deprecating the class would be
> overkill. In that case, I suggest encouraging new code to use the
> vtkTextActor3D class, and to start refactoring existing classes (e.g.
> vtkAxisActor, etc) to use vtkTextActor3D internally.
>
> Thoughts? Suggestions? Agreement? Disagreement?
>
> Dave
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>


-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20121016/7b59d77d/attachment.html>


More information about the vtk-developers mailing list