I’m trying to understand the problem. Does this simplification work with your font?
What I'd like to do is keep fontSize constant and vary the lineHeight from line to line […]
source = 'lestextessociologiques'
fSize = 90
array = FormattedString()
ft = 'Helvetica'
lh_min = 100
lh_max = 200
lh_step = 10
temp = FormattedString()
for lh in range(lh_min, lh_max, lh_step):
temp.append(source, font=ft, fontSize=fSize, lineHeight=lh, align='center')
temp.append('\n')
array.append(temp)
newPage()
with savedState():
fill(1)
rect(0, 0, width(), height())
textBox(array, (0, 0, width(), height()))
fill(None); stroke(1, 0, 0)
y = height()
for lh in range(lh_min, lh_max, lh_step):
y -= lh
line((0, y), (width(), y))
saveImage('~/Desktop/baseline_test.png')