Skip to main content
Participant
February 21, 2022
Answered

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

  • February 21, 2022
  • 3 replies
  • 1174 views

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. 

Correct answer rob day

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:

 

 

3 replies

rob day
Community Expert
rob dayCommunity ExpertCorrect answer
Community Expert
February 21, 2022

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:

 

 

notereAuthor
Participant
February 22, 2022

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

 

James Gifford—NitroPress
Legend
February 21, 2022

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.

 

rob day
Community Expert
Community Expert
February 21, 2022

Can you create an example and post a screen capture?