How to Use a Custom TrueType Font With an Embedded UI

Updated May 21, 2021

Environment

Hardware

  • cRIO-9030

Software

  • LabVIEW Embedded Control and Monitoring Suite

  • The font of the Front Panel in Embedded UI doesn't display correctly in Embedded UI.
Embedded UI
LabVIEW Front Panel
  • I want to use a custom TrueType font with the Embedded UI, so I have installed the same TrueType font under Windows and the Linux Real-Time devices. The font on the device is shown in the X11/XFCE GUI and by the command-line tool fc-list.
  • I have tried to activate the font for the String Indicator both directly from the LabVIEW Editor and using the Property Text|Font|Font Name, but it doesn't work.

To use the custom fonts in Embedded UI, you could refer to the steps below.
  • Installing or transferring the fonts which you want to use to the NI Linux Real-Time device. You could find detailed information about the tools for transferring in the related links section.
    • We created a folder named TrueType under this path - /usr/share/fonts in this article, and the fonts are transferred to this folder.
  • Accessing the Shell on NI Linux Real-Time Devices.
  • Change the working path to the folder created previously.
  • Using mkfontscale and mkfontdir to create an index of scalable font files and an index of X font files. Make sure that the files of font.dir and font.scale are created under the folder.
Putty.png
  • Create a file named 10-fonts.conf with the content below. Where <the folder of fonts> is the folder created previously, /usr/share/fonts/TrueType will be used in this example.
Section "Files"
    FontPath   "<the folder of fonts>"
EndSection
  • Transfer the file (10-fonts.conf) to the device under this path - /usr/share/X11/xorg.conf.d.
  • Reboot the device.

After the device rebooted, run the vi again and the font will display correctly in Embedded UI.
CleanShot 2021-05-21 at 14.42.49@2x.png