Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
Calcule el tamaño de fuente de una cadena para que quepa en una caja

En After Effects, tengo una cadena, tengo un tipo de letra, tengo el ancho y el alto de una composición. ¿Cómo obtengo el tamaño de fuente correcto para que se ajuste a la cadena en la composición, sin que se desborde?

Programador novato aquí.

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Podría calcular el tamaño de píxel, sin embargo (nuevamente) Adobe restringe el tamaño a 1296 Px. Por lo tanto, debe ir por escala de su capa de texto.

En el parámetro de escala del texto, agregue la siguiente expresión:

 var myTextSize = sourceRectAtTime(); var ratio = myTextSize.width / myTextSize.height; var compRatio = thisComp.width/thisComp.height; if(ratio >= compRatio) { var factor = thisComp.width / myTextSize.width; [scale[0] * factor, scale[1] * factor] } else{ var factor = thisComp.height / myTextSize.height; [scale[0] * factor, scale[1] * factor] }

Esta expresión escala el texto según el ancho y el alto de su borrador.

Sin embargo, todavía no está centrado. Si quieres eso, necesitas agregar otra expresión. Esta vez en su punto de anclaje:

 var boundingbox = sourceRectAtTime(); [boundingbox.left + boundingbox.width/2, boundingbox.top + boundingbox.height/2 ];

Esto debería funcionar.

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!