# How to use a customized font to vtkVectorText

**URL:** https://discourse.vtk.org/t/how-to-use-a-customized-font-to-vtkvectortext/13695
**Category:** Support
**Tags:** training, python, code, proposal
**Created:** [April 11, 2024, 9:53am UTC](https://discourse.vtk.org/t/how-to-use-a-customized-font-to-vtkvectortext/13695 "2024-04-11T09:53:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bassfaye](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ba9def/32.png) [@bassfaye](https://discourse.vtk.org/u/bassfaye)
#### Post date: [April 11, 2024, 9:53am UTC](https://discourse.vtk.org/t/how-to-use-a-customized-font-to-vtkvectortext/13695/1 "2024-04-11T09:53:05Z")

</div>

Hello, I want to set some text to vtkVectorText but with Arrial Black font. Can someone tell me how to do this?  
I try with vtkTextActor but I can’t use the text as a polydata because I want to use customized text in a boolean operation with another polydata. Thanks in advance.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [April 12, 2024, 2:55pm UTC](https://discourse.vtk.org/t/how-to-use-a-customized-font-to-vtkvectortext/13695/2 "2024-04-12T14:55:46Z")

</div>

Hello,

Unfortunately that class doesn’t use glyphs to generate text geometry like most other text-dealing VTK classes do. Instead, it uses a set of hardcoded polygons to lay out a text-shaped `vtkPolyData`. In other words, you can’t set a custom font when using `vtkVectorText`.

You can try a three-fold procedure by, first, using a `vtkTextRenderer`’s `StringToPath()` method genereate the text outlines (called a path) with the custom font seetings you want. Then, take the resulting `vtkPath` and process each of its constituent `vtkCell`s to get the vertexes to make the outline geometry of a `vtkPoltData`. Finally, you can use a filter like `vtkContourTriangulator` (which takes a `vtkPolyData`) to fill the outlines with triangle faces. You have to study the classes’ APIs to engineer a code to convert a `vtkPath` to a `vtkPolyData` as I don’t know an existing filter or algorithm that does this.

best,

PC
