Font object¶
Note
This functionality was added in After Effects 24.0
Description¶
The Font object provides information about a specific font, along with the font technology used, helping disambiguate when multiple fonts sharing the same Postscript name are installed on the system.
Most of these APIs simply return information which is contained in the Font data file itself, seek more information there.
Attributes¶
FontObject.designAxesData¶
app.fonts.allFonts[0][0].designAxesData
Description¶
Returns an Array of Objects, containing the design axes data from the font.
Each object is composed of the axis name, tag, min value and max value.
Tip
Will return undefined for non-variable fonts.
Example¶
This example will select the first returned Font Family Array.
// Getting the first available Variable Font on the system
var firstVariableFont = fontsWithDefaultDesignAxes[0];
var axesData = firstVariableFont.designAxesData;
// Getting the first design axis for that Font
var firstAxis = axesData[0];
alert(firstAxis.name+"\n"+firstAxis.tag+"\n"+firstAxis.min+"\n"+firstAxis.max);
Type¶
Array of Objects; read-only.
FontObject.designVector¶
app.fonts.fontsWithDefaultDesignAxes[0].designVector
Description¶
For Variable fonts will return an ordered array with a length matching the number of design axes defined by the font.
Tip
Will return undefined for non-variable fonts.
Type¶
Array of floating-point values; read-only.
FontObject.familyName¶
app.fonts.allFonts[0][0].familyName
Description¶
The family name of the font, in the ASCII character set.
Type¶
String; read-only.
FontObject.familyPrefix¶
app.fonts.fontsWithDefaultDesignAxes[0].familyPrefix
Description¶
The family prefix of the variable font. For example, the family of the PostScript name "SFPro-Bold" is "SFPro".
Tip
Will return undefined for non-variable fonts.
Type¶
String; read-only.
FontObject.fontID¶
app.fonts.allFonts[0][0].fontID
Note
This functionality was added in After Effects 24.2
Description¶
A unique number assigned to the FontObject instance when it is created, value is greater than or equal to 1. It never changes during the application session but may be different in subsequent launches of the application.
Can be used to compare two FontObject instances to see if they refer to the same underlying native font instance.
FontObjects can be looked up by fontID with getFontByID .
Type¶
Integer; read-only.
FontObject.fullName¶
app.fonts.allFonts[0][0].fullName
Description¶
The full name of the font, in the ASCII character set. Usually composed of the family name and the style name.
Type¶
String; read-only.
FontObject.hasDesignAxes¶
app.fonts.allFonts[0][0].hasDesignAxes
Description¶
Returns true if the font is a variable font.
Type¶
Boolean; read-only.
FontObject.isFromAdobeFonts¶
app.fonts.allFonts[0][0].isFromAdobeFonts
Description¶
Returns true if the font is from Adobe Fonts.
Type¶
Boolean; read-only.
FontObject.isSubstitute¶
app.fonts.allFonts[0][0].isSubstitute
Description¶
returns true when this font instance represents a font reference which was missing on project open.
Type¶
Boolean; read-only.
FontObject.location¶
app.fonts.allFonts[0][0].location
Description¶
The location of the font file on your system.
Warning
Not guaranteed to be returned for all font types; return value may be empty string for some kinds of fonts.
Type¶
String; read-only.
FontObject.nativeFamilyName¶
app.fonts.allFonts[0][0].nativeFamilyName
Description¶
The native family name of the font in full 16 bit Unicode. Often different than what is returned by FontObject.familyName for non-Latin fonts.
Type¶
String; read-only.
FontObject.nativeFullName¶
app.fonts.allFonts[0][0].nativeFullName
Description¶
The native full name of the font in full 16 bit Unicode. Often different than what is returned by FontObject.fullName for non-Latin fonts.
Type¶
String; read-only.
FontObject.nativeStyleName¶
app.fonts.allFonts[0][0].nativeStyleName
Description¶
The native style name of the font in full 16 bit Unicode. Often different than what is returned by FontObject.styleName for non-Latin fonts.
Type¶
String; read-only.
FontObject.otherFontsWithSameDict¶
app.fonts.fontsWithDefaultDesignAxes[0].otherFontsWithSameDict
Note
This functionality was added in After Effects 25.1
Description¶
Returns an Array of Font object instances which share the same font dictionary as this Font object.
Will return an empty Array if this Font object is not a Variable font, or the Variable font only has one instance.
Type¶
Array of Font objects; read-only.
FontObject.postScriptName¶
app.fonts.allFonts[0][0].postScriptName
Description¶
The postscript name of the font.
Type¶
String; read-only.
FontObject.styleName¶
app.fonts.allFonts[0][0].styleName
Description¶
The style name of the font, in the ASCII character set.
Type¶
String; read-only.
FontObject.technology¶
app.fonts.allFonts[0][0].technology
Description¶
The technology used by the font.
Type¶
An CTFontTechnology enumerated value; read-only. One of:
CTFontTechnology.CT_TYPE1_FONTCTFontTechnology.CT_TRUETYPE_FONTCTFontTechnology.CT_CID_FONTCTFontTechnology.CT_BITMAP_FONTCTFontTechnology.CT_ATC_FONTCTFontTechnology.CT_TYPE3_FONTCTFontTechnology.CT_SVG_FONTCTFontTechnology.CT_ANYTECHNOLOGY
FontObject.type¶
app.fonts.allFonts[0][0].type
Description¶
The internal type of the font.
Type¶
An CTFontType enumerated value; read-only. One of:
CTFontType.CT_TYPE1_FONTTYPECTFontType.CT_TRUETYPE_FONTTYPECTFontType.CT_CID_FONTTYPECTFontType.CT_ATC_FONTTYPECTFontType.CT_BITMAP_FONTTYPECTFontType.CT_OPENTYPE_CFF_FONTTYPECTFontType.CT_OPENTYPE_CID_FONTTYPECTFontType.CT_OPENTYPE_TT_FONTTYPECTFontType.CT_TYPE3_FONTTYPECTFontType.CT_SVG_FONTTYPE
FontObject.version¶
app.fonts.allFonts[0][0].version
Description¶
The version number of the font.
Type¶
String; read-only.
FontObject.writingScripts¶
app.fonts.allFonts[0][0].writingScripts
Description¶
The supported character sets of the font.
Type¶
An array of CTScript enumerated values; read-only. One or more of:
CTScript.CT_ROMAN_SCRIPTCTScript.CT_JAPANESE_SCRIPTCTScript.CT_TRADITIONALCHINESE_SCRIPTCTScript.CT_KOREAN_SCRIPTCTScript.CT_ARABIC_SCRIPTCTScript.CT_HEBREW_SCRIPTCTScript.CT_GREEK_SCRIPTCTScript.CT_CYRILLIC_SCRIPTCTScript.CT_RIGHTLEFT_SCRIPTCTScript.CT_DEVANAGARI_SCRIPTCTScript.CT_GURMUKHI_SCRIPTCTScript.CT_GUJARATI_SCRIPTCTScript.CT_ORIYA_SCRIPTCTScript.CT_BENGALI_SCRIPTCTScript.CT_TAMIL_SCRIPTCTScript.CT_TELUGU_SCRIPTCTScript.CT_KANNADA_SCRIPTCTScript.CT_MALAYALAM_SCRIPTCTScript.CT_SINHALESE_SCRIPTCTScript.CT_BURMESE_SCRIPTCTScript.CT_KHMER_SCRIPTCTScript.CT_THAI_SCRIPTCTScript.CT_LAOTIAN_SCRIPTCTScript.CT_GEORGIAN_SCRIPTCTScript.CT_ARMENIAN_SCRIPTCTScript.CT_SIMPLIFIEDCHINESE_SCRIPTCTScript.CT_TIBETAN_SCRIPTCTScript.CT_MONGOLIAN_SCRIPTCTScript.CT_GEEZ_SCRIPTCTScript.CT_EASTEUROPEANROMAN_SCRIPTCTScript.CT_VIETNAMESE_SCRIPTCTScript.CT_EXTENDEDARABIC_SCRIPTCTScript.CT_KLINGON_SCRIPTCTScript.CT_EMOJI_SCRIPTCTScript.CT_ROHINGYA_SCRIPTCTScript.CT_JAVANESE_SCRIPTCTScript.CT_SUNDANESE_SCRIPTCTScript.CT_LONTARA_SCRIPTCTScript.CT_SYRIAC_SCRIPTCTScript.CT_TAITHAM_SCRIPTCTScript.CT_BUGINESE_SCRIPTCTScript.CT_BALINESE_SCRIPTCTScript.CT_CHEROKEE_SCRIPTCTScript.CT_MANDAIC_SCRIPTCTScript.CT_VAI_SCRIPTCTScript.CT_THAANA_SCRIPTCTScript.CT_BRAVANESE_SCRIPTCTScript.CT_BRAHMI_SCRIPTCTScript.CT_CARIAN_SCRIPTCTScript.CT_CYPRIOT_SCRIPTCTScript.CT_EGYPTIAN_SCRIPTCTScript.CT_IMPERIALARAMAIC_SCRIPTCTScript.CT_PAHLAVI_SCRIPTCTScript.CT_PARTHIAN_SCRIPTCTScript.CT_KHAROSHTHI_SCRIPTCTScript.CT_LYCIAN_SCRIPTCTScript.CT_LYDIAN_SCRIPTCTScript.CT_PHOENICIAN_SCRIPTCTScript.CT_PERSIAN_SCRIPTCTScript.CT_SHAVIAN_SCRIPTCTScript.CT_SUMAKKCUNEIFORM_SCRIPTCTScript.CT_UGARITIC_SCRIPTCTScript.CT_GLAGOLITIC_SCRIPTCTScript.CT_GOTHIC_SCRIPTCTScript.CT_OGHAM_SCRIPTCTScript.CT_OLDITALIC_SCRIPTCTScript.CT_ORKHON_SCRIPTCTScript.CT_RUNIC_SCRIPTCTScript.CT_MEROITICCURSIVE_SCRIPTCTScript.CT_COPTIC_SCRIPTCTScript.CT_OLCHIKI_SCRIPTCTScript.CT_SORASOMPENG_SCRIPTCTScript.CT_OLDHANGUL_SCRIPTCTScript.CT_LISU_SCRIPTCTScript.CT_NKO_SCRIPTCTScript.CT_ADLAM_SCRIPTCTScript.CT_BAMUM_SCRIPTCTScript.CT_BASSAVAH_SCRIPTCTScript.CT_NEWA_SCRIPTCTScript.CT_NEWTAILU_SCRIPTCTScript.CT_SCRIPTCTScript.CT_OSAGE_SCRIPTCTScript.CT_UCAS_SCRIPTCTScript.CT_TIFINAGH_SCRIPTCTScript.CT_KAYAHLI_SCRIPTCTScript.CT_LAO_SCRIPTCTScript.CT_TAILE_SCRIPTCTScript.CT_TAIVIET_SCRIPTCTScript.CT_DONTKNOW_SCRIPT
Methods¶
FontObject.hasGlyphsFor()¶
app.fonts.allFonts[0][0].hasGlyphsFor(charString)
Note
This functionality was added in After Effects 25.1
Description¶
Fonts do not contain glyphs for all possible ranges of Unicode and this method gives the caller the opportunity to query the Font about support for one or more characters.
Returns true if the font has a glyph for every character in the charString.
The character order does not matter, and in the case of a parameter string with more than one character, it is not possible though this API to determine which character had no glyph support.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
charString |
String | Text that will be checked for support in the Font object. |
Returns¶
Boolean.
FontObject.hasSameDict()¶
app.fonts.fontsWithDefaultDesignAxes[0].hasSameDict(fontObject)
Description¶
This function will true if the Font object passed as an argument shares the same variable font dictionary as the Font object the function is called on.
Tip
Can only return true when called on a variable Font object with the argument also being a Font object of a variable font.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
fontObject |
Font object | Object to check |
Returns¶
Boolean.
FontObject.postScriptNameForDesignVector()¶
app.fonts.fontsWithDefaultDesignAxes[0].postScriptNameForDesignVector([...vectorValues])
Description¶
This function will return the postscript name of the variable font for the specific design vectors passed as the argument.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
vectorValues |
Array of floating-point values | Values to check FontObject.designVector for the given variable font. |
Returns¶
A String.