View Single Post
  #5  
Old October 17th, 2014, 11:28 AM
MeeshKB MeeshKB is offline
Regular Contributor
 
Join Date: Jun 2012
Location: Alberta, Canada
Posts: 64
Default Re: A better CopyfitLine

Dan,

I'm just trying this for the first time. It seems to be magnifying just the width of the type, not the height. Is this intended, or am I missing a step?

Here's my code:
HTML Code:
  function CopyfitLineWithMagnifyTag(line, widthInPoints, AllowToExpand)
  {
    var tm = new FusionProTextMeasure;
    tm.CalculateTextExtent(line);
    if (tm.messages)
      ReportError("CopyfitMagnifyLine: " + tm.messages);
 
    if (tm.textWidth < widthInPoints*87 && !AllowToExpand)
      return line;
 
    var factor = Round(87 / tm.textWidth * 10000, 0) - 1;
    return "<magnify type=setwidth factor=" + factor + ">" +
            line + "</magnify>";
  }
  
    return CopyfitLineWithMagnifyTag('<f name="Swis721 BT">' +
            '<z newsize=11>' + Field("Name") + '<z newsize=6>' + ", " + Field("Designation"), 87, false);
__________________
Michelle
Digital Services Coordinator at Rileys (print and electronic services provider) in Alberta, Canada
FusionPro VDP 9.1.0, Windows 7, Acrobat Pro XI , InDesign CS6, Avanti eAccess, EFI Digital Storefront
Reply With Quote