08-06-2019 01:38 PM - edited 08-11-2019 11:40 AM
I know I asked about that many years ago, but I haven't had a chance to implement this test myself, yet. I wonder if somebody already made something along these lines:
VI analyzer has the test "Font Usage"
For a test failure, you might get an error similar to the following:
"Some part of the display of the indicator labeled "xyz" does not use a specified font. If you are using a font other than Application, System, or Dialog font, this could cause problems when porting this VI to another system that does not have the proper font(s) installed."
Well, I would like to test for the exact opposite!!!
I would like to find all instances that don't have a really hard specified font (e.g. "Tahoma 13"). In other words, I would like to find all instances where clicking on the text shows a symbolic font name (application, system, dialog, etc.") in the toolbar instead of a named font.
Reasoning:
As we all know, the LabVIEW front panel does not scale well if fonts are symbolic and the executable is transferred to a machine with a different OS theme or font scaling. Things blow up or overlap. My distributed programs are quite busy and cannot tolerate any font variation issues! Yes, we can include an ini and such, but that does not really solve the root of the problem. Even if we define all fonts in the labview.ini, there are leftovers everywhere where these settings are ignored when dropping new controls. If you don't believe me, try the following:
Basically, symbolic fonts have a way to sneak into the front panel at edit time and I want to make sure I catch them all!
And no, I cannot at the end do a "select all" followed by a font pulldown to select e.g. tahoma. Some of my labels and captions have some embedded symbols (e.g. "a" which would revert to "a" if I blindly do so).
Long story short, I would suggest one of the following:
A: Create a custom test that warns about the presence of symbolic fonts! (need someone to do it. It may be hard to believe, but I never do any scripting, so this would be excessively hard for me to get started).
B: Increase the number of options for the existing "font usage" test, e.g. an additional checkbox to "Warn about symbolic fonts" or similar, reversing the behavior. (needs Darren ;))
(Maybe it should also do all that on diagram items containing fonts, not just the front panel. Maybe a scripting tool could be written that corrects all these font issues automatically, being careful not to touch anything defined, e.g. if a "application font" word contains a symbol substring in the middle, that part of the string should not be touched. Probably not easy ...)
08-06-2019 01:53 PM
What if I added a 'Non-Symbolic Fonts' checkbox?
It would default to FALSE for backwards compatibility, but for your use case, you would uncheck App/Sys/Dlg and only check non-symbolic. Would that solve your use case?
08-06-2019 03:05 PM
@Darren wrote:
What if I added a 'Non-Symbolic Fonts' checkbox?
I think that would work. 😉
(Maybe another one below the "hidden controls" option thing: "[ ] also check diagram", but that's not really important for the UI)
08-06-2019 03:16 PM
Maybe it's language thing*, but I am still confused why the explanation describes application/system/dialog fonts as "user specified"? Don't we get these if the user does NOT specify a font?
**I always have problems with language logic. Just came back from and England trip and saw this appetizer menu in a window. Why would I pay £10 for "three" appetizers if I can get "All for £3.50"??? Seems like a significantly better deal to get all of them, even if I eat only three. 😄
08-06-2019 03:18 PM
I agree, it's not 100% clear. "User-specified" is supposed to mean "configuration check boxes selected by the user for the Font Usage test". I'll try to clarify the test description when I add the new checkbox.
08-09-2019 03:32 PM
Barring catastrophe, this feature should be available in the Font Usage test in VI Analyzer Toolkit 2020.
08-10-2019 10:56 AM
thank you Darren!
02-12-2023 04:02 PM
So, this analyzer seems to be flawed, because it finds no failures if tab controls (i.e. the text on tabs) still have symbolic fonts.
This is one of my older programs and there were at least 3 tab controls that the analyzer did not identify. I wonder why....
can this be fixed?
(LabVIEW 2020)
02-12-2023 04:12 PM - edited 02-12-2023 04:13 PM
Quick demo:
Attached VI (2020) has two symbolic fonts (1: text inside numeric, 2: the tabs ). Vi Analyzer only finds #1.
02-12-2023 05:55 PM
@altenbach wrote:
This is one of my older programs and there were at least 3 tab controls that the analyzer did not identify. I wonder why....
can this be fixed?
At this time it cannot be fixed, because the fonts used in the page labels of a Tab Control are not exposed in VI Server.