I think you can make this formula a lot simpler. I haven’t actually tested this, but I did verify that the syntax is correct.
ignore("",
cache(length(info(“matrixcelldata”)),"tlen"),
cache(
?(tlen<=20,15,
tlen<=22,14,
tlen<=23,13.5,
tlen<=25,12.5,
tlen<=28,11.7,
tlen<=30,11,
tlen<=32,9.6,
9.4)
,"tsize")
)+
"<size:"+str(tsize)+">"+info("matrixcelldata")
In addition to being easier to understand and modify, this should also be faster, because it only calculates the length of the text once instead of 8 times. This may not matter in this version, but I think it might be an important difference if you change to using the measure text( function, which might take quite a bit more time than just counting characters.
To explain further, this formula uses the cache( function to create two temporary variables, tlen and tsize. First the number of characters is calculated, by using a variable we eliminate the need to do this over and over.
Then the number of characters is converted into the text height. This formula takes advantage of the fact that the ?( function can have an unlimited number of if-else pairs. This is much simpler to set up and eliminates the need for the between( function.
The ignore( function allows the variables to be calculated without modifying the final result.
Of course the indentation is not necessary, I just did that to make it more readable.