Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Formatting Text

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 13th, 2016, 04:57 AM
traba5058 traba5058 is offline
Regular Contributor
 
Join Date: Jan 2012
Location: Atlanta, GA
Posts: 77
Question Horizontal Scale of Font

Good Morning!

I have a business card layout that uses the Horizontal Scale option in In Design. It uses 75% Helvetica Light.

Is there a way to use horizontal scaling in a Fusion Pro rule?

All help will be much appreciated!
Reply With Quote
  #2  
Old April 13th, 2016, 07:01 AM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Horizontal Scale of Font

Check out page 50 on the TagsRefGuide.pdf in the FusionPro documentation.

Sounds like you're looking for the "setwidth" tag. It's set in points (not percentages) so if you have a 12 pt font, to get a 75% width using the setwidth tags, you'd have to specify 9 points:
Code:
return 'Regular text <setwidth newsize="9">text that is 75% the width. <setwidth newsize="12">Back to regular text.';
Note that there is not a closing tag for "setwidth" so you'll need to set it back to the original width if you don't intend for everything that follows it to have a width of 9 points. You could also create a function to do this for you:
Code:
function SetWidth(text, percentage, size) {
  var size = size || 12;
  var percentage = percentage || 1;
  var width = size*percentage;
  return '<setwidth newsize="' + width + '">' +
    text + '<setwidth newsize="' + size + '">';
}

return 'some regular text' + SetWidth('some text that is 75% the width', 0.75, 12) + 'some regular text ' + SetWidth('some text 150% wider', 1.5, 12);
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote
  #3  
Old April 13th, 2016, 09:24 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,305
Default Re: Horizontal Scale of Font

Quote:
Originally Posted by step View Post
Note that there is not a closing tag for "setwidth" so you'll need to set it back to the original width if you don't intend for everything that follows it to have a width of 9 points. You could also create a function to do this for you:
Or you could just do this:
Code:
return 'Regular text <magnify type=setwidth factor=75>text that is 75% the width. </magnify>Back to regular text.';
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #4  
Old April 14th, 2016, 05:31 AM
DSweet's Avatar
DSweet DSweet is offline
Senior Contributor
 
Join Date: Sep 2008
Location: Oberlin, Ohio
Posts: 240
Default Re: Horizontal Scale of Font

So the "magnify" closing tag will shut off ALL attributes that are set after the opening tag? No matter how many or what style? Or do you still need the closing tags for styles such as "bold" or "superscript"? What about settings such as a temporary setting for the superscript size and offset?

Or does "magnify" just create a sort of formatting sub-routine section and the closing magnify tag simply closes this sub-routine and reverts the style and settings back to those of the original text box?
.
__________________
David A. Sweet
Variable Data Specialist
HKM Direct Market Communications
Windows 7, Acrobat 10.x
FusionPro Desktop and Server 10.0.26
Reply With Quote
  #5  
Old April 14th, 2016, 06:45 AM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Horizontal Scale of Font

Quote:
Originally Posted by Dan Korn View Post
Or you could just do this:
Code:
return 'Regular text <magnify type=setwidth factor=75>text that is 75% the width. </magnify>Back to regular text.';
Sure, but where's the difficulty in that?

Quote:
Originally Posted by DSweet View Post
So the "magnify" closing tag will shut off ALL attributes that are set after the opening tag? No matter how many or what style? Or do you still need the closing tags for styles such as "bold" or "superscript"? What about settings such as a temporary setting for the superscript size and offset?

Or does "magnify" just create a sort of formatting sub-routine section and the closing magnify tag simply closes this sub-routine and reverts the style and settings back to those of the original text box?
I'd say it's closer to the latter of those two options. The "magnify" tag doesn't really alter the values of any previously set tags, it just applies magnification (pardon the redundancy) of a certain type – text, textwidth, textheight, leading, or tracking. I believe it's the tag that FusionPro applies behind the scenes when a text flow is copy-fitted. More information can be found on page 66-67 of the TagsRefGuide.pdf of the FP documentation.
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote
  #6  
Old April 14th, 2016, 09:59 AM
traba5058 traba5058 is offline
Regular Contributor
 
Join Date: Jan 2012
Location: Atlanta, GA
Posts: 77
Default Re: Horizontal Scale of Font

Thanks for all of the help!

I used the following and it worked:
Code:
if (Field("Address") != "")
    return '<magnify type=textwidth factor=75><z newsize=8.06>'+ Field("Address")+'</magnify>';
    else return ""
Reply With Quote
Reply

Tags
font, format, scale, text

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:06 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.