The shape is probably sized to fit the text (TextFlow) inside. Layout asks
the GC to calculate the size of the string given a font. If the size of
the string is incorrect, the text may get truncated. See if
GC#stringExtents(...) returns the same size of the text as when the text
is painted. If not, you may want to call GC#setAdvanced(false). Layout
uses an off-screen GC to determine the size of the text in draw2d. If
off-screen GC is set up differently from the actual GC during painting
then text might be cut off as well.