Display text in various formats in the same component

It’s more about displaying a row of text elements (labels) than stemming the terms.

I suppose each of labels can be formatted individually (italic, bold …), and the logic of displaying a specific text element or not is doable.

However, I played with all the containers but couldn’t find anything to set the width of a label (corresponding to its content, i. e. to the number of characters displayed) and to move labels on the right accordingly. The closest container that matches my needs is XY Panel, to dynamically move the labels.