-
Setting Font and Font Size (style.setFont & style.setFontSize) AE 2020 issue
Hello expressionists,
I’m having an issue setting the font and font size with the new expression features in AE 2020.
I have a text layer, with 2 drop down menus applied. One for the typeface, the other for font size. Both menus have a parseFloat expression applied to get there value form 2 dynamic text layers connected to a JSON file. Everything is working as it should with the parsed values.
The issue I’m facing is that I can only set either the font-size or the type-face, but not both. Below is the expression that I’ve applied to my Source Text. Both x and y work independently, but not together.
I think the problem is down to how I’ve structured the expression. I’ve tried to solve, but I’m lost. Any advice/help greatly appreciated.
Thanks in advance,
Ronanvar x = effect("type-face")("Menu").value;
var y = effect("font-size")("Menu").value;if ( x === 1 ) {
style.setFont("Helvetica-Light");
} else if ( x === 2 ) {
style.setFont("Helvetica");} else if ( x === 3 ) {
style.setFont("Helvetica-Bold");} else if ( x === 4 ) {
style.setFont("HelveticaNeue-Thin");
};if ( y === 1 ) {
style.setFontSize(240);
} else if (y === 2) {
style.setFontSize(200);
};