PDA

View Full Version : I'm Having Trouble With Copyfitting Rule


MikeVM
April 16th, 2009, 10:03 AM
Trying to use Copyfit ule for different frames:
- for frame BCKHD I need to set tracking between 105 and 125% (assuming that 100% is regular tracking). Default tracking for this frame is 125%;
- for frame WWW - copyfit web address (font size between 7 and 9 pt;
- for any other frames with applied copyfitting rule - copyfit text.


if (FusionPro.Composition.CurrentFlow.name == "BCKHD")
{
if (!Copyfit(new MagnifyAttributes("tracking", 105, 125, 0, 0)))
ReportWarning("Could not copyfit text in flow " +
FusionPro.Composition.CurrentFlow.name);
}

if (FusionPro.Composition.CurrentFlow.name == "WWW")
{
if (!Copyfit(new MagnifyAttributes("text", 25, 400, 7, 9)))
ReportWarning("Could not copyfit text in flow " +
FusionPro.Composition.CurrentFlow.name);
}
else
{
if (!Copyfit(new MagnifyAttributes("text", 25, 400, 10.75, 13)))
ReportWarning("Could not copyfit text in flow " +
FusionPro.Composition.CurrentFlow.name);
}

This is what I get - instead of adjusting tracking in the frame BCKHD the rule adjust text size - which I do not want to happen!

Any help?

tobarstep
April 17th, 2009, 08:09 AM
if (FusionPro.Composition.CurrentFlow.name == "BCKHD")
{
if (!Copyfit(new MagnifyAttributes("tracking", 105, 125, 0, 0)))
ReportWarning("Could not copyfit text in flow " +
FusionPro.Composition.CurrentFlow.name);
}

if (FusionPro.Composition.CurrentFlow.name == "WWW")
{
if (!Copyfit(new MagnifyAttributes("text", 25, 400, 7, 9)))
ReportWarning("Could not copyfit text in flow " +
FusionPro.Composition.CurrentFlow.name);
}
else
{
if (!Copyfit(new MagnifyAttributes("text", 25, 400, 10.75, 13)))
ReportWarning("Could not copyfit text in flow " +
FusionPro.Composition.CurrentFlow.name);
}

This is what I get - instead of adjusting tracking in the frame BCKHD the rule adjust text size - which I do not want to happen!


Your "else" clause is still executing for anything not a "WWW" frame, including the "BCKHD".

Try this (I did this in Notepad, so there may be syntax errors, didn't have time to check it.).


switch (FusionPro.Composition.CurrentFlow.name){
case "BCKHD":
if (!Copyfit(new MagnifyAttributes("tracking", 105, 125, 0, 0))){
ReportWarning("Could not copyfit text in flow " +
FusionPro.Composition.CurrentFlow.name);}
break;

case "WWW":
if (!Copyfit(new MagnifyAttributes("text", 25, 400, 7, 9))){
ReportWarning("Could not copyfit text in flow " +
FusionPro.Composition.CurrentFlow.name);}
break;

default:
if (!Copyfit(new MagnifyAttributes("text", 25, 400, 10.75, 13))){
ReportWarning("Could not copyfit text in flow " +
FusionPro.Composition.CurrentFlow.name);}
}

MikeVM
April 17th, 2009, 08:36 AM
Thanks I'll try later