Sorry about the text wrapping in the e-mail.
Be sure to have this line as a separate line...
function CopyfitLineHorizontal(str, font, size, width, minimum, justwidth)
---
David A. Sweet
Web Designer/Graphic Designer
HKM Direct Market Communications
A DirectConnectGroup Company
-----Original Message-----
From: David Sweet
Sent: Thursday, January 10, 2008 4:05 PM
To: FusionPro Users Forum
Subject: [fusionpro] RE: horizontal scaling
Ken
If you're familiar with the CopyFitLine function, try using this custom
function instead...
//set justwidth to true for horizontal scaling, false for changing point size
function CopyfitLineHorizontal(str, font, size, width, minimum, justwidth)
{
var tm = new FusionProTextMeasure;
tm.maxWidth = -1;
var newsize, retcode, i;
var trackInt = new Array(0, -1, -2, -3, -4, -5);
basetags = "<f name=\"" + font + "\">";
newsize = size;
i = 0;
do
{
tags = basetags;
tags += (justwidth) ? "<setwidth " : "<z ";
tags += "newsize=" + newsize + "><tracking newsize=" + trackInt[i] + ">" +
str;
retcode = tm.CalculateTextExtent(tags);
(i < 5) ? i++ : i=5;
if (tm.textWidth > width * 100)
newsize -= 0.1;
} while (newsize > minimum && tm.textWidth > width*100 && retcode == 0);
return tags; // + " " + tm.textWidth + " " + width*100;
}
Then create a text rule, with tags turned on, and pass...
str = data field containing the string to alter
font = the font (put it in quotes) using the name that FusionPro recognizes
size = the original point size you want to use
width = width of the text area you want to fit measured in points (72 pts = 1
in)
minimum = the smallest point size you want the text to be in.
justwidth = enter true if you want the text to be "narrowed" down to the
"minimum" sized entered, enter false if you want the actual font size shrunk.
Examples...
An entry in the rule such as...
return CopyfitLineHorizontal("This is an extra long string", "Arial", 10, 110,
9, true);
will return a string with the height of the font still at 10, but the width
narrowed slightly...
'<f name="Arial"><setwidth newsize=9.8><tracking newsize=-2>This is an extra
long string'
A similar entry with a false value for the justwidth...
return CopyfitLineHorizontal("This is an extra long string", "Arial", 10, 110,
9, false);
will return a string with the whole font size "lowered" not just narrowed...
'<f name="Arial"><z newsize=9.8><tracking newsize=-2>This is an extra long
string'
Good Luck.
---
David A. Sweet
Web Designer/Graphic Designer
HKM Direct Market Communications
A DirectConnectGroup Company
-----Original Message-----
From: Ken Brasher [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 10, 2008 3:01 PM
To: FusionPro Users Forum
Subject: [fusionpro] horizontal scaling
Is there a way to horizontally scale text in a text field?
Thanks for the help,
Ken
Ken Brasher
Graphics Manager
(208) 342-4141
[EMAIL PROTECTED]
http://www.blueprintsplus.com/WebFileXFR/Login.aspx
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.0/1216 - Release Date: 1/9/2008 10:16
AM
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
FusionPro 5.0 Now Available!
Variable text on a curve and soft drop-shadows for variable text
LIMITED TIME upgrade offer of $299 per license for current customers:
http://fusionpro.printable.com/store/upgrade
New licenses available for $599 each at:
http://fusionpro.printable.com/store/
All FusionPro 5.0 customers to receive FusionPro 5.1 with
Adobe Acrobat 8 and InDesign CS3 support when released for FREE.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
--
Users of FusionPro Desktop have unlimited free email support. Contact Printable
Support at [EMAIL PROTECTED]
--
View FusionPro Knowledge Base, FusionPro Samples at
www.printable.com/vdp/desktop.htm
--
You are currently subscribed to fusionpro as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
--
--
Note: All e-mail sent to or from this address will be received or otherwise
recorded by the e-mail recipients of this forum. It is subject to archival,
monitoring or review by, and/or disclosure to someone other than the recipient.
Our privacy policy is posted on www.printplanet.com
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.0/1216 - Release Date: 1/9/2008 10:16
AM
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.0/1216 - Release Date: 1/9/2008 10:16
AM
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
FusionPro 5.0 Now Available!
Variable text on a curve and soft drop-shadows for variable text
LIMITED TIME upgrade offer of $299 per license for current customers:
http://fusionpro.printable.com/store/upgrade
New licenses available for $599 each at:
http://fusionpro.printable.com/store/
All FusionPro 5.0 customers to receive FusionPro 5.1 with
Adobe Acrobat 8 and InDesign CS3 support when released for FREE.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
--
Users of FusionPro Desktop have unlimited free email support. Contact Printable
Support at [EMAIL PROTECTED]
--
View FusionPro Knowledge Base, FusionPro Samples at
www.printable.com/vdp/desktop.htm
--
You are currently subscribed to fusionpro as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
--
--
Note: All e-mail sent to or from this address will be received or otherwise
recorded by the e-mail recipients of this forum. It is subject to archival,
monitoring or review by, and/or disclosure to someone other than the recipient.
Our privacy policy is posted on www.printplanet.com
--