05-23-2017 06:19 PM
@ATE-EGNE wrote:
Ok, Here's my solution so far, but the pid isn't settling any suggestions team?
What does a question about the PID have to do with a question about setting font sizes?
05-24-2017 06:59 AM
@RavensFan wrote:
@ATE-EGNE wrote:
Ok, Here's my solution so far, but the pid isn't settling any suggestions team?
What does a question about the PID have to do with a question about setting font sizes?
Oh, Sorry for the logical leap, I want to set the font size so that my text fully appears in an nxm pixel string indicator
05-24-2017 07:50 AM
Assuimng the screen size will not change very often and when it does the user will tolerate some computing to adjust....
Just run each of the strings through the "Get Text Rect" and then sort the array of clusters first for height and then width. Choose the largest of both as you test text. Then step-up or down the font size until you find the max font size that will allow the worst cases to fit.
If you are not aware, LV will sort an array of clusters based on the first element in the cluster (see cluster order) and use the next filed for tie-breakers. If you re-bundle the values you get from the "Get Text Rect" in a cluster with the order changed you can use the same sorting approach to find the max of both height and width.
Ben
05-24-2017 09:14 AM
So I got a PID control working based on the scale height (it seems that the factor you send the PID needs to be per character)
However, it's taking significantly longer than a brute force approach:
I'll go with option 2 unless you guys have any suggestions on how I can optimize either process further.
05-24-2017 11:41 AM - edited 05-24-2017 11:51 AM
Kudos from me for the most creative use a PID I have ever(?) seen.
I would lean toward option 2.
Besides, since you are not explicitly passing the dt, the PID would have to be retuned for different speed machinea?
Ben
05-24-2017 12:15 PM
I still don't understand how you use PID in a case like this.
I'd agree with you that you should use option 2, and am glad to hear you got it working for you.