Bug 156921

Summary: No "Autofit text to object" for non-textbox drawing objects
Product: LibreOffice Reporter: Eyal Rozenberg <eyalroz1>
Component: ImpressAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: enhancement CC: eyalroz1, heiko.tietze, rb.henschel
Priority: medium    
Version: 7.6.0.3 release   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=156994
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 84909, 156920    

Description Eyal Rozenberg 2023-08-25 16:27:20 UTC
In Impress and in Draw, 

* Right-clicking a Text Box offers me an "Autofit Text" item on the context menu (i.e. "Autofit text font size to shape area"; see 156918).
* Right-clicking a Rectangle, or any other drawing object, does _not_ offer an "Autofit Text" item on the context menu.

I don't see why the text in shapes, especially simple ones like a rectangle, cannot be scaled to autofit the shape.
Comment 1 Regina Henschel 2023-08-25 21:02:31 UTC
@Eyal: What kind of rectangle do you mean? We have a rectangle in the "Legacy Rectangle toolbar" and a rectangle in the "Basic Shapes" category of the custom shapes.
Same for "other drawing objects". There exist a lot of object, which are used with text, in addition to the custom shapes, e.g. Polygon, Polyline, Bézier-curve, legacy oval, table-shape, form control, presentation outline, presentation title and subtitle.
Comment 2 Heiko Tietze 2023-08-28 10:03:04 UTC
Is the shrink-to-fit attribute available for ordinary shapes?
Comment 3 Eyal Rozenberg 2023-08-28 18:17:49 UTC
(In reply to Heiko Tietze from comment #2)
> Is the shrink-to-fit attribute available for ordinary shapes?

Yes:

https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part3-schema/OpenDocument-v1.3-os-part3-schema.html#__RefHeading__1420164_253892949

(and the attribute is indeed thus misnamed.)
Comment 4 Eyal Rozenberg 2023-08-28 18:23:38 UTC
(In reply to Regina Henschel from comment #1)
> @Eyal: What kind of rectangle do you mean? We have a rectangle in the
> "Legacy Rectangle toolbar" and a rectangle in the "Basic Shapes" category of
> the custom shapes.

Wait, the rectangle on the drawing toolbar directly, and the one in basic shapes, are two different things? :-O

Anyway, both of them, and all other shapes.

> Same for "other drawing objects". There exist a lot of object, which are
> used with text, in addition to the custom shapes, e.g. Polygon, Polyline,
> Bézier-curve, legacy oval, table-shape, form control, presentation outline,
> presentation title and subtitle.

I'd like to say all of them, but - perhaps the semantics are a bit hairy for the weirder shapes: It may not be clear what "fitting" means.

Let's say all shapes with topologically connected interiors. And if we want to be more lenient, let's say all convex shapes.

Of course, this issue also raises the question of why we have rectangular text areas for non-rectangular shapes, and why shouldn't autofit change the text area shape etc. but that's out-of-scope.
Comment 5 Heiko Tietze 2023-08-29 07:03:19 UTC
(In reply to Eyal Rozenberg from comment #3)
> (In reply to Heiko Tietze from comment #2)
> > Is the shrink-to-fit attribute available for ordinary shapes?
> https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part3-schema/
> OpenDocument-v1.3-os-part3-schema.html#__RefHeading__1420164_253892949

In this case it's a missing feature.
Comment 6 Eyal Rozenberg 2023-08-29 21:37:41 UTC
Bug 156994... that's what it _really_ means for text to fit an object!