Fixed LCD fonts vs variable Fonts

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Post Reply
Message
Author
JackZ
Posts: 2267
Joined: Mon Feb 22, 2016 1:02 pm

Fixed LCD fonts vs variable Fonts

#1 Post by JackZ »

Always learning:
I had encountered a problem in the Altitude alerter found on the store: The "virtual" LCD digits were "physically" moving depending on the value, ie "1111" was not at the same place as "8888". Very unrealistic.

So to modifiy this behaviour because I was using using a variable pitch LCD font (Digital-7), I ended up extracting all the altitude digits one by one and do complex calculations in order to have the digits properly aligned, not a very straightforward process (and quite slow).

Fortunately I found out that the original "default" font used by AM was already a LCD fixed pitch font!
Using a fixed font, the altitude number 1111 would now occupy the exact same width and space than the number 8888, which is exactly what I was looking for the Altitude Alerter. So instead of using the Digital-7 (variable pitch font, simply use the standard AM default font by omitting the "-fx-font-family:" tag in the text_add, and this will do the trick!

I discovered this by studying the code of the BENDIX KING DME indicator made by Ralph.
Very informative by the way, especially the persist() function to keep the previous state of the gauge.

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

alioth
Posts: 91
Joined: Tue Aug 16, 2016 9:03 pm

Re: Fixed LCD fonts vs variable Fonts

#2 Post by alioth »

When I made the vm100c engine monitor that was a problem I had to deal with,
The font I finally used has fixed size. (you can find it in the resources folder, I can't see the font name now).

But (there is always a "but"). The "dot" use its own space. So "125.50" is wider than "12550"
I didnt find a font which its dot doesn't use its own space.

Finally I had to use the "12550" and paint a dot above.
Not very elegant, but works.

Arturo.

Post Reply