While drawing rectangles in LibreOffice Draw, checkboxes "Fit width to text" and "Fit height to text" are disabled

I’m creating a simple drawing in LibreOffice, version 5.3.4.2 (x64).

I add a simple rectangle and put some text inside it.
I press “F4” for modifying position and size and I’d like to adapt the size by fitting width and height to the text inside the rectangle.

This does not work, because the checkboxes “Fit width to text” and “Fit height to text” are disabled.
What can I do to enable those checkboxes?

Thanks in advance
Dominique

The available options depend on the kind of the shape. They can be better seen in Format>Text than in the Position and Size dialog. The “Fit width to text” and “Fit height to text” settings belong to a text-box. Therefore they are disabled in the Position and Size dialog, if the object is not a text-box.

The UI, the current behavior, and the file format does not fit well together. So you need to test, which kind of shape gives the desired behavior. To get a “rectangle” you can use: A legacy rectangle, a path, a polygon, a custom shape or a text box.

You can try these:

  • A custom shape with “Word wrap text in shape” on and “Resize shape to fit text” on. The width is kept as you have set it, and height will grow/shrink, when you enter more text or remove text.

  • A text-box (you can set line and filling as for other shapes) with “Fit width to text” on and “Fit height to text” on. But it has no auto scale in all cases. After removing lines, you need to drag the bottom edges yourself. And the width is bound to the paragraph width, no wrap available.

Thanks, I had no idea there was something like a textbox, especially created for having text in rectangles. I’ll just do the fitting by myself now.