Bug 116898 - Please provide Autofit option also for regular text boxes
Summary: Please provide Autofit option also for regular text boxes
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
5.3.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-09 14:14 UTC by sergio.callegari
Modified: 2018-10-19 08:59 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sergio.callegari 2018-04-09 14:14:29 UTC
Seems to be impossible to create a text box with the auto-fit property without copying and pasting a "click to add text" frame. Am I missing something or the "auto fit text" option is completely unavailable for regular text boxes?
Comment 1 Buovjaga 2018-04-18 12:46:56 UTC
Autofitting is working fine for regular, newly created text boxes here.
Autofit for the default "click to add text" is handled in master slide view, right-click context menu (there is a bug related to it: bug 104003).

Arch Linux 64-bit
Version: 6.1.0.0.alpha0+
Build ID: c8c74a0b4ca6f3a3619f423b6548c80c52392ae0
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on April 15th 2018
Comment 2 sergio.callegari 2018-04-18 12:56:21 UTC
> Autofitting is working fine for regular, newly created text boxes here.

On 6.0.3.2 if I do

libreoffice --impress
Insert -> Text box
Draw the box
Write some chars into it
Right click on the box, I see a context menu with no autofit toggle for the box.

Same in 5.4.5.1

Same in 5.3.7.2

Was it the object of changes in 6.1 (I see you are testing on it)?
Does not seem to be the kind of thing that can be os or platform dependent...
Comment 3 sergio.callegari 2018-04-18 12:58:16 UTC
Another thing that looks weird to me is that I cannot find any way to modify the autofit-status from styles
Comment 4 Buovjaga 2018-04-18 13:53:43 UTC
No, I meant two things:
1. The autofitting of text to the box width is working for me by default for new boxes
2. The autofit property of the template boxes is controlled in the master slide view: View - Master slide - right-click the box
Comment 5 Xisco Faulí 2018-06-12 09:54:46 UTC
(In reply to Buovjaga from comment #4)
> No, I meant two things:
> 1. The autofitting of text to the box width is working for me by default for
> new boxes
> 2. The autofit property of the template boxes is controlled in the master
> slide view: View - Master slide - right-click the box

Hello Sergio Callegari,
Could you please test what Buovjaga is suggesting?

I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' once you have tested it.
Comment 6 sergio.callegari 2018-06-12 10:15:23 UTC
Hi,
as a matter of fact I'm not talking of master pages.
And I am not talking of the fitting of the text to the box width.

there must have been some misunderstanding.

I am talking of regular slides.

If I do:

1) Open libreoffice with libreoffice --impress
2) Press F2 to get a new text box on the first slide
3) write some text in the text box
4) Right click on the new text box

I see no autofit tickbox on the context menu as for the default text boxes that come from the slide layout.

Now, this may be by design or a bug. If it is by design, please consider this as an enhancement request. The logic for autofitting text definitely exists, so it would be nice to be able to use it also on manually placed text boxes.
Comment 7 Buovjaga 2018-06-12 10:30:25 UTC
Yeah, let's dupe to bug 94927, which discusses having a global option for this.

*** This bug has been marked as a duplicate of bug 94927 ***
Comment 8 sergio.callegari 2018-06-12 10:46:12 UTC
Please no, do not set as duplicate.

Bug 94927 wants autofit off by default or a global option to have autofit off by default. I want neither and I am perfectly happy with the current defaults and lack of a one-more global option. If you do not want autofit, then it is enough to switch it off in the master pages. Incidentally, this is exactly what you noticed in your comment "The autofit property of the template boxes is controlled in the master slide view: View - Master slide - right-click the box".

My issue or enhancement request is that I would like to have the option to switch autofit also on "regular" (non-layout or master pages controlled) text boxes.
Comment 9 Buovjaga 2018-06-12 19:22:36 UTC
(In reply to sergio.callegari from comment #8)
> My issue or enhancement request is that I would like to have the option to
> switch autofit also on "regular" (non-layout or master pages controlled)
> text boxes.

You say "autofit also on", but do you actually mean "autofit also off"? Because autofit is on by default for regular text boxes.
Comment 10 sergio.callegari 2018-06-12 22:43:26 UTC
No, there is no autofit for regular text boxes.

Autofit is that feature by which you create a text box and while you write text into it, the font size of the text is progressively reduced, to keep the text fitting in the box.

This is what may happen in the layout boxes (those controlled via the master page) and which is ON by default. When autofit is supported by a box where you can enter text, you see it as a tickbox in the context menu (right click) as "Autofit Text" right after the "Text" entry and before the "Fontwork" one.

It is different from the Text options:

"Fit width to text" (off by default). When ON, makes the text box width grow while you type text in the text box.

"Fit height to text" (on by default). When ON, makes the text box height grow while you type text in the text box.

The combination "Fit width to text OFF" and "Fit height to text ON" makes the text box work so that as you type the text you type fits the box width while the box grows in height (and is probably what you refer to).

Autofit is also different from the Text option

"Fit to frame" (off by default). When ON, makes the text always fit the box, by "linear scaling" it, so that the text may look distorted (different scaling on X and Y dimensions).

Autofit never distorts the text, since it scales the font size and re-wraps.

Autofit is also a strange beast in LibO, for the fact that you seem to have no control on which boxes may get it. For instance the "click to add text" "content" boxes in the "title, content" and "title, 2 content" layouts get the autofit, but the "click to add title" box does not get it. Furthermore, the "click to add text" box in the "title slide" layout does not get it either.
Comment 11 Regina Henschel 2018-06-12 23:34:42 UTC
There exists two boolean attributes in file format: 'draw:fit-to-size' and 'style:shrink-to-fit'. They are general graphic-properties and can be applied to any shape. The implementation has been corrected by Michael Stahl (bug 97630), but there exist no UI yet.

Two boolean attributes results in four situations:

(A)draw:fit-to-size="true" and style:shrink-to-fit="false" is currently called "Fit-to-Frame" in the UI and is available in the UI for legacy rectangles and polygons and curves.

(B)draw:fit-to-size="false" and style:shrink-to-fit="true" has no UI and is the default setting for presentation outline shapes. That is what sergio calls "auto fit text".

(C)draw:fit-to-size="false" and style:shrink-to-fit="false" is currently the default for shapes other than presentation outline shapes.

(D)draw:fit-to-size="true" and style:shrink-to-fit="true" makes no sense. It is rendered same as (A). But the attribute style:shrink-to-fit="true" is kept, so when you disable draw:fit-to-size in the UI, you get situation (B).

To bring a graphic text box into situation (B), insert the text box in Impress and apply the presentation style 'Outline1'. Then open then "Text..." dialog and uncheck the checkbox 'Fit to Frame' in case it is checked. You can copy the text box to Draw, it keeps the property. But there exists no way in the UI to reset the text box to the default.

It is a valid request to get a UI to manually set the property "style:shrink-to-fit" on and off.
Comment 12 Maxim Monastirsky 2018-10-19 08:59:23 UTC
Autofit isn't present in the context menu by default, but it can be added via the customization dialog, and actually seems to work (I verified that it indeed writes style:shrink-to-fit="true" just like for outline boxes) => RESOLVED WORKSFORME.

For master I proposed including it in the context menu: https://gerrit.libreoffice.org/61972/