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

[Scripting Bug] in V24 Build 44 usedFonts Property doesn't work, When text layer is duplicated.

Contributor ,
Sep 10, 2023 Sep 10, 2023

Copy link to clipboard

Copied

app.project.usedFonts doesn't work Properly, If we duplicate a text layer and change the font of either one of the layers, It won't detect the old font used in the original layer. Even if we remove the layer which have the new font. It always shows us the removed font (second font). Not the font that remain in the project.

Bug Investigating
TOPICS
Bug , Error

Views

516

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

correct answers 1 Pinned Reply

Adobe Employee , Sep 11, 2023 Sep 11, 2023

Hi @Adirai Maji,

Thank you for reporting this issue. We are able to reproduce it as well and will be investigating a fix. Thanks for reporting this issue while the feature is still in Beta!

 

Cheers,

- John, After Effects Engineering Team  

Status Investigating

Votes

Translate

Translate
9 Comments
Adobe Employee ,
Sep 11, 2023 Sep 11, 2023

Copy link to clipboard

Copied

Hi @Adirai Maji,

Thank you for reporting this issue. We are able to reproduce it as well and will be investigating a fix. Thanks for reporting this issue while the feature is still in Beta!

 

Cheers,

- John, After Effects Engineering Team  

Status Investigating

Votes

Translate

Translate

Report

Report
Contributor ,
Sep 17, 2023 Sep 17, 2023

Copy link to clipboard

Copied

Hi @JohnColombo ,
Thank you for investigating the issue. I just want to add one more note to the issue, I've also found that if we duplicate a composition and change the font of text layers in either of the composition, usedFonts property doesn't detect old font.

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Sep 19, 2023 Sep 19, 2023

Copy link to clipboard

Copied

Thank you, @Adirai Maji! I've added this scenario to our internal ticket on this issue.

 

Cheers,

- John, After Effects Engineering Team 

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Dec 11, 2023 Dec 11, 2023

Copy link to clipboard

Copied

Hi @Adirai Maji

 

Sorry for the long delay in getting back to this - the per-character styling in TextDocument interfered.

 

Based on your report, I had to go re-derive the situation and discovered that I had some bad assumptions about using certain data.

 

I have a fix which is looking pretty promising but which is entangled in some other font bug fixes so I will get it all out as soon as I am confident it is stable and can update the docs.

 

Douglas Waterfall

After Effects Engineering

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Jan 26, 2024 Jan 26, 2024

Copy link to clipboard

Copied

Hi @Adirai Maji 

 

I am still actively working on this, it will not make it for the upcoming 24.2 release.

 

Douglas Waterfall

After Effects Engineering

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Mar 01, 2024 Mar 01, 2024

Copy link to clipboard

Copied

This has been finally been addressed as part of some related work involving font replacement - it will be available in beta build after 24.4.0/2.

 

The need to fix this, and its entanglement in other work is what has held up its progress towards full release. Please let us know if there are any remaining incorrect behaviors which you see.

 

Note that there has been breaking change in the JSON which is returned from usedFonts by the addition of a time field.

 

Previous:

{
    font: <Font Object>,
    layerIDs: [
        layerID0,
        layerID1,
        ...
    ],
}

 

New:

{
    font: <Font Object>,
    usedAt: [
        {
            layerID: <layerID0>,
            timeD: <time0>
        },
        {
            layerID: <layerID1>,
            timeD: <time1>
        },
    ]
}

 

To retrieve the TextDocument instance simply use the property method valueAtTime() instead of the traditional value().

 

The docs will be updated when the build appears.

 

Here is a little demo script:

(function () {

    var usedFontsV = app.project.usedFonts;

    var str = "UsedFonts:" + usedFontsV.length + "\n";

    for (var i = 0; i < usedFontsV.length; i++) {
        var font = usedFontsV[i].font;

        str += "[" + font.postScriptName + "]: [\n";

        var usedAt = usedFontsV[i].usedAt;

        for (var j = 0; j < usedAt.length; j++) {
            var layerID = usedAt[j].layerID;
            var timeD = usedAt[j].timeD;

            var layer = app.project.layerByID(layerID);
            var td = layer.property("Source Text").valueAtTime(timeD, true/*preExpressionB*/);
            var text = td.toString();

            str += "(" + layerID + "," + timeD + "):" + text + "\n";
        }

        str += "]\n";
    }

    alert(str);

    return usedFontsV.length;
})();

 

Douglas Waterfall

After Effects Engineering

 

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Mar 15, 2024 Mar 15, 2024

Copy link to clipboard

Copied

Uh oh.

 

We have hit a snag with usedFonts which is going to force us to hold it back even longer in Beta than we had planned.

 

The issue is what usedAt.timeD actually represents? Our design was that one could do this:

var timeD = usedAt[j].timeD;
var layer = app.project.layerByID(layerID);
var td = layer.property("Source Text").valueAtTime(timeD, true/*preExpressionB*/);

...and you would get back the correct TextLayer.

 

@JohnColombo has found some arrangements of Layers which suggests that we have got this wrong somewhere, so we are scratching our heads trying to untangle why it works so well in a lot of cases but seemingly not all?

 

We will keep you updated.

 

Douglas Waterfall

After Effects Engineering

Votes

Translate

Translate

Report

Report
Adobe Employee ,
May 13, 2024 May 13, 2024

Copy link to clipboard

Copied

Hello...again. The good news is that moving to Release has never been closer!

 

The less good news is that we just made one more last little breaking change to the JSON while in Beta, available on or after 24.5.0 (34).

 

Back in March we had held this back from 24.3 and 24.4 releases because there was a difference of understanding about what timeD really meant as it did not behave as timeD in other layers behaved.

 

 

This has now been resolved with our understanding that for Text Layers only, the timeD one passes to valueAtTime() is actually Text Layer local/relative time and not Comp Time like other properties. Thus usedFonts also returns it as Text Layer local/relative as well.

 

The breaking change was to modify the JSON to make this naming more explicit. with the new API name changing timeD to be layerTimeD.

 

Nothing else changes, and we will be updating the docs shortly. We do think this is the last blocking issue.

 

Douglas Waterfall

After Effects Engineering

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Jun 24, 2024 Jun 24, 2024

Copy link to clipboard

Copied

LATEST

FYI: usedFonts / replaceFont has been (finally) released in 24.5

 

Thank you @Adirai Maji for assisting us in this effort - your report was vital to this outcome.

 

Douglas Waterfall

After Effects Engineering

Votes

Translate

Translate

Report

Report
Resources