Activity › Forums › Adobe After Effects Expressions › fit text size to solid layer
-
fit text size to solid layer
Posted by Shai Russo on February 2, 2014 at 8:59 amHi guys,
I have a project requires a match between the size of the text layer and a transparent layer that lies below .
I update the text using sourceText=”1234567489″ .
I just need to adjust the solid layer to fit his size automaticallythanks shai
shai russo
Joel Friedline replied 12 years, 2 months ago 4 Members · 4 Replies -
4 Replies
-
Dan Ebberts
February 2, 2014 at 6:35 pmThere’s no good way to measure text extents with expressions. There’s a hack using sampleImage() (you can search for it on this site), but the performance (speed-wise) is not very good. It’s easy with scripting, using sourceRectAtTime(), but you’d have to run the script each time you change the text.
Dan
-
Kevin Camp
February 3, 2014 at 6:06 pmthis procedure won’t fit the text layer to a solid’s size, but will put a solid panel behind the text, which may be what you are looking for.
to your text layer add the following:
- fast blur, set blur to 5 for starters (you can change later as needed)
- shift channels effect, setting ‘take alpha from’ to ‘full’
- fill effect, set color as needed
- cc composite, default settings
your text should now appear be on a solid rectangle. you can adjust the blur amount to set the amount of padding/border around the text. if you change the text, the solid panel will change accordingly.
if you needed to adjust the opacity of the slid panel, you can decrease the opacity of the fill effect and also uncheck the ‘rgb only’ option in cc composite.
if you use this often, you can select all the effects and then choose animation>save animation preset and you can recall it when ever you needed it.
Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW -
Joel Friedline
August 1, 2014 at 3:20 pmFirst off I love this effect. Brilliant combo.
I am setting up a project where I wanted to have a null with controls control the font colors, background colors, and shape colors throughout an entire project, but with this combination of effects I couldn’t link the font color the way I had it originally.
My workaround was to add a “Change to color” effect:
For the “from” Color, sample your text (which I had set to a nice bright green)
For the “To” color sample you can link it to your controller layer. For instance comp(“Show Opener”).layer(“Null 1”).effect(“Main Font”)(“Color”)
After linking the color to your controller be sure to change the “change” dropdown to Hue, Lightness, and saturation.
I know most people probably have a more elegant solution, but I’m trying to create something with a lot of text and wanted to be able to do this effect a couple dozen times without having the change each font color individually in order to adjust.
Reply to this Discussion! Login or Sign Up
