Very, very cool idea and I was able to get it running! However after effects really chugs even with posterizeTime(0) thrown in when applicable. Will probably not be able to use this right now. but still quite happy with the result! Thank you so much!
Here’s the code I ended up using:
On the Source Text layer for the hidden text layer (layer name “ramptext”):
const sourcetext = thisComp.layer(“bounding box text”).text.sourceText;
const fontSize = timeToFrames(time);
style.setText(sourcetext).setFontSize(fontSize);
On the Source Text for the visible text layer (layer name “bounding box text”):
posterizeTime(0);
const maxHeight = 300;
const ramptext = thisComp.layer(“ramptext”);
const defaultsize = 100;
try{
for(i = 1; i <= timeToFrames(thisComp.duration) ; i++){
if(ramptext.sourceRectAtTime(framesToTime(i)).height < maxHeight)
n = i;
}
}catch(err){
n = defaultsize;
}
style.setFontSize(n)