[vtkusers] Using fontconfig with vtkTextMapper/vtkTextProperty?

Elvis Stansvik elvis.stansvik at orexplore.com
Thu Oct 20 09:34:37 EDT 2016


2016-10-20 14:49 GMT+02:00 Elvis Stansvik <elvis.stansvik at orexplore.com>:
> 2016-10-20 14:48 GMT+02:00 Elvis Stansvik <elvis.stansvik at orexplore.com>:
>> 2016-10-20 14:06 GMT+02:00 Elvis Stansvik <elvis.stansvik at orexplore.com>:
>>> Hi,
>>>
>>> How can I load a system font through fontconfig and use it with
>>> vtkTextMapper/vtkTextProperty?
>>>
>>> I've called vtkFreeTypeTools::GetInstance()->ForceCompiledFontsOff(),
>>> but I can't find any API on vtkTextProperty to set a font family to
>>> use for a fontconfig-based search.
>>
>> Am I supposed to pass the fontconfig family name (e.g. "Noto Sans") to
>> vtkTextProperty::SetFontFamilyAsString(..) ? I tried it but it didn't
>> seem to have any effect.
>>
>> In fact, I just had a look at the build log for the Debian package I
>> built of 7.1.0.rc1, and it's not mentioning "FontConfig" at all (see
>> attached log). Does that mean my build doesn't have fontconfig
>
> Sorry, forgot the attachment, here it is in case it's too big to be attached:
>
>     https://dl.dropboxusercontent.com/u/22350696/vtk7_7.1.0~rc1-0ubuntu1_amd64.build.bz2
>
> Elvis

Sorry for the noise. Just adding
-DModule_vtkRenderingFreeTypeFontConfig=ON to my build and
libfontconfig1-dev to the build dependencies, and I get

    --  * vtkRenderingFreeTypeFontConfig, requested by
Module_vtkRenderingFreeTypeFontConfig.

in the VTK CMake output. Building now and will report back how it went.

Still interested in if vtkTextProperty::SetFontFamilyAsString(..) is
the right API to set the fontconfig family name.

Elvis

>
>> support? Must I enable the FreeTypeFontConfig module explicitly? (not
>> enough that fontconfig is found on the system?).
>>
>> Elvis
>>
>>>
>>> Elvis


More information about the vtkusers mailing list