Jump to content

multiple fonts in one variable


Matt Centa

Recommended Posts

Posted

I have an address line were the numbers are one font and the physical address behind it is another font. I do not know how to go about this. It currently forces it to one font. The numbers are Whitney-BookSC and the address is Whitney-Book.

 

3711 MoPac Expwy.

 

I'm using a Mac 10.5.8

Acrobat 9.4.1

FusionPro 7.1P1c

Posted

One way to do this would be to make 2 rules and divide your address up into 2 different elements...

 

NUMBER RULE

position = Field("Address").indexOf(" ");

return Field("Address").slice (0,position);

 

STREET RULE

position = Field("Address").indexOf(" ");

return Field("Address").slice (position);

 

Then just format your NUMBER RULE to Whitney-BookSC and STREET RULE to Whitney-Book.

 

My Rule is looking for the first space in the Address field to decide where to split it. You will have to look at your data and decide if that will work for your specific data or not.

Posted
I would like to be able to keep this as one element and not have to break it up. Is there a way to string these two rules together. to say if it contains a numeric value assign it Whitney-BookSC else Whitney-Book.
Posted
I suppose you could try a rule that loops the length of the field, compares each character to determine what it is, and build some sort of tagged text item with fonts embedded to return.
Posted
I would like to be able to keep this as one element and not have to break it up. Is there a way to string these two rules together. to say if it contains a numeric value assign it Whitney-BookSC else Whitney-Book.

return NormalizeEntities(Field("Address")).replace(/\d+/g, '<f name="Whitney-BookSC">$&</f>');

If you give your rule the same name as the data field ("Address" in this example), the rule will be used instead of the field when that variable name is referenced in a text frame.

Archived

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

×
×
  • Create New...