Tattoued Posted November 17, 2014 Share Posted November 17, 2014 I tried to search forums but cannot find my answer so apologies if it's out there and I didn't see it! I have a variable data field where the name or company name is sometimes very short or sometimes pretty long. I'd like to be able to have the size adjust accordingly (without going TOO large), or wrap on two lines if necessary. Say I have a field called "vdata". I imagine I'd do something like if vdata is more than 50 characters, then wrap, else leave on one line, along with some other copyfit command that will adjust the size of the type so it looks decent without going too large on the short names? Thanks! Quote Link to comment Share on other sites More sharing options...
WMajor Posted November 25, 2014 Share Posted November 25, 2014 Although probably not going to give you the best result and I am a novice when it comes to code, here is a suggestion. It just breaks your text into lines of about 50 characters. Also, don't forget to click on the "Treat ... as tagged text" checkbox.: var vdata = "Say I have a field called 'vdata'. I imagine I'd do something like if vdata is more than 50 characters, then wrap, else leave on one line, along with some other copyfit command that will adjust the size of the type so it looks decent without going too large on the short names?"; var newstring=""; var characters=50; textstart=0; textend=characters; if(Len(vdata)>characters) { for (aloop=1;aloop<vdata.length/characters;aloop++) { breakpos = vdata.indexOf(" ",textend); textamount = breakpos-textstart; newstring = newstring + vdata.substr(textstart, textamount)+"<br />"; textstart=breakpos+1; textend=(aloop+1)*characters; } newstring = newstring + vdata.substr(textstart, vdata.length-breakpos); } return newstring; Now wait while someone amazingly converts this into a single line of regex The reducing and enlarging of text is up to the settings in FusionPro. You can accept the default or override and there are plenty of examples in the forum. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted November 25, 2014 Share Posted November 25, 2014 You want to use the CopyfitLine function, or this variation thereof: http://forums.pti.com/showthread.php?t=84 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.