I need to copyfit a line first by horizontally scaling it If it exceeds max scaling amount, then I need to reduce the font size.
Copy needs to fit onto one line.
There would be several lines of text in the frame, the copyfitting can only apply to specifc lines of text.
So far, I've come up with this, but it does not work. It only horiz scales.
var thirdname = ToUpper(Field("Available third line"))
//apply horiz scaling to font at 2100.
var thirdnameWidth = CopyfitLineWithMagnifyTag('<f name="Pluto Bold">' + '<z newsize=221>' +thirdname, 2100);
//calculate the horizwidth of thirdnamewidth
TM = new FusionProTextMeasure;
TM.CalculateTextExtent(thirdnameWidth);
//if width is greater than 2100, return horizscaled type and reduce font size to fit frame width of 1400
if (TM.textWidth > 2100)
return CopyfitLineBasic(thirdnameWidth, "Pluto Bold", 221, 1400, 50, "fontSize");
else return thirdnameWidth;