Fonts
Properties
isSubstitute returns true are always sorted to the end as individual family groups.familyName. To clear the list, assign an empty array.allFonts.postScriptName and their relative order. Returns an array in which each element is an array of Font objects, where the 0th element is considered the primary Font object for that PostScript name.true disables that sync/install attempt.familyName. To clear the list, assign an empty array.prefix string and a values array of related strings for that prefix.Instance Methods
findFirstFontByFamilyNameAndStyleNameWithFallback
Returns: { font: Font; matched: boolean }
Since: 27.0
Looks up a font by family name and style name, always returning a { font, matched } object. matched is true if an exact match was found; font is populated with a fallback Font even when matched is false.
Parameters
getCTScriptForString
Returns: { ctScript: number; chars: number }[]
Since: 27.0
Returns an array of objects describing how many characters in the given string fall under each CTScript value. If a character could belong to more than one CTScript, preferredCTScript breaks the tie. Returns an empty array if charString is empty.
Parameters
getDefaultFontForCTScript
Returns: Font
Since: 27.0
Returns the Font instance mapped as the default font for the given CTScript. After Effects uses this mapping when a font is missing a glyph for a typed character, mapping the character to a CTScript value and using this default to pick an alternate font. There's no guarantee the returned font supports any of the Unicode characters mapped to that CTScript.
Parameters
getFontByID
Returns: Font
Since: 27.0
Returns the Font instance matching a previously found font's ID. Returns undefined if no matching font is found (e.g. an unknown ID, or the original font was removed from the font environment).
Parameters
getFontsByFamilyNameAndStyleName
Returns: Array
Since: 27.0
Returns an array of Font objects matching the given family name and style name. Returns an empty array if no suitable font is found. The array can have more than one entry if multiple copies of the same font are installed.
Parameters
getFontsByPostScriptName
Returns: Array
Since: 27.0
Returns an array of Font objects matching the given PostScript name. The entry at index 0 is used when setting TextDocument.fontObject. Returns an empty array if no matching font is found.
Parameters
pollForAndPushNonSystemFontFoldersChanges
Returns: boolean
Since: 27.0
Triggers a check against the known non-system font folders (unlike system font folders, these aren't watched automatically) and schedules an asynchronous font-environment update if a change is detected. Returns true if a change was detected and an update was scheduled, false otherwise.
setDefaultFontForCTScript
Returns: boolean
Since: 27.0
Sets the Font instance mapped as the default font for the given CTScript. Variable fonts aren't acceptable as defaults and throw an exception. Pass null for font to reset the mapping back to its value at app launch. Returns true if the mapping changed, false if it was already set to the given value.
Parameters
null, resets the mapping to its value at app launch.