I’m making a lot of assumptions here, but it might be helpful. I’m only considering the text layers themselves, I’m assuming there are 4 of them and that they are layers 1 thru 4 in the layer stack. I’m assuming the the margins at the edges of the comp will be half the spacing between the text layers. With that in mind, I think this position expression will space your text layers in the x direction:
n = 4; // number of text layers participating
// get total text width for all layers
w = 0;
for (i = 1; i <= n; i++){
w += thisComp.layer(i).sourceRectAtTime(time).width;
}
// calcuate extra space
s = thisComp.width - w;
gap = s/n; // gap between text layers
margin = gap/2
// calculate where my left edge should be
myLeftEdge = margin;
for (i = 1; i < index; i++){
myLeftEdge += thisComp.layer(i).sourceRectAtTime(time).width + gap;
}
// move this layer into position
[myLeftEdge - sourceRectAtTime(time).left, value[1]]