[vtkusers] How to set custom fonts to vtkVectorText using vtkFontConfigFreeTypeTools?

David Gobbi david.gobbi at gmail.com
Wed Jan 8 12:48:13 EST 2014


On Tue, Jan 7, 2014 at 8:25 AM, David Lonie <david.lonie at kitware.com> wrote:
>
> Unfortunately, there is currently no way to get unicode text rendered as
> polydata in VTK. The only possibly way would be to use
> vtkTextRenderer::StringToPath to generate a vtkPath bezier curve and
> sample/triangulate the path manually (it will be tricky to figure out which
> areas get shaded). Other than that, unicode can only be rendered to image
> data.

If the path is converted into a polydata, then vtkContourTriangulator can be
used to triangulate the path.  It uses the winding of the contours (clockwise
vs counterclockwise) to decide what regions to fill with triangles.

It isn't even necessary to execute vtkContourTriangulator as a filter, it has
a public static method called TriangulateContours() that will take the contours
as input and add the triangles to an output vtkCellArray.

Vector text created from arbitrary fonts would be a very nice feature for VTK.

  David


More information about the vtkusers mailing list