Change a Font
In a forms-based document users may need to stylize text by selecting a font from a drop-down menu. Such a menu can be created using a list variable that contains a list of all the fonts you offer to users. It is essential that these fonts are embedded in the original InDesign document that was used to create the customizable product. Below is the code of an action that alternates the font for the paragraph style 'Subtitle' between Arial and Myriad, depending on the choice made in a list variable called 'font'.
Action type: On Change
Variable type: List
Action code:
1 if variable font selectedItemName is string Arial
2 set paragraphStyle Subtitle font = font Arial Regular id
3 else if variable font selectedItemName is string Myriad
4 set paragraphStyle Subtitle font = font Myriad Web Pro Regular id
5 end if
doc. version 6.0.4