R, 270 265 252 243 232 227227 225 bytes
Edit:I finally managed to remove 2 more characters to bring the total to a number that can be represented in triangular form -9 bytes thanks(as shown here). Code should be formatted conventionally to Giuseppebe run (as in the example on TIO); the '•' represents a newline (\n
) character.
function f
unc
tion(
s,`~`=cbind`~`=c
bind,m=matrixm=ma
trix){n=ncharn=nch
ar(s)+1
p=m+1;p=m(,
n^2,2)
while;while(T<nT<
n){a=4*F
p[T+0a=4*F;p[T+0:a,
]=c(F:-F,(-F:F)[-1]
)~0:a-2*F
p[T+a+2*F;p[T+a+-2:a+3a+
3,]=(F=F+1)~(b=2*F-1):-b
T=T+2*a+4 b;T=T+2*a+4}
m=m;m=m(" ",n,n)
m[p[2 ;m[p[2:n-1,]+b+1]=el(strsplitstrspl
it(s,''))
n=apply;apply(m,1,cat,"
""•")}
Note that this approach has been comprehensively outgolfed by att's approach, although as consolation neither that nor any of the other current answers can be represented as a triangle...