Jump to content

Get or list what FP will use for a font name?


kentbaker

Recommended Posts

Hello all,

 

Wondering if there is a way to get the "name" that Fusion Pro will see as loaded. For example, in Acrobat Javascript, I would make a field Text1, set some type and assign the font. Then execute

this.getField("Text1").textFont

and get the PDSysFont that I could then name in my Acrobat javascript. This method has not worked to "get" the font name that FP will use. Anything like this available for FP?

 

Thanks in advance

Link to comment
Share on other sites

I don't understand. What are you actually trying to do? Are you trying to figure out what font FusionPro is going to use to set some particular variable text? What text are you trying to examine? Is it from a resource, or is it just typed into the Text Editor for a text frame? What do you intend to do with the font name if you determine it?
Link to comment
Share on other sites

I tried to use a font in a CopyfitLine rule

return CopyfitLine("", ToUpper(Field("Bulk Products")), "ClearviewATT-BoldItalic", 11, 450, 7);

it errors and says the font in not loaded. In a text frame editor, I can select the font as ClearviewATT LT and then select the Bold and Italic attributes.

 

In order to get what I needed, I used

return CopyfitLineWithMagnifyTag('<f name="ClearviewATT LT"><b><i>'+ ToUpper(Field("Bulk Products")), 270);

I am trying to get the font name that I need to specify in the CopyfitLine Rule so that it would work. So, maybe its specific to this font (the LT family has the bold, bold italic in FP, but my font manager sees ClearviewATT as the family name). But I imagine other fonts will give me trouble some day.

 

That said, I am wondering if there is a way to get the name of a loaded font so that I could use it in a CopyfitLine rule.

Link to comment
Share on other sites

Ah, I see. There are two ways to find the font name to use in a <f name="***"> tag, or in a call such as CopyfitLine or FusionProTextMeasure. One way is to look in the .DIF (format/layout) file.

 

The other way is to create a Formatted Text Resource, type in some text, select the font (and any other attributes for which you want to figure out the tagging), click OK, and then "View Source." This will show you the tagged markup generated by the Text Editor, which will show the "internal" name of the font as used by FusionPro, which may be different than the display name. (You don't need to save the Formatted Text Resource.)

 

Also, in FusionPro, the font name is the font family name, which encompassed all "faces" of the font (normal, bold, italic, bold+italic). So you'll still need to prepend the <b> and <i> tags to your text in order to get the right result. Or you could make your own version of CopyfitLine which takes parameters and set the .bold and .italic properties of the FusionProTextMeasure object. (You can copy the function from Builtins.js to a new function in your rule or in your JavaScript Globals. But please do not modify Builtins.js.)

Link to comment
Share on other sites

Good Info. Well, I had the PS name correct when trying to use CopyfitLine, which returned the error. Am I mistaken or am I able to use tags with CopyfitLine? Is this where I need to understand what and where to prepend with <b><i>?
Link to comment
Share on other sites

Good Info. Well, I had the PS name correct when trying to use CopyfitLine, which returned the error. Am I mistaken or am I able to use tags with CopyfitLine? Is this where I need to understand what and where to prepend with <b><i>?

Yes, you can use tags. You basically do what you were doing before:

return CopyfitLine("", '<b><i>' + ToUpper(Field("Bulk Products")), "Clearview ATT", 11, 450, 7);

Changing the font name as appropriate based on my previous instructions, of course.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...