Participant
January 8, 2024
Question
expression to change charachter font weight
- January 8, 2024
- 2 replies
- 1252 views
I am trying to create a script that would change the font weight of enery charachter from a word randomly every 3 frames?
The differents fonts weights are : light regular medium Semibold bold Black italic
I have found this on the internet but can not make it work :
var textLayer = this.textLayer;
var currentFontWeight = textLayer.sourceText.fontWeight;
var weights = ["Light", "Regular", "Medium", "SemiBold", "Bold", "Black italic"];
var index = Math.floor(Math.random() * weights.length);
var newFontWeight = weights[index];
setInterval(() => {
textLayer.sourceText.fontWeight = newFontWeight;
}, 3);
