• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to check font file extensions used in After Effects project layers

Community Beginner ,
May 04, 2023 May 04, 2023

Copy link to clipboard

Copied

Hi all,

I'm looking for a solution to check the font file extensions used in text layers within an After Effects project. I need to identify which font types are being used by the user, such as .ttc, .ttf, or .otf. The reason for this requirement is that our server does not accept .ttc files.

I have tried using ExtendScript and Adobe CEP to access the font properties in the text layers, but I haven't found a direct way to get the font file extensions.

Could anyone please provide guidance or a solution to check the font file extensions used in the text layers of an After Effects project? I would greatly appreciate any help or suggestions.

Thank you in advance!
Below is what I found in layers, but there is only "value" with text and can't find "font"

> app.project.item(2).layer(1).property('sourceText')
{
 "methods": [
  {
   "name": "==()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "addKey()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "addToMotionGraphicsTemplate()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "addToMotionGraphicsTemplateAs()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "canAddToMotionGraphicsTemplate()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "duplicate()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "getSeparationFollower()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "isInterpolationTypeValid()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "keyInInterpolationType()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "keyInSpatialTangent()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "keyInTemporalEase()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "keyLabel()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "keyOutInterpolationType()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "keyOutSpatialTangent()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "keyOutTemporalEase()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "keyRoving()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "keySelected()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "keySpatialAutoBezier()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "keySpatialContinuous()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "keyTemporalAutoBezier()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "keyTemporalContinuous()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "keyTime()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "keyValue()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "moveTo()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "nearestKeyIndex()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "propertyGroup()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "remove()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "removeKey()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setAlternateSource()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setInterpolationTypeAtKey()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setLabelAtKey()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setPropertyParameters()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setRovingAtKey()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setSelectedAtKey()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setSpatialAutoBezierAtKey()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setSpatialContinuousAtKey()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setSpatialTangentsAtKey()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setTemporalAutoBezierAtKey()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setTemporalContinuousAtKey()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setTemporalEaseAtKey()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setValue()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setValueAtKey()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setValueAtTime()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "setValuesAtTimes()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  },
  {
   "name": "valueAtTime()",
   "type": "any",
   "isMethod": true,
   "hasErr": false
  }
 ],
 "active": true,
 "canSetExpression": true,
 "canVaryOverTime": true,
 "enabled": true,
 "isModified": true,
 "matchName": "ADBE Text Document",
 "maxValue": "Error: After Effects error: This property has no maximum value.",
 "minValue": "Error: After Effects error: This property has no minimum value.",
 "name": "Source Text",
 "parentProperty": "[object PropertyGroup]",
 "propertyDepth": 2,
 "propertyIndex": 1,
 "propertyType": 6212,
 "propertyValueType": 6424,
 "separationDimension": "Error: After Effects error: internal verification failure, sorry! {stream isn't separated in AEGP_GetSeparationLeader}",
 "separationLeader": "Error: After Effects error: internal verification failure, sorry! {stream isn't separated in AEGP_GetSeparationLeader}",
 "value": "10 sec Orange"
}
TOPICS
Scripting

Views

543

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 04, 2023 May 04, 2023

Copy link to clipboard

Copied

AFAIK you can't. Once the font is used it's just another font/ set of glyphs and the container format is irrelevant. It#s again one of those "black box" Adobe Font Engine things. Perhaps there's a workaround with BridgeTalk and using font functions from InDesign and Illustrator, but even then you will likely need a ton of code to get the actual font names and panose names and figure out where the files are stored.

 

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 08, 2023 May 08, 2023

Copy link to clipboard

Copied

LATEST

Thanks @Mylenium for answare. I found a solution, not a workaround :). in textDocument.fontLocation is a full patch to font with extensions like .ttc, .otf and others.

function checkForTTCFonts() {
  var ttcFonts = [];

  for (var i = 1; i <= app.project.numItems; i++) {
    var item = app.project.item(i);

    if (item instanceof CompItem) {
      for (var j = 1; j <= item.numLayers; j++) {
        var layer = item.layer(j);

        if (layer.property('sourceText') !== null) {
          var textDocument = layer.property('sourceText').value;
          var fontLocation = textDocument.fontLocation;
          var fontExtension = fontLocation.split('.').pop();

          if (fontExtension.toLowerCase() === 'ttc') {
            var fontFamily = textDocument.font;
            if (ttcFonts.indexOf(fontFamily) === -1) {
              ttcFonts.push(fontFamily);
            }
          }
        }
      }
    }
  }

  if (ttcFonts.length > 0) {
    return 'Your template is using a not Windows compatible font, we only support fonts with the extension .tff and .otf. Please change: '.concat(
      ttcFonts.join(', '),
    );
  } else {
    return '';
  }
}

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines