05-06-2019 03:13 PM
@AbongileViksVika wrote:
Could you downgrade your VI's to 2017? Still not up to date here 😉
As the Caterpillar said to Alice, "Who ... are ... you?" Various people commented and offered code here ...
Bob Schor
05-07-2019 01:04 AM
Right you are, Bob.
Well, there are 2 VI's of interest in the thread:
by @datatechNDT: "Binary search FontSize to PixelWidth.vi
by @paul_cardinale: "fit string to box.vi"
Thanks a lot!
09-11-2022 10:29 PM
I am not proud. I am making a Jeopardy game using a background pic for fun. This thread was as close as I could find to doing exactly what was discussed - scale text to a 2D shape that fits within some boundary using the largest font possible. I took the original "fit shaped string to box" and modified it by adding an initial call to a "shape text to box" that tries to break up the text into the right shape with a parameter called "W to H ratio" for proportionality. Since I don't know exactly what is the best ratio for a given font and set of words, I then wrapped it in another loop that looks for the largest font - "Find best ratio for text box fit." Voila. As you may imagine, this may not be pretty, but it does what I want and I could hack it together in short order. Just throwing it out there for the curious.