Free-shape text formatting TeX line-breaking algorithm needs to know the widths of all the resulting lines in advance. That limits its applicability to free-shape layouts because the line width may depend on the vertical position of the line which in turn may depend on future page break and cannot be always known in advance. We will present a generalised version of the line breaking algorithm which works inside a general shape and allows vertical stretching of the formatted text. However, this generalised algorithm assumes interdependency of the line and page breaking and therefore cannot be easily integrated into TeX formatting model. We will discuss the necessary generalisations of TeX document and formatting model which would make reliable free-shape text formatting possible.