Jump to content

Font usage in CopyfitLine rule


MeeshKB

Recommended Posts

I am using CopyfitLine to fit the name field on a business card. The font used is Frutiger 57Cn with bold applied. My fonts.ini file indicates that FP uses Frutiger-BlackCn to accomplish the bold.

 

But when I apply that font to the CopyfitLine rule it errors, saying that Frutiger-BlackCn is not a loaded font.

 

Any thoughts on what I'm missing here? A screenshot of the rule, error and fonts.ini is attached.

Frutiger-BlackCn.thumb.jpg.125c6ec87085783fc7997571226b7eff.jpg

Link to comment
Share on other sites

I can't tell from the screen shot what the font family name is in fonts.ini. It would be a bit more helpful to copy and paste the relevant line from fonts.ini. At any rate, usually it's the first entry on the line in fonts.ini which is the font name you need to use.

 

The way to know for sure what font name to use is this: Open the Resources dialog, click Add, select "Formatted Text" in the Type drop-down, click Edit, select the font you want and type some text, then click OK in the Text Editor dialog, and back in the Resource Editor dialog, click "View Source." Near the end of all the markup, right before the text you type, there will be a tag <f name="***">, where the font name in "***" is the name of the font you need to use in other tagging, or in functions such as CopyfitLine which use tagged markup.

Link to comment
Share on other sites

Thomas, that did indeed work perfectly. Solved my problem. Thank you.

 

Dan, thanks too for your reply. I did try your trick of creating some formatted text and viewing the source. What I found was that no matter the style I applied, it simply said that "Frutiger 57Cn" was the font used.

 

A question to both...am I mistaken in thinking that usually one would put the specific font style in the CopyfitLine rule, instead of adding the style via tag? Clearly that method works in this case, but I had thought that the best practice was to use the specific font style.

 

Am I overthinking it?

Link to comment
Share on other sites

Dan, thanks too for your reply. I did try your trick of creating some formatted text and viewing the source. What I found was that no matter the style I applied, it simply said that "Frutiger 57Cn" was the font used.

Yes, that's right. FusionPro uses font families. If you want to pick a different "style" or "face" of a font, such as bold, italic, or bold+italic, you click the B and I buttons in the Text Editor, or use <b> and <i> tags in markup, and you should see those tags in the "View Source" dialog as well. The font name in the <f name="***"> tag is always the family name.

 

If you look at the CopyfitLine rule in the Builtins.js file, you can see that it's building up the <f name="***"> tag in there.

A question to both...am I mistaken in thinking that usually one would put the specific font style in the CopyfitLine rule, instead of adding the style via tag? Clearly that method works in this case, but I had thought that the best practice was to use the specific font style.

Yes, you are mistaken. You never call out fonts by their style-specific or PostScript names in FusionPro. You always use the font family name, and specify bold or italic "style flags" as necessary, with the buttons in the Text Editor or with <b> and <i> markup tags.

Am I overthinking it?

Well, you may be overthinking it a little. But I suppose this is actually a flaw in the CopyfitLine function. There should probably be extra parameters to specify whether you want bold and/or italic, although the multitude of parameters to CopyfitLine are already kind of confusing.

 

My CopyfitLineWithMagnifyTag function doesn't have all those parameters, so you have to use tagging to specify the font family and style flags, as well as the point size.

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...