From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set default Real-Time Linux font

After some experimentation I've decided that the Liberation Sans font renders with the best clarity on my CompactRIO 9030 with Linux Real-Time.

So now I want all the controls and indicators that I create destined for my Real-Time application to adopt this font by default. I don't want this for my local Windows development environment.

What's the simplest way to ensure my Real-Time embedded UI uses my font choice throughout? Is there a setting somewhere for this, perhaps an .ini file on the target?

 

fonts.png

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 1 of 7
(4,182 Views)

Hi there,

 

I have been searching around for an answer to your question in our internal database but I have not found something that would answer your question yet. I found a link that explains which files affect the font on a linux system so you might want to have a look playing around with those:

https://seasonofcode.com/posts/how-to-set-default-fonts-and-font-aliases-on-linux.html

 

If you have made any progress please do share as I am quite interested in this myself!

0 Kudos
Message 2 of 7
(4,114 Views)

The LabVIEW IDE font dialog doesn't allow you to set the font name to anything custom, it only allows selection of fonts that are installed on your system. So it's impossible to set anything to Liberation Sans through the IDE as that font isn't present on my Windows dev machine.

However, you can programmatically set G object font names to any string you like, so I've had to write a VI that uses scripting to traverse a front panel for specific objects and it sets their label, caption and other contained fonts to my Linux choice Liberation Sans. Once saved it seems to stick, and the deployed VIs then properly use my font choice on the cRIO. It's been a pain in the proverbial but the tool works.

I think I'd like to make the VI an easy to use pre-build VI so that my cRIO RealTime code is automatically checked for font names before it's deployed. That'll be my next step.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Message 3 of 7
(4,088 Views)

You could also set all the strings to use Application Font (or Dialog Font) and then in the ini file add a setting to change this Font to a specific font type.

 

On your Windows System

 

[MyApplication]

AppFont = "Sans Serif" 13

SystemFont = "Sans Serif" 13

DialogFont = "Sans Serif" 13

 

Under Linux:

 

[MyApplication]

AppFont = "Liberation Sans" 13

SystemFont = "Liberation Sans" 13

DialogFont = "Liberation Sans" 13

Rolf Kalbermatter
My Blog
Message 4 of 7
(4,076 Views)

So I downloaded the Windows version of Liberation Sans...then applied that Font to the VI - and it worked when deployed to the RT systems.

 

I do recall reading that cRIO Linux does not use the labview.ini - so that won't work.

 

 ---- the cRIO Font issue has been a real embarrassing headache for 10 + years. $6,000 chassis and you can't set the font..

 

Regards

Jack

0 Kudos
Message 5 of 7
(1,576 Views)

@SeniorArchitect wrote:

 

 ---- the cRIO Font issue has been a real embarrassing headache for 10 + years. $6,000 chassis and you can't set the font..


I think you are unfair here. The cRIOs are not sold as high end graphics displays but as something completely different. Most of them are actually without any display port, their usage is meant headless just as the original code name for embedded LabVIEW indicated: "LabVIEW in the dark".

 

Some higher end cRIOs with AMD64 compatible CPU do have a display port but that is not meant for high end graphics. The XWindows server used on those cRIOs is specifically a very lightweight version that does not contain all the bells and whistles of normal desktop Linux XWindows system, because XWindows is a huge beast of software and there was a deliberate choice for lean and mean rather than huge and slow. The display of LabVIEW front panels looks reasonable on it but is far from what you expect under Windows and does not support all graphical front panel objects that the Windows version knows. That was a deliberate choice as the cRIO was not meant to replace a normal desktop computer, very much like you do not normally use a PLC for your display.

 

In addition font handling always has been a big problem thanks to copyright and technical issues. First those TTF fonts are theoretically multiplatform but Microsoft couldn't stop themselves to make a few modifications to it to make it fit better with their GDI design (or maybe it was just for the sake of being not the same, to much compatibility could have hurt their sales). This meant that there were always some differences between fonts created explicitly for Windows and other fonts.

 

Second the creators of fonts tended to ask quite a bit of money from anyone trying to use them. That meant the OS builders adding them to their system, printer manufacturers wanting to make them resident, document description content creators such as Adobe PDF Creator for allowing to embed them in the document so the text can be actually printed as originally displayed even if the target OS or printer doesn't know about it. It meant that there was a huge amount of similar looking but not quite the same font to avoid having to pay the creator of a specific font. It also meant that font handling on Windows was inherently different than on Mac and very different than on Linux as Linux generally only included the freely available fonts that did not require any license fees. But that should be not a big surprise. You generally wouldn't distribute an OS for free and then foot bills for licenses that are not absolutely strictly necessary! I'm not quite sure what the current license situation is with many fonts but since it is copyright law that applies here rather than patent law, this copyright still is valid nowadays for most fonts. So those download packs of fonts on many sites to allow making a Linux system display certain fonts may actually be not entirely legal. It's probably to much work to sue all those users who download them and to track down and cease and desist every server, but someone like NI certainly would be gone after if they tried that. And since they never sold the GUI capabilities of cRIOs as equivalent to Windows in feature compatibility, they almost certainly never seriously investigated the license question of this but simply rely on the stock Linux X Windows libraries they use.

 

So if you expect WYSIWYG from a cRIO display you of course will feel cheated. But in this case this is because of totally wrong expectations. NI never sold the cRIOs as full featured graphical user interface platforms, rather that some of them have a display port that can be used for limited front panel display for simple operator interaction, not pixel for pixel accurate graphics.

 

As to a cRIO applications configuration file, no it does not use an ini file, but a more Linux like configuration file just as stock Linux applications usually do. How that should be named and the somewhat different syntax it uses compared to Windows INI files is however documented in the LabVIEW documentation. It might still not look exactly the same after you made that change since as explained, fonts are not just fonts, there exists subtle but not unimportant differences between fonts for Windows and fonts for other platforms.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 7
(1,562 Views)

Rolf,

 

I see the cRIO displays as one-up from a programmable touch screen - not a full graphics driven desktop.  I've used cRIO since about their inception - when they did not have a display and actually coded color touch screens to operate with them.

 

There is a huge application segment of regulated space where not having to use a Windows/Mac is a regulatory advantage. My company has pushed the cRIO as alternative in that market. As it has a very locked OS, and can be configured to only present the application GUI. 

 

cRIO's just work...and work. [If you can resist the Scan interface!].

 

My complaint is there little to zero improvement since the display port itself. And there is a small set of LabVIEW cRIO's users hacking & groping to get those incremental improvements.

 

Nice GUIs' are important. They really are - the cRIO fonts are terrible - compounded by the lack of fonts on the Windows OS. Words get clipped when the Linux replaces the font, and it appears to have the fixed font sizes and the True Type.  Which is ok - all NI had to do was deploy a like font library for development so there are not deployment surprises.

 

And expecting a WYSIWYG?...Ah that's what LabVIEW buttered it's bread with since day one!. So the bar was set equally high on the cRIO. Other than fonts the cRIO does a pretty amazing job!.

 

We were looking for some small tweeks

 

Warm Regards

Jack Hamilton

0 Kudos
Message 7 of 7
(1,548 Views)