-
Dynamic Text scaling to fit inside of a shape ?
I am trying to figure out the expressions to make a text layer automatically resize to fit inside of a shape layer or any other layer for that matter.
I know this is possible as I have seen it work in the new essential graphics panel in Premiere, where when you change the text, it automatically resizes to fit an area.
I found some stuff about the “sourceRectAtTime” expression, and it works but it does not constrain proportions.
Any advice?????
// grab sourceRect based on layer time
R = sourceRectAtTime(sourceTime(time), true);// calculate scale relative to comp
w = thisComp.layer("Shape Layer 1").content("Rectangle Path 1").size[0] / R.width * 100;
h = thisComp.layer("Shape Layer 1").content("Rectangle Path 1").size[1] / R.height * 100;[w,h]

