jwhittaker Posted May 30, 2013 Share Posted May 30, 2013 (edited) I have a BC where the name and title is on one line and the customer wants the name to stay the same size and the title to copyfit using the rest of the line. The text box is 3.25" wide. The name is a different font with 4 spaces at the end before the title starts. For example, Jon Smith + '< >'+'< >'+'< >'+'< >' + Vice President of Operations (I added '< >' to represent a space since the 4 spaces were disappearing) I've tried several different things but the title comes out very small or doesn't copyfit at all and wraps to the next line. Edited May 31, 2013 by jwhittaker showed too many examples of what I tried doing Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted May 30, 2013 Share Posted May 30, 2013 This is an awful lot to sort through. Also, a large portion of your post seems to just be repeated. It's all very hard to follow. Frankly, I don't think I'll have time to figure it all out. Someone else is welcome to try, though. If you can post a sample job, that would be easier to analyze. That said, a few comments: The problem with this is the length of the copyfit size(highlighted in red above) I'm not seeing anything highlighted in red in your post. Maybe you could edit the post to remove the duplicate stuff and fix up the formatting. since the name can change sizes which would leave different constraints of the size, The size you specify in the call to CopyfitLine or CopyfitLineWithMagnifyTag is not the size of the text, it's the width of the text frame. Obviously the size of the text varies, it's a VDP job. The whole point is that you need to size that text to fit a particular frame. The function needs to know how big of a frame you're trying to size the text into. Anyway, depending on how the job is set up, it might easier to just put that line of text into its own text frame and turn on Copyfitting by opening the Overflow dialog and checking "Adjust text to fit." Quote Link to comment Share on other sites More sharing options...
jwhittaker Posted June 7, 2013 Author Share Posted June 7, 2013 Sorry Dan I was trying to show everything I had already tried. I fixed my original post. Does anyone have any ideas? Some examples below Name is 8pt, bold, and black title is 8pt, italic, and red only the title can copyfit they want the name to stay 8pt. The text box is 3.25" wide and can only have 1 line of text The underscores represent spaces in the same 8pt bold font as the name John Smith____Vice President Margaret Blackenhacken____Senior Vice President of Operations Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 7, 2013 Share Posted June 7, 2013 Sorry Dan I was trying to show everything I had already tried. I fixed my original post. Does anyone have any ideas? Some examples below Name is 8pt, bold, and black title is 8pt, italic, and red only the title can copyfit they want the name to stay 8pt. The text box is 3.25" wide and can only have 1 line of text The underscores represent spaces in the same 8pt bold font as the name John Smith____Vice President Margaret Blackenhacken____Senior Vice President of Operations It would be a lot easier to offer a specific suggestion if you could post a sample job. But the CopyfitLine function will work for this. It has separate parameters for "static" text whose size won't change and "dynamic" text which will get resized. So something like this should work: var frameWidthInInches = 3.25; var frameWidthInPoints = frameWidthInInches * 72.0; return CopyfitLine('<b>' + Field("Name") + " ", '<i><color name="Red">' + Field("Title"), "Arial", 8, frameWidthInPoints, 4); Although you would have to have a really, really long name and title for everything to not fit on a line 3.25 inches long at a point size of 8. Also, your usage of the attribute is incorrect. You don't want to put it in angle brackets; it's not a tag. Quote Link to comment Share on other sites More sharing options...
jwhittaker Posted June 7, 2013 Author Share Posted June 7, 2013 Thanks Dan for your patience. I'm a rookie at javascript and was getting frustrated. I do appreciate your input. I am taking a look at this now. Hopefully it does what I need. Thanks again. Quote Link to comment Share on other sites More sharing options...
jwhittaker Posted June 7, 2013 Author Share Posted June 7, 2013 Hey Dan, Unfortunately it didn't work. I have zipped my file and am attaching. Let me know if I missed something. Thanks in advance. JonBC test.zip Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 7, 2013 Share Posted June 7, 2013 Well, you're not calling out the red color by the right name. But this works great for me: var frameWidthInInches = 3.24; var frameWidthInPoints = frameWidthInInches * 72.0; return CopyfitLine('<b><color name="Black">' + Field("Name") + " ", '<color name="c0m75y100k0"></b><i>' + Field("Title"), "Myriad Pro", 8, frameWidthInPoints, 3);http://forums.pti.com/attachment.php?attachmentid=869&stc=1&d=1370646348http:// Quote Link to comment Share on other sites More sharing options...
jwhittaker Posted June 10, 2013 Author Share Posted June 10, 2013 Dan That works!!!! Thank you sooooo much. I really appreciate your knowledge and your willingness to help everyone out. Thanks again. Jon 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.