characterStyle(textOrName, [props])

Returns the character style of a given text object or the character style with the given name. If a character style of the given name does not exist, it gets created. Optionally a props object of property name/value pairs can be used to set the character style’s properties.

Type: function

Parameter(s):

  • textOrName {Text | String}:

    A text object whose style to return or the name of the character style to return.

  • props {Object} Optional:

    Optional: An object of property name/value pairs to set the style’s properties.

Returns:

  • {CharacterStyle}:

    The character style instance.