Jump to content

CopyFit Rule and TrueType Fonts


Recommended Posts

Is it just me or does anyone else have issues with the copy fit rule and true type fonts?

 

I just realized that using the bold or italic version of a truetype font and trying to copy fit that line, creates an error. But if I switch the truetype font out for a postscript font, then the script works.

 

Did I miss a warning about truetype fonts with Fusion Pro scripts.

Link to comment
Share on other sites

No, there's no problem with TrueType fonts and copyfitting.

 

In order to analyze your specific problem, I need more information:

  1. When you say "the copy fit rule", do you mean you're using full-flow copyfitting with the OnCopyfit callback rule, or do you mean you're calling the CopyfitLine function in a non-callback rule?
  2. If it's the CopyfitLine function, what exactly are the parameters you're passing? Most importantly, what is the font name in the third parameter, and are you including any <b> or <i> tags in the second parameter (the dynamic text)?
  3. What exactly is the error?
  4. Your fonts.ini file would also be helpful in this analysis.

I suspect that you're calling out a bold or italic style of the True Type font family, and that you don't have a "regular" or "normal" style in that font family. You probably have the whole family (which is four styles: "regular" or "normal", bold, italic, and bold + italic) in the PostScript font, which is why you don't get the error there.

 

Again, it's hard to say exactly what you need to do to fix this without seeing exactly what you're doing in the rule, what the error is, and what fonts you have loaded (from the fonts.ini file), but you probably can avoid the problem by making sure you have all of the styles of the font, especially the Regular (non-bold and non-italic) style. There are some fixes in patch releases of FusionPro 10 which may help with this as well.

Link to comment
Share on other sites

  • 1 month later...

Dan,

 

sorry for the delay in this, I was able to avoid the issue, but it is back.

 

This is the CopyFitLine script I am using. Nothing Fancy. No Bold, no italic. Just the straight up font.

//If Email is NOT blank, execute the following statement
//If Email does not exist, return nothing

if (Field("Email") != "")

   return CopyfitLine("", Field("Email")+ "@" +Field("emailDomain"), "Century Gothic", 9, 140, 4, true);
   else
   return "";

And says it validates in FusionPro.

http://xpressfiles.printingpartners.net/valid.png

Except in FusionPro, the preview shows the red line because it oversets. So it is not working.

 

The font I am using is CenturyGothic.ttf

If I switch the font to a Postscript font, anyone you want. It works.

 

If I compose I get this error:

*********

Composing record #1, input record 1

Word <joe.sample@GreystonePMC.com> does not fit in frame after line 0.

The amount of text inserted into a flow exceeds the depth

of all frames in the flow <>. Text is truncated.

Text does not fit in the last frame on page 1 at (0.19, 1.56).

*********

 

Which is correct, it has failed.

 

This only happens with TrueType Fonts. The font is loaded on my Mac. It has been loaded into FusionPro.

 

I am running FusionPro Creator 10.0.3 on a Mac.

Link to comment
Share on other sites

If I switched from CenturyGothic.ttf

To an OpenType version (still truetype) it works.

 

The only thing I can think of is that our type library is too old. The CenturyGothic TTF has a 1991 Copyright version 2.35. The OpenType TTF is newer.

 

Could that be it? The old font works for all my other applications and prints fine.

Link to comment
Share on other sites

If I switched from CenturyGothic.ttf

To an OpenType version (still truetype) it works.

What do you mean you "switched?" Did you uninstall the old font, install the new one, and then re-load all fonts in FusionPro?

 

If you didn't re-load all fonts, then yeah, of course this didn't work, because FusionPro is using cached information from the old font.

The only thing I can think of is that our type library is too old. The CenturyGothic TTF has a 1991 Copyright version 2.35. The OpenType TTF is newer.

FusionPro can handle old fonts just fine. If it can typeset with the font, it should be able to measure text with it.

Could that be it? The old font works for all my other applications and prints fine.

It's impossible for me to say without having the job files, including the font. However, posting proprietary fonts to this public forum is not allowed. You could send the job, and the font in question, to Support. But I suspect there's nothing wrong with the font itself, and that the problem is a user error, specifically a failure to properly load it into FusionPro.

Link to comment
Share on other sites

Dan,

 

I uninstalled the old font from my system. Installed the new one. And re-loaded everything into FusionPro. Quit and re-started Acrobat and FusionPro.

 

And if it was just one font, why is it doing it with all of my TrueType fonts.

 

 

With 30 years experience working with fonts and typesetting. I do know what I am doing when it comes to fonts. Thanks.

Edited by Printing Partners
Link to comment
Share on other sites

I uninstalled the old font from my system. Installed the new one. And re-loaded everything into FusionPro. Quit and re-started Acrobat and FusionPro.

 

And if it was just one font, why is it doing it with all of my TrueType fonts.

 

 

With 30 years experience working with fonts and typesetting. I do know what I am doing when it comes to fonts. Thanks.

Sorry, no offense intended. It's just that I've learned to double-check these kinds of things, because sometimes assumptions are made and terminologies are misunderstood.

 

As for what's going wrong, again, that's impossible for me to analyze without the job files and the font.

 

It's possible that the size you're specifying doesn't exactly match the frame. It may be more reliable to name the frame, check the "Re-evaluate this rule for every text flow" box, and do this:

if (!Field("Email")
   return "";
var widthInPoints = FindTextFrame(FusionPro.Composition.CurrentFlow.name).GetSettableTextWidth() / 100;
return CopyfitLine("", Field("Email") + "@" +Field("emailDomain"), "Century Gothic", 9, widthInPoints, 4, true);

You might also consider using my "Better CopyfitLine" function from here:

http://forums.pti.com/showthread.php?t=84

Like so:

if (!Field("Email")
   return "";
var widthInPoints = FindTextFrame(FusionPro.Composition.CurrentFlow.name).GetSettableTextWidth() / 100;
var line = '<f name="Century Gothic"><z newsize=9>' + TaggedDataField("Email") + "@" + TaggedDataField("emailDomain");
return CopyfitLineWithMagnifyTag(line, widthInPoints);

function CopyfitLineWithMagnifyTag(line, widthInPoints, AllowToExpand)
{
   var tm = new FusionProTextMeasure;
   tm.CalculateTextExtent(line);
   if (tm.messages)
       ReportError("CopyfitMagnifyLine: " + tm.messages);

   if (tm.textWidth < widthInPoints*100 && !AllowToExpand)
       return line;

   var factor = Round(widthInPoints / tm.textWidth * 10000, 0) - 1;
   return "<magnify type=setwidth factor=" + factor + ">" + line + "</magnify>";
}

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...