Making text border follow the source text keyframes
Copy link to clipboard
Copied
I've been doing subtitle layers according to this tutorial:
https://www.youtube.com/watch?v=R2a-_flGOAk
I neded dynamic text boxes for multiline text.
This is working otherwise, but if I want to be able to change the source text of the main text layer in a way that the borders width scales with the main text. Now it only picks the width of the main text in the last keyframe.
The borders are parented to the main layer.
In the border layer source text i have expression:
borderText = "g\r".repeat(thisLayer.parent.text.sourceText.split("\r").length - 1); borderText += "g" ; thisLayer.parent.text.sourceText.style .setText(borderText) .setFont("Webdings") .setFontSize(1) .setAllCaps(false) .setSmallCaps(false) .setFillColor(style.fillColor)
and in the scale property I have added:
margins = [2, 1.7] * thisLayer.parent.text.sourceText.style.fontSize; x = linear(thisLayer.parent.sourceRectAtTime(outPoint - framesToTime(textIndex) - inPoint).width + margins[0], 0, 5000, 0, 100); y = linear(margins[1], 0, 5000, 0, 100); [x,y]
I can't seem to figure out how i could make the right reference here
Have something to add?

