Does text centering work correctly in Impress?

We have a very simple presentation made up only of text boxes. We want all text to be centered horizontally. We have set the alignment of the text box to centered, which works. We then select the text within the box and click the centering format button. In some cases this works, in others the text is offset to the right as if there is a margin or indent applied within the box. In those cases, clicking the ‘left’ justification button leaves a space between the border and the text, whereas the ‘right’ justification places the text fully against the right border of the box as expected. Are we doing something wrong, or is there a bug with text formatting?

I realize the question is old, but it’s hardly irrelevant or outdated. It characterized exactly the issue I was having with Impress (LO v6.0) and the answer was exactly what I needed…

To understand the text alignment let us explore it. Write a long and two short lines into the text box. Then go to the “Text” item from the context menu. There is a check box “Full width”, uncheck it. Goto the “Line” item from the context menu and set the line style to “continuous”, so you can see, where the object boundaries are.

Mark all text lines together and click on the right, center and left alignment icons in the “Text Formatting” toolbar. Notice, that the text is aligned to the rectangle, which is determined by the width of the longest text line. Left or right margins relative to this rectangle are given by the “Indent” property of the paragraph.

Now go to the “Text” item from the context menu. You see the property “Text anchor”. With this setting you determine the position of the previous noticed text rectangle relative to the border of the box. For this alignment the numeric fields on the left give the offset of text rectangle to the anchor border, where negative values mean, that the text rectangle is positioned outside the border.

When you check “Full width”, then the text rectangle is not determined by the width of the longest text line, but by the width of the box. In that case only center anchor position is meaningful. The offset relative to the border works the same as above.

I have only described the behavior as direct formatting. You can do all this settings in the style too. So it is possible that the settings in the style contradict the direct formatting. In this case the direct formatting wins. To remove direct formatting use Format > Default Formatting.

In your case you need to look, whether the additional space is made by the “Indent” property of the paragraph or by the anchor offset of the “Text” property and you have to look whether the settings are direct settings or settings in the style.

I think alignment is correct in Impress, but it is a little bit confusing.

Thank you! We were using one of the example formats which apparently had an anchor offset. When we created our own ‘generic’ text boxes things worked as expected.

Getting help for a program from people who I assume write the code is like asking a writer how to print a book. In this instance assuming that everyone knows how to get to “context menu” from where they are having the problem is backasswards. In this case you should tell everyone how to get to a context menu from anywhere in a presentation. The help just tells you to click on the object and a context menu appears. It does, but not the one you describe. Your approach is similar to Mozilla’s.