Skip to main content
Participant
April 14, 2022
Question

Is there a way to add anchored images into text (a la InDesign) in After Effects?

Is there a way to insert an image into a text layer, so that it stays in place if the text is modified? The equivalent in InDesign would be an "anchored object".

In the attached image, ideally the heart would stay centered between "I" and "YOU" if the text is resized, or if the first word is changed to "WE", etc.

This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

ShiveringCactus
Community Expert
Community Expert
April 16, 2022

If it's literally a heart or similar emoticons/emojis, then most fonts have some of these included.

 https://copychar.cc/ is a nifty website to search and copy the characters needed.  

I'm also a big fan of https://fontawesome.com/ which is a free font you can install which had loads of icons etc...

 

 

Translate
Community Expert
April 15, 2022

You could get fancy and use sourceRectAtTime().width to get the width of two text layers and combine the layer size/scale or shape layer size plus a padding variable to keep the two text layers lined up with the graphic in between them. Justify the first line Right, justify the second line Left, then put the graphic below them both and add these expressions to a shape layer graphic centered on the anchor point, and you have it.

// First line position
shapeLayer = thisComp.layer(index + 2);
slScale = shapeLayer.scale[0] * .01;
slWidth = slScale * shapeLayer.sourceRectAtTime().width / 2;
slPosition = shapeLayer.position;
pad = 50;
x = slPosition[0] - slWidth - pad;
y = slPosition[1];
[x, y]


// Second line position
shapeLayer = thisComp.layer(index + 1);
slScale = shapeLayer.scale[0] * .01;
slWidth = slScale * shapeLayer.sourceRectAtTime().width / 2;
slPosition = shapeLayer.position;
pad = 50;
x = slPosition[0] + slWidth + pad;
y = slPosition[1];
[x, y]

The comp looks like this:

I have uploaded a project file.

Translate
Warren Heaton
Community Expert
Community Expert
April 15, 2022

On the AE side, you'd split it into 3 Text Layers parented to a Null Layer with the first word's Paragraph alignment right, the heart's Paragraph alignment center, and the third word's Paragraph alignment left.

 

Make sure that the Null Layer is centered to the heart and that the left word and right word are in the desired position prior to linking the Child text layers to the Parent null layer.

 

Use the Scale paremater of the Null Layer to resize.

 

 

Translate
Community Expert
April 14, 2022

Interesting but I don't believe that this is an available option.

Translate