Skip to main content
Participant
Feb 21, 2022 8:33 AM UTC
Answered

Script - font weight/thickness changes in a fluid dynamic gradient

Hello, I'm looking for a specific script that would create a fluid gradient change in thickness in a typeface, for example per line or per page? I would like to achieve the “wave”association, would anyone be so kind as share it with me? I know it exists since I used to have it. 

rob day
rob dayCorrect answer
Community Expert
Feb 21, 2022 5:34 PM UTC

By gradient do you mean a change in font weight (not color)?

 

Variable font weights can be scripted. This example changes the weight and width axes of a line of selected text set in Acumin Variable Concept:

 

 

 

app.selection[0].appliedFont = "Acumin Variable Concept	Regular"
var selectedText = app.selection[0].characters;
var t = selectedText[0];

var myDesignAxesName = t.appliedFont.designAxesName;
var myDesignAxesRange = t.appliedFont.designAxesRange;
var myDesignAxesValues = t.appliedFont.designAxesValues;
var wrange = myDesignAxesRange[0];
var w0 = wrange[0];
var w1 = wrange[1];
var wstep = (w1-w0)/selectedText.length;
var crange = myDesignAxesRange[1];
var c0 = crange[0];
var c1 = crange[1];
var cstep = (c1-c0)/selectedText.length;

for (s=0; s<selectedText.length; s++){
    myDesignAxesValues[0]=(w0+wstep*s);
    myDesignAxesValues[1]=(c0+cstep*s);
    selectedText[s].designAxes=myDesignAxesValues;
}

 

 

 

A line of text set with Acumin Variable:

 

 

13 replies

rob day
Community Expert
rob dayCommunity ExpertCorrect answer
Community Expert
Feb 21, 2022 5:34 PM UTC

By gradient do you mean a change in font weight (not color)?

 

Variable font weights can be scripted. This example changes the weight and width axes of a line of selected text set in Acumin Variable Concept:

 

 

 

app.selection[0].appliedFont = "Acumin Variable Concept	Regular"
var selectedText = app.selection[0].characters;
var t = selectedText[0];

var myDesignAxesName = t.appliedFont.designAxesName;
var myDesignAxesRange = t.appliedFont.designAxesRange;
var myDesignAxesValues = t.appliedFont.designAxesValues;
var wrange = myDesignAxesRange[0];
var w0 = wrange[0];
var w1 = wrange[1];
var wstep = (w1-w0)/selectedText.length;
var crange = myDesignAxesRange[1];
var c0 = crange[0];
var c1 = crange[1];
var cstep = (c1-c0)/selectedText.length;

for (s=0; s<selectedText.length; s++){
    myDesignAxesValues[0]=(w0+wstep*s);
    myDesignAxesValues[1]=(c0+cstep*s);
    selectedText[s].designAxes=myDesignAxesValues;
}

 

 

 

A line of text set with Acumin Variable:

 

 

Translate
notereAuthor
Participant
Feb 22, 2022 11:58 AM UTC

Just saw the answer now, thank you so much for sharing! Super cool 

 

Translate
James Gifford—NitroPress
Legend
Feb 21, 2022 4:38 PM UTC

My first thought is that this is something better/more easily accomplished in lllustrator. It would be a meticulous line-by-line tweak in ID, with the text wanting to reflow as it was expanded.

 

—

Translate
rob day
Community Expert
Community Expert
Feb 21, 2022 2:44 PM UTC

Can you create an example and post a screen capture?

Translate