Hello everyone, I've been working on some templates and as I'm going through all the small bits and pieces I came across an issue that I haven't been able to fix.
I have a text file with expressions that will (based on a checkbox) use two different fonts - This part is working fine
I also have an expression to set the leading to a specific size based on our design guidelines - This is also working fine.
But when I have both of them, only one is working properly. I've tried changing the place of the variables and so far, no luck... so any pointers or help on how to write more than one expression and having them both working would be really apreciated
here's my code:
Text leading -
txsz=thisComp.layer("Text").text.sourceText.style.fontSize; setLead = txsz*1.1; text.sourceText.style.setLeading(setLead);
Text font -
var GTFont =text.sourceText.style.setFont("GTHaptikBold");
var ArialFont = text.sourceText.style.setFont("Arial-BoldMT");
var selec=effect("GT Haptik")("Checkbox");
if (selec == true) {
GTFont
} else {
ArialFont
};
Combined - In this case, the font works but not the leading
txsz=thisComp.layer("Text").text.sourceText.style.fontSize;
setLead = txsz*1.1;
text.sourceText.style.setLeading(setLead);
var GTFont =text.sourceText.style.setFont("GTHaptikRegular");
var ArialFont = text.sourceText.style.setFont("ArialMT");
var selec=thisComp.layer("Themes").effect("Checkbox Control")("Checkbox");
if (selec == true) {
GTFont
} else if (selec == false){
ArialFont }else{ (ArialFont)
};
Combined 2 - In this case, the leading works but not the font.
var txsz=thisComp.layer("Text").text.sourceText.style.fontSize;
setLead = txsz*1.1;
text.sourceText.style.setLeading(setLead);
var GTFont =text.sourceText.style.setFont("GTHaptikRegular");
var ArialFont = text.sourceText.style.setFont("ArialMT");
var selec=thisComp.layer("Themes").effect("Checkbox Control")("Checkbox");
if (selec == true) {
GTFont
} else if (selec == false){
ArialFont }else{ (ArialFont)
};
var txsz=thisComp.layer("Text").text.sourceText.style.fontSize;
setLead = txsz*1.1;
text.sourceText.style.setLeading(setLead);